Author: Armin Rigo <[email protected]>
Branch: continulet-jit-3
Changeset: r58135:97d07c32e868
Date: 2012-10-15 16:41 +0200
http://bitbucket.org/pypy/pypy/changeset/97d07c32e868/

Log:    Fixes to compile_tmp_callback

diff --git a/pypy/jit/backend/llgraph/llimpl.py 
b/pypy/jit/backend/llgraph/llimpl.py
--- a/pypy/jit/backend/llgraph/llimpl.py
+++ b/pypy/jit/backend/llgraph/llimpl.py
@@ -1061,6 +1061,7 @@
                     raise Exception("Nonsense type %s" % TYPE)
 
             subframe = self.cpu._execute_token(loop_token)
+            jd = loop_token.outermost_jitdriver_sd
             assembler_helper_ptr = jd.assembler_helper_adr.ptr  # fish
             assembler_helper = assembler_helper_ptr._obj._callable
             try:
diff --git a/pypy/jit/metainterp/compile.py b/pypy/jit/metainterp/compile.py
--- a/pypy/jit/metainterp/compile.py
+++ b/pypy/jit/metainterp/compile.py
@@ -823,7 +823,7 @@
 class PropagateExceptionDescr(AbstractFailDescr):
     def handle_fail(self, metainterp_sd, jitdriver_sd, jitframe):
         cpu = metainterp_sd.cpu
-        exception = cpu.grab_exc_value(jitframe)
+        exception = cpu.get_finish_value_ref(jitframe)
         assert exception, "PropagateExceptionDescr: no exception??"
         raise metainterp_sd.ExitFrameWithExceptionRef(cpu, exception)
 
@@ -833,7 +833,6 @@
     calls back the interpreter.  Used temporarily: a fully compiled
     version of the code may end up replacing it.
     """
-    XXXX # fix me
     jitcell_token = make_jitcell_token(jitdriver_sd)
     nb_red_args = jitdriver_sd.num_red_args
     assert len(redargtypes) == nb_red_args
@@ -872,6 +871,7 @@
         ResOperation(rop.FINISH, finishargs, None, descr=jd.portal_finishtoken)
         ]
     operations[1].setfailargs([])
+    operations[2].setfailargs([])
     operations = get_deep_immutable_oplist(operations)
     cpu.compile_loop(inputargs, operations, jitcell_token, log=False)
     if memory_manager is not None:    # for tests
diff --git a/pypy/jit/metainterp/test/test_compile.py 
b/pypy/jit/metainterp/test/test_compile.py
--- a/pypy/jit/metainterp/test/test_compile.py
+++ b/pypy/jit/metainterp/test/test_compile.py
@@ -165,7 +165,7 @@
         portal_runner_ptr = llhelper(lltype.Ptr(FUNC), ll_portal_runner)
         portal_runner_adr = llmemory.cast_ptr_to_adr(portal_runner_ptr)
         portal_calldescr = cpu.calldescrof(FUNC, FUNC.ARGS, FUNC.RESULT, None)
-        portal_finishtoken = compile.DoneWithThisFrameDescrInt()
+        portal_finishtoken = compile.DoneWithThisFrameDescrInt(None, None)
         num_red_args = 2
         result_type = INT
     #
@@ -184,7 +184,7 @@
     jit_frame = cpu.execute_token(loop_token, -156, -178)
     fail_descr = cpu.get_latest_descr(jit_frame)
     assert isinstance(fail_descr, compile.PropagateExceptionDescr)
-    got = cpu.grab_exc_value(jit_frame)
+    got = cpu.get_finish_value_ref(jit_frame)
     assert lltype.cast_opaque_ptr(lltype.Ptr(EXC), got) == llexc
     #
     class FakeMetaInterpSD:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to