Author: Maciej Fijalkowski <fij...@gmail.com> Branch: even-more-jit-hooks Changeset: r55875:2f1f4f2dff5e Date: 2012-06-28 22:33 +0200 http://bitbucket.org/pypy/pypy/changeset/2f1f4f2dff5e/
Log: fix tests diff --git a/pypy/module/pypyjit/policy.py b/pypy/module/pypyjit/policy.py --- a/pypy/module/pypyjit/policy.py +++ b/pypy/module/pypyjit/policy.py @@ -1,8 +1,7 @@ from pypy.jit.codewriter.policy import JitPolicy -from pypy.rlib.jit import JitHookInterface +from pypy.rlib.jit import JitHookInterface, Counters from pypy.rlib import jit_hooks from pypy.interpreter.error import OperationError -from pypy.jit.metainterp.jitprof import counter_names from pypy.module.pypyjit.interp_resop import wrap_oplist, Cache, wrap_greenkey,\ WrappedOp @@ -20,7 +19,8 @@ space.wrap(jitdriver.name), wrap_greenkey(space, jitdriver, greenkey, greenkey_repr), - space.wrap(counter_names[reason])) + space.wrap( + Counters.counter_names[reason])) except OperationError, e: e.write_unraisable(space, "jit hook ", cache.w_abort_hook) finally: diff --git a/pypy/module/pypyjit/test/test_jit_hook.py b/pypy/module/pypyjit/test/test_jit_hook.py --- a/pypy/module/pypyjit/test/test_jit_hook.py +++ b/pypy/module/pypyjit/test/test_jit_hook.py @@ -14,8 +14,7 @@ from pypy.module.pypyjit.policy import pypy_hooks from pypy.jit.tool.oparser import parse from pypy.jit.metainterp.typesystem import llhelper -from pypy.jit.metainterp.jitprof import ABORT_TOO_LONG -from pypy.rlib.jit import JitDebugInfo, AsmInfo +from pypy.rlib.jit import JitDebugInfo, AsmInfo, Counters class MockJitDriverSD(object): class warmstate(object): @@ -85,8 +84,8 @@ pypy_hooks.before_compile(di_loop_optimize) def interp_on_abort(): - pypy_hooks.on_abort(ABORT_TOO_LONG, pypyjitdriver, greenkey, - 'blah') + pypy_hooks.on_abort(Counters.ABORT_TOO_LONG, pypyjitdriver, + greenkey, 'blah') cls.w_on_compile = space.wrap(interp2app(interp_on_compile)) cls.w_on_compile_bridge = space.wrap(interp2app(interp_on_compile_bridge)) @@ -103,8 +102,9 @@ import pypyjit all = [] - def hook(name, looptype, tuple_or_guard_no, ops, asmstart, asmlen): - all.append((name, looptype, tuple_or_guard_no, ops)) + def hook(name, looptype, tuple_or_guard_no, ops, loopno, asmstart, + asmlen): + all.append((name, looptype, tuple_or_guard_no, ops, loopno)) self.on_compile() pypyjit.set_compile_hook(hook) @@ -195,7 +195,7 @@ def hook(name, looptype, tuple_or_guard_no, ops, *args): l.append(ops) - def optimize_hook(name, looptype, tuple_or_guard_no, ops): + def optimize_hook(name, looptype, tuple_or_guard_no, ops, loopno): return [] pypyjit.set_compile_hook(hook) _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit