[pypy-commit] pypy even-more-jit-hooks: more obscure but less magic
fijal
noreply at buildbot.pypy.org
Sun Jul 8 18:13:34 CEST 2012
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: even-more-jit-hooks
Changeset: r55998:e7975b19cd89
Date: 2012-07-08 18:13 +0200
http://bitbucket.org/pypy/pypy/changeset/e7975b19cd89/
Log: more obscure but less magic
diff --git a/pypy/jit/metainterp/test/test_jitiface.py b/pypy/jit/metainterp/test/test_jitiface.py
--- a/pypy/jit/metainterp/test/test_jitiface.py
+++ b/pypy/jit/metainterp/test/test_jitiface.py
@@ -164,10 +164,13 @@
def main():
loop(30)
- assert jit_hooks.stats_get_counter_value(Counters.TOTAL_COMPILED_LOOPS) == 1
- assert jit_hooks.stats_get_counter_value(Counters.TOTAL_COMPILED_BRIDGES) == 1
- assert jit_hooks.stats_get_counter_value(Counters.TRACING) == 2
- assert jit_hooks.stats_get_times_value(Counters.TRACING) >= 0
+ assert jit_hooks.stats_get_counter_value(None,
+ Counters.TOTAL_COMPILED_LOOPS) == 1
+ assert jit_hooks.stats_get_counter_value(None,
+ Counters.TOTAL_COMPILED_BRIDGES) == 1
+ assert jit_hooks.stats_get_counter_value(None,
+ Counters.TRACING) == 2
+ assert jit_hooks.stats_get_times_value(None, Counters.TRACING) >= 0
self.meta_interp(main, [], ProfilerClass=Profiler)
@@ -188,10 +191,9 @@
return s
def main(b):
- stats = jit_hooks.get_stats()
- jit_hooks.stats_set_debug(stats, b)
+ jit_hooks.stats_set_debug(None, b)
loop(30)
- l = jit_hooks.stats_get_loop_run_times(stats)
+ l = jit_hooks.stats_get_loop_run_times(None)
if b:
assert len(l) == 4
# completely specific test that would fail each time
diff --git a/pypy/jit/metainterp/warmspot.py b/pypy/jit/metainterp/warmspot.py
--- a/pypy/jit/metainterp/warmspot.py
+++ b/pypy/jit/metainterp/warmspot.py
@@ -642,9 +642,9 @@
if func.func_name.startswith('stats_'):
# get special treatment since we rewrite it to a call that accepts
# jit driver
- def new_func(*args):
+ def new_func(ignored, *args):
return func(self, *args)
- ARGS = [lltype.Void] + [arg.concretetype for arg in op.args[2:]]
+ ARGS = [lltype.Void] + [arg.concretetype for arg in op.args[3:]]
else:
ARGS = [arg.concretetype for arg in op.args[2:]]
new_func = func_with_new_name(func, func.func_name + '_compiled')
diff --git a/pypy/module/pypyjit/interp_resop.py b/pypy/module/pypyjit/interp_resop.py
--- a/pypy/module/pypyjit/interp_resop.py
+++ b/pypy/module/pypyjit/interp_resop.py
@@ -349,19 +349,19 @@
is eager - the attribute access is not lazy, if you need new stats
you need to call this function again.
"""
- ll_times = jit_hooks.stats_get_loop_run_times()
+ ll_times = jit_hooks.stats_get_loop_run_times(None)
w_times = space.newdict()
for i in range(len(ll_times)):
space.setitem(w_times, space.wrap(ll_times[i].number),
space.wrap(ll_times[i].counter))
w_counters = space.newdict()
for i, counter_name in enumerate(Counters.counter_names):
- v = jit_hooks.stats_get_counter_value(i)
+ v = jit_hooks.stats_get_counter_value(None, i)
space.setitem_str(w_counters, counter_name, space.wrap(v))
w_counter_times = space.newdict()
- tr_time = jit_hooks.stats_get_times_value(Counters.TRACING)
+ tr_time = jit_hooks.stats_get_times_value(None, Counters.TRACING)
space.setitem_str(w_counter_times, 'TRACING', space.wrap(tr_time))
- b_time = jit_hooks.stats_get_times_value(Counters.BACKEND)
+ b_time = jit_hooks.stats_get_times_value(None, Counters.BACKEND)
space.setitem_str(w_counter_times, 'BACKEND', space.wrap(b_time))
return space.wrap(W_JitInfoSnapshot(space, w_times, w_counters,
w_counter_times))
@@ -370,10 +370,10 @@
""" Set the jit debugging - completely necessary for some stats to work,
most notably assembler counters.
"""
- jit_hooks.stats_set_debug(True)
+ jit_hooks.stats_set_debug(None, True)
def disable_debug(space):
""" Disable the jit debugging. This means some very small loops will be
marginally faster and the counters will stop working.
"""
- jit_hooks.stats_set_debug(False)
+ jit_hooks.stats_set_debug(None, False)
More information about the pypy-commit
mailing list