Author: Alex Gaynor <alex.gay...@gmail.com> Branch: inline-dict-ops Changeset: r48284:12999013a845 Date: 2011-10-20 18:09 -0400 http://bitbucket.org/pypy/pypy/changeset/12999013a845/
Log: add descr to interior field descr, fix pypyjit test diff --git a/pypy/jit/backend/llsupport/descr.py b/pypy/jit/backend/llsupport/descr.py --- a/pypy/jit/backend/llsupport/descr.py +++ b/pypy/jit/backend/llsupport/descr.py @@ -153,6 +153,9 @@ def is_float_field(self): return self.fielddescr.is_float_field() + def repr_of_descr(self): + return '<InteriorFieldDescr %s>' % self.fielddescr.repr_of_descr() + # ____________________________________________________________ # ArrayDescrs diff --git a/pypy/jit/backend/x86/test/test_runner.py b/pypy/jit/backend/x86/test/test_runner.py --- a/pypy/jit/backend/x86/test/test_runner.py +++ b/pypy/jit/backend/x86/test/test_runner.py @@ -31,7 +31,7 @@ # for the individual tests see # ====> ../../test/runner_test.py - + def setup_method(self, meth): self.cpu = CPU(rtyper=None, stats=FakeStats()) self.cpu.setup_once() @@ -69,7 +69,7 @@ def test_allocations(self): from pypy.rpython.lltypesystem import rstr - + allocs = [None] all = [] def f(size): @@ -82,7 +82,7 @@ # ctypes produces an unsigned value. We need it to be signed for, eg, # relative addressing to work properly. addr = rffi.cast(lltype.Signed, addr) - + self.cpu.assembler.setup_once() self.cpu.assembler.malloc_func_addr = addr ofs = symbolic.get_field_token(rstr.STR, 'chars', False)[0] @@ -108,7 +108,7 @@ res = self.execute_operation(rop.NEW_ARRAY, [ConstInt(10)], 'ref', descr) assert allocs[0] == 10*WORD + ofs + WORD - resbuf = self._resbuf(res) + resbuf = self._resbuf(res) assert resbuf[ofs/WORD] == 10 # ------------------------------------------------------------ @@ -116,7 +116,7 @@ res = self.execute_operation(rop.NEW_ARRAY, [BoxInt(10)], 'ref', descr) assert allocs[0] == 10*WORD + ofs + WORD - resbuf = self._resbuf(res) + resbuf = self._resbuf(res) assert resbuf[ofs/WORD] == 10 def test_stringitems(self): @@ -146,7 +146,7 @@ ConstInt(2), BoxInt(38)], 'void', descr) assert resbuf[itemsofs/WORD + 2] == 38 - + self.execute_operation(rop.SETARRAYITEM_GC, [res, BoxInt(3), BoxInt(42)], 'void', descr) @@ -167,7 +167,7 @@ BoxInt(2)], 'int', descr) assert r.value == 38 - + r = self.execute_operation(rop.GETARRAYITEM_GC, [res, BoxInt(3)], 'int', descr) assert r.value == 42 @@ -226,7 +226,7 @@ self.execute_operation(rop.SETFIELD_GC, [res, BoxInt(1234)], 'void', ofs_i) i = self.execute_operation(rop.GETFIELD_GC, [res], 'int', ofs_i) assert i.value == 1234 - + #u = self.execute_operation(rop.GETFIELD_GC, [res, ofs_u], 'int') #assert u.value == 5 self.execute_operation(rop.SETFIELD_GC, [res, ConstInt(1)], 'void', @@ -299,7 +299,7 @@ else: assert result != execute(self.cpu, None, op, None, b).value - + def test_stuff_followed_by_guard(self): boxes = [(BoxInt(1), BoxInt(0)), @@ -523,7 +523,7 @@ def test_debugger_on(self): from pypy.tool.logparser import parse_log_file, extract_category from pypy.rlib import debug - + loop = """ [i0] debug_merge_point('xyz', 0) diff --git a/pypy/module/pypyjit/test_pypy_c/test_containers.py b/pypy/module/pypyjit/test_pypy_c/test_containers.py --- a/pypy/module/pypyjit/test_pypy_c/test_containers.py +++ b/pypy/module/pypyjit/test_pypy_c/test_containers.py @@ -46,7 +46,7 @@ assert loop.match_by_id("getitem", """ i28 = call(ConstClass(ll_dict_lookup__dicttablePtr_objectPtr_Signed), p18, p6, i25, descr=...) ... - p33 = call(ConstClass(ll_get_value__dicttablePtr_Signed), p18, i28, descr=...) + p33 = getinteriorfield_gc(p18, i28, <InteriorFieldDescr <>>) ... """) _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit