[pypy-svn] r74707 - in pypy/branch/blackhole-improvement/pypy/jit/metainterp: . test

arigo at codespeak.net arigo at codespeak.net
Mon May 24 15:55:38 CEST 2010


Author: arigo
Date: Mon May 24 15:55:36 2010
New Revision: 74707

Modified:
   pypy/branch/blackhole-improvement/pypy/jit/metainterp/pyjitpl.py
   pypy/branch/blackhole-improvement/pypy/jit/metainterp/test/test_exception.py
Log:
Fixes.


Modified: pypy/branch/blackhole-improvement/pypy/jit/metainterp/pyjitpl.py
==============================================================================
--- pypy/branch/blackhole-improvement/pypy/jit/metainterp/pyjitpl.py	(original)
+++ pypy/branch/blackhole-improvement/pypy/jit/metainterp/pyjitpl.py	Mon May 24 15:55:36 2010
@@ -1344,6 +1344,7 @@
         # detect and propagate some exceptions early:
         #  - AssertionError
         #  - all subclasses of JitException
+        excvaluebox = self.last_exc_value_box
         if we_are_translated():
             from pypy.jit.metainterp.warmspot import JitException
             e = self.cpu.ts.get_exception_obj(excvaluebox)
@@ -1675,10 +1676,17 @@
         elif opnum == rop.GUARD_NO_EXCEPTION or opnum == rop.GUARD_EXCEPTION:
             exception = self.cpu.grab_exc_value()
             if exception:
+                if not we_are_translated():
+                    from pypy.rpython.lltypesystem import rclass
+                    etype = rclass.ll_type(exception)
+                    exception = LLException(etype, exception)
                 self.execute_raised(exception)
             else:
                 self.execute_did_not_raise()
-            self.handle_possible_exception()
+            try:
+                self.handle_possible_exception()
+            except ChangeFrame:
+                pass
         elif opnum == rop.GUARD_NO_OVERFLOW:   # an overflow now detected
             self.execute_raised(OverflowError(), constant=True)
             try:

Modified: pypy/branch/blackhole-improvement/pypy/jit/metainterp/test/test_exception.py
==============================================================================
--- pypy/branch/blackhole-improvement/pypy/jit/metainterp/test/test_exception.py	(original)
+++ pypy/branch/blackhole-improvement/pypy/jit/metainterp/test/test_exception.py	Mon May 24 15:55:36 2010
@@ -516,11 +516,10 @@
         assert res == -1
         self.check_tree_loop_count(2)      # the loop and the entry path
         # we get:
-        #    ENTER             - compile the new loop
-        #    ENTER (BlackHole) - leave
-        #    ENTER             - compile the entry bridge
-        #    ENTER             - compile the leaving path (raising MyError)
-        self.check_enter_count(4)
+        #    ENTER    - compile the new loop
+        #    ENTER    - compile the entry bridge
+        #    ENTER    - compile the leaving path (raising MyError)
+        self.check_enter_count(3)
 
 
     def test_bridge_from_interpreter_exc_2(self):



More information about the Pypy-commit mailing list