[pypy-svn] pypy jit-short-preamble: @loop_invariant functions are no longer allowed to raise exceptions

hakanardo commits-noreply at bitbucket.org
Fri Jan 21 17:45:56 CET 2011


Author: Hakan Ardo <hakan at debian.org>
Branch: jit-short-preamble
Changeset: r41164:8b87e761a1da
Date: 2011-01-21 17:45 +0100
http://bitbucket.org/pypy/pypy/changeset/8b87e761a1da/

Log:	@loop_invariant functions are no longer allowed to raise exceptions

diff --git a/pypy/jit/metainterp/optimizeopt/unroll.py b/pypy/jit/metainterp/optimizeopt/unroll.py
--- a/pypy/jit/metainterp/optimizeopt/unroll.py
+++ b/pypy/jit/metainterp/optimizeopt/unroll.py
@@ -435,8 +435,6 @@
                 if effectinfo.extraeffect == EffectInfo.EF_LOOPINVARIANT or \
                    effectinfo.extraeffect == EffectInfo.EF_PURE:
                     return True
-        elif opnum == rop.GUARD_NO_EXCEPTION:
-            return True # FIXME: Is this safe?
         return False
     
     def update(self, op):

diff --git a/pypy/jit/codewriter/effectinfo.py b/pypy/jit/codewriter/effectinfo.py
--- a/pypy/jit/codewriter/effectinfo.py
+++ b/pypy/jit/codewriter/effectinfo.py
@@ -10,9 +10,9 @@
 
     # the 'extraeffect' field is one of the following values:
     EF_PURE                            = 0 #pure function (and cannot raise)
-    EF_CANNOT_RAISE                    = 1 #a function which cannot raise
-    EF_CAN_RAISE                       = 2 #normal function (can raise)
-    EF_LOOPINVARIANT                   = 3 #special: call it only once per loop
+    EF_LOOPINVARIANT                   = 1 #special: call it only once per loop
+    EF_CANNOT_RAISE                    = 2 #a function which cannot raise
+    EF_CAN_RAISE                       = 3 #normal function (can raise)
     EF_FORCES_VIRTUAL_OR_VIRTUALIZABLE = 4 #can raise and force virtualizables
 
     # the 'oopspecindex' field is one of the following values:

diff --git a/pypy/jit/metainterp/pyjitpl.py b/pypy/jit/metainterp/pyjitpl.py
--- a/pypy/jit/metainterp/pyjitpl.py
+++ b/pypy/jit/metainterp/pyjitpl.py
@@ -1203,7 +1203,7 @@
                     self.execute_varargs(rop.CALL, allboxes, descr, False))
             elif effect == effectinfo.EF_LOOPINVARIANT:
                 return self.execute_varargs(rop.CALL_LOOPINVARIANT, allboxes,
-                                            descr, True)
+                                            descr, False)
             else:
                 return self.execute_varargs(rop.CALL, allboxes, descr, True)
 


More information about the Pypy-commit mailing list