Commits

Armin Rigo  committed e208b4c

Apply stm_ignored to this version of cell counters

  • Participants
  • Parent commits 0fe3cbf
  • Branches stmgc-c4

Comments (0)

Files changed (1)

File rpython/jit/metainterp/warmstate.py

 from rpython.rlib.jit import PARAMETERS, BaseJitCell
 from rpython.rlib.nonconst import NonConstant
 from rpython.rlib.objectmodel import specialize, we_are_translated, r_dict
+from rpython.rlib.objectmodel import stm_ignored
 from rpython.rlib.rarithmetic import intmask
 from rpython.rlib.unroll import unrolling_iterable
 from rpython.rtyper.annlowlevel import (hlstr, cast_base_ptr_to_instance,
                 return
             # start tracing
             from rpython.jit.metainterp.pyjitpl import MetaInterp
+            cell.mode = MODE_TRACING
             metainterp = MetaInterp(metainterp_sd, jitdriver_sd)
-            cell.mode = MODE_TRACING
             try:
                 metainterp.compile_and_run_once(jitdriver_sd, *args)
             finally:
 
             if mode == MODE_COUNTING:
                 # update the profiling counter
-                n = cell.counter + threshold
+                # use stm_ignored because keeping the absolutely exact value
+                # is not important, but avoiding pointless conflicts is
+                with stm_ignored:
+                    n = cell.counter + threshold
                 if n <= self.THRESHOLD_LIMIT:       # bound not reached
-                    cell.counter = n
+                    with stm_ignored:
+                        cell.counter = n
                     return
                 else:
                     bound_reached(cell, *args)