[pypy-commit] pypy default: Fix reset_stats() to clear a bit more things. It's still not

arigo noreply at buildbot.pypy.org
Mon Dec 12 19:17:49 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r50439:2edda8cbb1b0
Date: 2011-12-12 19:17 +0100
http://bitbucket.org/pypy/pypy/changeset/2edda8cbb1b0/

Log:	Fix reset_stats() to clear a bit more things. It's still not
	perfect, but better...

diff --git a/pypy/jit/metainterp/history.py b/pypy/jit/metainterp/history.py
--- a/pypy/jit/metainterp/history.py
+++ b/pypy/jit/metainterp/history.py
@@ -981,15 +981,19 @@
         self.aborted_keys = []
         self.invalidated_token_numbers = set()    # <- not RPython
         self.jitcell_token_wrefs = []
+        self.jitcell_dicts = []                   # <- not RPython
 
     def clear(self):
         del self.loops[:]
         del self.locations[:]
         del self.aborted_keys[:]
+        del self.jitcell_token_wrefs[:]
         self.invalidated_token_numbers.clear()
         self.compiled_count = 0
         self.enter_count = 0
         self.aborted_count = 0
+        for dict in self.jitcell_dicts:
+            dict.clear()
 
     def add_jitcell_token(self, token):
         assert isinstance(token, JitCellToken)
diff --git a/pypy/jit/metainterp/warmstate.py b/pypy/jit/metainterp/warmstate.py
--- a/pypy/jit/metainterp/warmstate.py
+++ b/pypy/jit/metainterp/warmstate.py
@@ -439,6 +439,10 @@
             return x
         #
         jitcell_dict = r_dict(comparekey, hashkey)
+        try:
+            self.warmrunnerdesc.stats.jitcell_dicts.append(jitcell_dict)
+        except AttributeError:
+            pass
         #
         def get_jitcell(build, *greenargs):
             try:


More information about the pypy-commit mailing list