[pypy-commit] pypy jitframe-on-heap: enough wrangling to pass the test

fijal noreply at buildbot.pypy.org
Wed Jan 9 16:28:48 CET 2013


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: jitframe-on-heap
Changeset: r59889:a94c9ca09e9e
Date: 2013-01-09 17:28 +0200
http://bitbucket.org/pypy/pypy/changeset/a94c9ca09e9e/

Log:	enough wrangling to pass the test

diff --git a/pypy/jit/backend/llsupport/llmodel.py b/pypy/jit/backend/llsupport/llmodel.py
--- a/pypy/jit/backend/llsupport/llmodel.py
+++ b/pypy/jit/backend/llsupport/llmodel.py
@@ -271,8 +271,7 @@
                                                       abiname)
 
     def get_latest_descr(self, deadframe):
-        XXX
-        deadframe = lltype.cast_opaque_ptr(jitframe.DEADFRAMEPTR, deadframe)
+        deadframe = lltype.cast_opaque_ptr(jitframe.JITFRAMEPTR, deadframe)
         descr = deadframe.jf_descr
         return history.AbstractDescr.show(self, descr)
 
diff --git a/pypy/jit/backend/x86/runner.py b/pypy/jit/backend/x86/runner.py
--- a/pypy/jit/backend/x86/runner.py
+++ b/pypy/jit/backend/x86/runner.py
@@ -2,6 +2,7 @@
 from pypy.rpython.lltypesystem import lltype, llmemory, rffi
 from pypy.rpython.lltypesystem.lloperation import llop
 from pypy.rpython.llinterp import LLInterpreter
+from pypy.rpython.annlowlevel import cast_instance_to_gcref
 from pypy.rlib.objectmodel import we_are_translated, specialize
 from pypy.rlib.jit_hooks import LOOP_RUN_CONTAINER
 from pypy.jit.codewriter import longlong
@@ -101,7 +102,7 @@
             setitem(index, null)
 
     def make_execute_token(self, *ARGS):
-        FUNCPTR = lltype.Ptr(lltype.FuncType([jitframe.JITFRAME],
+        FUNCPTR = lltype.Ptr(lltype.FuncType([llmemory.GCREF],
                                              lltype.Signed))
         #
         def execute_token(executable_token, *args):
@@ -113,20 +114,21 @@
             #llop.debug_print(lltype.Void, ">>>> Entering", addr)
             frame = lltype.malloc(jitframe.JITFRAME, clt.frame_depth)
             frame.jf_frame_info = clt.frame_info
+            ll_frame = lltype.cast_opaque_ptr(llmemory.GCREF, frame)
             prev_interpreter = None   # help flow space
             if not self.translate_support_code:
                 prev_interpreter = LLInterpreter.current_interpreter
                 LLInterpreter.current_interpreter = self.debug_ll_interpreter
             try:
-                import pdb
-                pdb.set_trace()
-                descr_no = func(frame)
-                xxx
+                # XXX parameters
+                descr_no = func(ll_frame)
             finally:
                 if not self.translate_support_code:
                     LLInterpreter.current_interpreter = prev_interpreter
             #llop.debug_print(lltype.Void, "<<<< Back")
-            return frame
+            descr = self.get_fail_descr_from_number(descr_no)
+            frame.jf_descr = cast_instance_to_gcref(descr)
+            return ll_frame
         return execute_token
 
     def cast_ptr_to_int(x):
diff --git a/pypy/rpython/annlowlevel.py b/pypy/rpython/annlowlevel.py
--- a/pypy/rpython/annlowlevel.py
+++ b/pypy/rpython/annlowlevel.py
@@ -6,7 +6,7 @@
 from pypy.annotation import model as annmodel
 from pypy.annotation.policy import AnnotatorPolicy, Sig
 from pypy.annotation.specialize import flatten_star_args
-from pypy.rpython.lltypesystem import lltype
+from pypy.rpython.lltypesystem import lltype, llmemory
 from pypy.rpython.ootypesystem import ootype
 from pypy.rpython import extregistry
 from pypy.objspace.flow.model import Constant
@@ -512,6 +512,11 @@
 def cast_instance_to_base_obj(instance):
     return cast_object_to_ptr(base_obj_ootype(), instance)
 
+ at specialize.argtype(0)
+def cast_instance_to_gcref(instance):
+    return lltype.cast_opaque_ptr(llmemory.GCREF,
+                                  cast_instance_to_base_ptr(instance))
+
 def base_ptr_lltype():
     from pypy.rpython.lltypesystem.rclass import OBJECTPTR
     return OBJECTPTR


More information about the pypy-commit mailing list