[pypy-svn] r74280 - in pypy/branch/blackhole-improvement/pypy/jit/codewriter: . test

arigo at codespeak.net arigo at codespeak.net
Fri Apr 30 14:17:00 CEST 2010


Author: arigo
Date: Fri Apr 30 14:16:59 2010
New Revision: 74280

Modified:
   pypy/branch/blackhole-improvement/pypy/jit/codewriter/flatten.py
   pypy/branch/blackhole-improvement/pypy/jit/codewriter/test/test_flatten.py
Log:
Don't need to check that we got OverflowError if
int_xxx_ovf raises.


Modified: pypy/branch/blackhole-improvement/pypy/jit/codewriter/flatten.py
==============================================================================
--- pypy/branch/blackhole-improvement/pypy/jit/codewriter/flatten.py	(original)
+++ pypy/branch/blackhole-improvement/pypy/jit/codewriter/flatten.py	Fri Apr 30 14:16:59 2010
@@ -155,12 +155,16 @@
         elif block.exitswitch is c_last_exception:
             # An exception block. See test_exc_exitswitch in test_flatten.py
             # for an example of what kind of code this makes.
+            lastopname = block.operations[-1].opname
             assert block.exits[0].exitcase is None # is this always True?
             self.emitline('catch_exception', TLabel(block.exits[0]))
             self.make_link(block.exits[0])
             self.emitline(Label(block.exits[0]))
             for link in block.exits[1:]:
-                if link.exitcase is Exception:
+                if (link.exitcase is Exception or
+                    (link.exitcase is OverflowError and
+                     lastopname.startswith('int_') and
+                     lastopname.endswith('_ovf'))):
                     # this link captures all exceptions
                     self.make_exception_link(link)
                     break

Modified: pypy/branch/blackhole-improvement/pypy/jit/codewriter/test/test_flatten.py
==============================================================================
--- pypy/branch/blackhole-improvement/pypy/jit/codewriter/test/test_flatten.py	(original)
+++ pypy/branch/blackhole-improvement/pypy/jit/codewriter/test/test_flatten.py	Fri Apr 30 14:16:59 2010
@@ -399,8 +399,5 @@
             catch_exception L1
             int_return %i2
             L1:
-            goto_if_exception_mismatch $<* struct object_vtable>, L2
             int_return $42
-            L2:
-            reraise
         """, transform=True)



More information about the Pypy-commit mailing list