Commits

Armin Rigo  committed 3fe637a

Move the call to must_compile_from_failure() into the ResumeGuardDescr.
Avoids the hack of storing -2 in ResumeGuardForcedDescr.

  • Participants
  • Parent commits 90ec77c
  • Branches guard-value-counting-2

Comments (0)

Files changed (2)

File pypy/jit/metainterp/compile.py

 
     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
         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
         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):

File pypy/jit/metainterp/pyjitpl.py

         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: