[pypy-svn] r75042 - in pypy/branch/blackhole-improvement/pypy/jit: codewriter metainterp

arigo at codespeak.net arigo at codespeak.net
Thu Jun 3 12:38:51 CEST 2010


Author: arigo
Date: Thu Jun  3 12:38:49 2010
New Revision: 75042

Modified:
   pypy/branch/blackhole-improvement/pypy/jit/codewriter/flatten.py
   pypy/branch/blackhole-improvement/pypy/jit/metainterp/blackhole.py
   pypy/branch/blackhole-improvement/pypy/jit/metainterp/pyjitpl.py
Log:
Add "unreachable" as a real bytecode instead of just hoping.
Remove a comment that is not completely untrue, but useless.


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	Thu Jun  3 12:38:49 2010
@@ -245,6 +245,7 @@
                 if block.exits[-1].exitcase == 'default':
                     self.make_link(block.exits[-1])
                 else:
+                    self.emitline("unreachable")
                     self.emitline("---")
             #
             self.emitline('-live-')

Modified: pypy/branch/blackhole-improvement/pypy/jit/metainterp/blackhole.py
==============================================================================
--- pypy/branch/blackhole-improvement/pypy/jit/metainterp/blackhole.py	(original)
+++ pypy/branch/blackhole-improvement/pypy/jit/metainterp/blackhole.py	Thu Jun  3 12:38:49 2010
@@ -718,6 +718,10 @@
         except KeyError:
             return pc
 
+    @arguments()
+    def bhimpl_unreachable():
+        raise AssertionError("unreachable")
+
     # ----------
     # exception handling operations
 
@@ -1305,9 +1309,7 @@
 
 def convert_and_run_from_pyjitpl(metainterp):
     # Get a chain of blackhole interpreters and fill them by copying
-    # 'metainterp.framestack'.  Note that the order is important: the
-    # first one we get must be the bottom one, in order to make
-    # the comment in BlackholeInterpreter.setposition() valid.
+    # 'metainterp.framestack'.
     debug_start('jit-blackhole')
     metainterp_sd = metainterp.staticdata
     metainterp_sd.profiler.start_blackhole()

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	Thu Jun  3 12:38:49 2010
@@ -324,6 +324,10 @@
         except KeyError:
             pass
 
+    @arguments()
+    def opimpl_unreachable(self):
+        raise AssertionError("unreachable")
+
     @arguments("descr")
     def opimpl_new(self, sizedescr):
         return self.execute_with_descr(rop.NEW, sizedescr)



More information about the Pypy-commit mailing list