Author: Armin Rigo <[email protected]>
Branch: jit-simplify-backendintf
Changeset: r50395:874a608a3377
Date: 2011-12-11 21:28 +0100
http://bitbucket.org/pypy/pypy/changeset/874a608a3377/

Log:    Translation fixes (front-end only so far).

diff --git a/pypy/jit/backend/llgraph/runner.py 
b/pypy/jit/backend/llgraph/runner.py
--- a/pypy/jit/backend/llgraph/runner.py
+++ b/pypy/jit/backend/llgraph/runner.py
@@ -264,8 +264,16 @@
         """Calls the assembler generated for the given loop.
         Returns the ResOperation that failed, of type rop.FAIL.
         """
-        # XXX RPythonize me
-        for index, x in enumerate(args):
+        if we_are_translated():
+            assert len(args) <= 10
+            iterator = unrolling_iterable_10
+        else:
+            iterator = range(len(args))
+        #
+        for index in iterator:
+            if index == len(args):
+                break
+            x = args[index]
             TYPE = lltype.typeOf(x)
             if TYPE == lltype.Signed:
                 llimpl.set_future_value_int(index, x)
@@ -692,6 +700,8 @@
         return x
 
 
+unrolling_iterable_10 = unrolling_iterable(range(10))
+
 def make_getargs(ARGS):
     argsiter = unrolling_iterable(ARGS)
     args_n = len([ARG for ARG in ARGS if ARG is not ootype.Void])
diff --git a/pypy/jit/metainterp/warmspot.py b/pypy/jit/metainterp/warmspot.py
--- a/pypy/jit/metainterp/warmspot.py
+++ b/pypy/jit/metainterp/warmspot.py
@@ -771,16 +771,16 @@
 
         def assembler_call_helper(failindex, virtualizableref):
             fail_descr = self.cpu.get_fail_descr_from_number(failindex)
-            while True:
-                if vinfo is not None:
-                    virtualizable = lltype.cast_opaque_ptr(
-                        vinfo.VTYPEPTR, virtualizableref)
-                    vinfo.reset_vable_token(virtualizable)
-                try:
-                    loop_token = fail_descr.handle_fail(self.metainterp_sd, jd)
-                except JitException, e:
-                    return handle_jitexception(e)
-                fail_descr = self.execute_token(loop_token)
+            if vinfo is not None:
+                virtualizable = lltype.cast_opaque_ptr(
+                    vinfo.VTYPEPTR, virtualizableref)
+                vinfo.reset_vable_token(virtualizable)
+            try:
+                fail_descr.handle_fail(self.metainterp_sd, jd)
+            except JitException, e:
+                return handle_jitexception(e)
+            else:
+                assert 0, "should have raised"
 
         jd._assembler_call_helper = assembler_call_helper # for debugging
         jd._assembler_helper_ptr = self.helper_func(
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to