Author: Hakan Ardo <ha...@debian.org> Branch: jit-short_from_state Changeset: r44704:c0bee26ace32 Date: 2011-06-02 12:01 +0200 http://bitbucket.org/pypy/pypy/changeset/c0bee26ace32/
Log: hg merge default diff --git a/pypy/jit/backend/llsupport/regalloc.py b/pypy/jit/backend/llsupport/regalloc.py --- a/pypy/jit/backend/llsupport/regalloc.py +++ b/pypy/jit/backend/llsupport/regalloc.py @@ -220,10 +220,7 @@ del self.reg_bindings[var] self.free_regs.append(loc) except KeyError: - if not we_are_translated(): - import pdb; pdb.set_trace() - else: - raise ValueError + pass # 'var' is already not in a register def loc(self, box): """ Return the location of 'box'. diff --git a/pypy/jit/backend/test/calling_convention_test.py b/pypy/jit/backend/test/calling_convention_test.py --- a/pypy/jit/backend/test/calling_convention_test.py +++ b/pypy/jit/backend/test/calling_convention_test.py @@ -31,9 +31,9 @@ Ptr = lltype.Ptr FuncType = lltype.FuncType - def __init__(self): - self.cpu = getcpuclass()(rtyper=None, stats=FakeStats()) - self.cpu.setup_once() + def setup_class(cls): + cls.cpu = getcpuclass()(rtyper=None, stats=FakeStats()) + cls.cpu.setup_once() def _prepare_args(self, args, floats, ints): local_floats = list(floats) diff --git a/pypy/jit/metainterp/test/support.py b/pypy/jit/metainterp/test/support.py --- a/pypy/jit/metainterp/test/support.py +++ b/pypy/jit/metainterp/test/support.py @@ -51,6 +51,8 @@ greenfield_info = None result_type = result_kind portal_runner_ptr = "???" + on_compile = lambda *args: None + on_compile_bridge = lambda *args: None stats = history.Stats() cpu = CPUClass(rtyper, stats, None, False) diff --git a/pypy/jit/tl/tinyframe/test/test_tinyframe.py b/pypy/jit/tl/tinyframe/test/test_tinyframe.py --- a/pypy/jit/tl/tinyframe/test/test_tinyframe.py +++ b/pypy/jit/tl/tinyframe/test/test_tinyframe.py @@ -96,11 +96,12 @@ RETURN r1 ''') s = StringIO() + prev = sys.stdout sys.stdout = s try: interpret(code) finally: - sys.stdout = sys.__stdout__ + sys.stdout = prev lines = s.getvalue().splitlines() assert lines == [ '0', diff --git a/pypy/module/cpyext/test/test_sysmodule.py b/pypy/module/cpyext/test/test_sysmodule.py --- a/pypy/module/cpyext/test/test_sysmodule.py +++ b/pypy/module/cpyext/test/test_sysmodule.py @@ -22,12 +22,13 @@ Py_RETURN_NONE; """)]) import sys, StringIO + prev = sys.stdout sys.stdout = StringIO.StringIO() try: module.writestdout() assert sys.stdout.getvalue() == "format: 42\n" finally: - sys.stdout = sys.__stdout__ + sys.stdout = prev class TestSysModule(BaseApiTest): def test_sysmodule(self, space, api): 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 @@ -1,5 +1,6 @@ -from pypy.conftest import gettestobjspace +import py +from pypy.conftest import gettestobjspace, option from pypy.interpreter.pycode import PyCode from pypy.interpreter.gateway import interp2app from pypy.jit.metainterp.history import LoopToken @@ -17,6 +18,8 @@ class AppTestJitHook(object): def setup_class(cls): + if option.runappdirect: + py.test.skip("Can't run this test with -A") space = gettestobjspace(usemodules=('pypyjit',)) cls.space = space w_f = space.appexec([], """(): @@ -76,10 +79,11 @@ pypyjit.set_compile_hook(hook) s = cStringIO.StringIO() + prev = sys.stderr sys.stderr = s try: self.on_compile() finally: - sys.stderr = sys.__stderr__ + sys.stderr = prev assert 'jit hook' in s.getvalue() assert 'ZeroDivisionError' in s.getvalue() diff --git a/pypy/rlib/test/test_jit.py b/pypy/rlib/test/test_jit.py --- a/pypy/rlib/test/test_jit.py +++ b/pypy/rlib/test/test_jit.py @@ -52,9 +52,12 @@ import sys s = StringIO() + prev = sys.stdout sys.stdout = s - dis.dis(g) - sys.stdout = sys.__stdout__ + try: + dis.dis(g) + finally: + sys.stdout = prev x = s.getvalue().find('CALL_FUNCTION') assert x != -1 x = s.getvalue().find('CALL_FUNCTION', x) _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit