[pypy-svn] r71517 - pypy/branch/guard-value-counting-2/pypy/jit/metainterp

arigo at codespeak.net arigo at codespeak.net
Fri Feb 26 14:03:09 CET 2010


Author: arigo
Date: Fri Feb 26 14:03:07 2010
New Revision: 71517

Modified:
   pypy/branch/guard-value-counting-2/pypy/jit/metainterp/compile.py
   pypy/branch/guard-value-counting-2/pypy/jit/metainterp/pyjitpl.py
Log:
Move the call to must_compile_from_failure() into the ResumeGuardDescr.
Avoids the hack of storing -2 in ResumeGuardForcedDescr.


Modified: pypy/branch/guard-value-counting-2/pypy/jit/metainterp/compile.py
==============================================================================
--- pypy/branch/guard-value-counting-2/pypy/jit/metainterp/compile.py	(original)
+++ pypy/branch/guard-value-counting-2/pypy/jit/metainterp/compile.py	Fri Feb 26 14:03:07 2010
@@ -228,8 +228,10 @@
 
     def handle_fail(self, metainterp_sd):
         from pypy.jit.metainterp.pyjitpl import MetaInterp
+        warmrunnerstate = self.metainterp_sd.state
+        must_compile = warmrunnerstate.must_compile_from_failure(self)
         metainterp = MetaInterp(metainterp_sd)
-        return metainterp.handle_guard_failure(self)
+        return metainterp.handle_guard_failure(self, must_compile)
 
     def compile_and_attach(self, metainterp, new_loop):
         # We managed to create a bridge.  Attach the new operations
@@ -240,7 +242,6 @@
         send_bridge_to_backend(metainterp.staticdata, self, inputargs,
                                new_loop.operations)
 
-
     def _clone_if_mutable(self):
         res = self.__class__(self.metainterp_sd, self.original_greenkey)
         # XXX a bit ugly to have to list them all here
@@ -262,8 +263,8 @@
         if all_virtuals is None:
             all_virtuals = []
         metainterp._already_allocated_resume_virtuals = all_virtuals
-        self.counter = -2     # never compile
-        return metainterp.handle_guard_failure(self)
+        # never compile
+        return metainterp.handle_guard_failure(self, must_compile=False)
 
     @staticmethod
     def force_now(cpu, token):

Modified: pypy/branch/guard-value-counting-2/pypy/jit/metainterp/pyjitpl.py
==============================================================================
--- pypy/branch/guard-value-counting-2/pypy/jit/metainterp/pyjitpl.py	(original)
+++ pypy/branch/guard-value-counting-2/pypy/jit/metainterp/pyjitpl.py	Fri Feb 26 14:03:07 2010
@@ -1555,10 +1555,8 @@
         except GenerateMergePoint, gmp:
             return self.designate_target_loop(gmp)
 
-    def handle_guard_failure(self, key):
+    def handle_guard_failure(self, key, must_compile):
         assert isinstance(key, compile.ResumeGuardDescr)
-        warmrunnerstate = self.staticdata.state
-        must_compile = warmrunnerstate.must_compile_from_failure(key)
         if must_compile:
             debug_start('jit-tracing')
         else:



More information about the Pypy-commit mailing list