[pypy-svn] r66590 - in pypy/branch/pyjitpl5-optimize4/pypy/jit/backend: llgraph/test test
arigo at codespeak.net
arigo at codespeak.net
Fri Jul 24 16:01:33 CEST 2009
Author: arigo
Date: Fri Jul 24 16:01:32 2009
New Revision: 66590
Modified:
pypy/branch/pyjitpl5-optimize4/pypy/jit/backend/llgraph/test/test_llgraph.py
pypy/branch/pyjitpl5-optimize4/pypy/jit/backend/test/runner_test.py
Log:
Fix for NEW_WITH_VTABLE not taking the descr any more.
Modified: pypy/branch/pyjitpl5-optimize4/pypy/jit/backend/llgraph/test/test_llgraph.py
==============================================================================
--- pypy/branch/pyjitpl5-optimize4/pypy/jit/backend/llgraph/test/test_llgraph.py (original)
+++ pypy/branch/pyjitpl5-optimize4/pypy/jit/backend/llgraph/test/test_llgraph.py Fri Jul 24 16:01:32 2009
@@ -189,9 +189,9 @@
#
descrsize2 = cpu.sizeof(rclass.OBJECT)
vtable2 = lltype.malloc(rclass.OBJECT_VTABLE, immortal=True)
- x = cpu.do_new_with_vtable(
- [BoxInt(cpu.cast_adr_to_int(llmemory.cast_ptr_to_adr(vtable2)))],
- descrsize2)
+ vtable2_int = cpu.cast_adr_to_int(llmemory.cast_ptr_to_adr(vtable2))
+ cpu.set_class_sizes({vtable2_int: descrsize2})
+ x = cpu.do_new_with_vtable([ConstInt(vtable2_int)])
assert isinstance(x, BoxPtr)
assert x.getptr(rclass.OBJECTPTR).typeptr == vtable2
#
Modified: pypy/branch/pyjitpl5-optimize4/pypy/jit/backend/test/runner_test.py
==============================================================================
--- pypy/branch/pyjitpl5-optimize4/pypy/jit/backend/test/runner_test.py (original)
+++ pypy/branch/pyjitpl5-optimize4/pypy/jit/backend/test/runner_test.py Fri Jul 24 16:01:32 2009
@@ -618,11 +618,9 @@
def test_new_with_vtable(self):
cpu = self.cpu
t_box, T_box = self.alloc_instance(self.T)
- sizedescr = cpu.sizeof(self.T)
- r1 = self.execute_operation(rop.NEW_WITH_VTABLE, [T_box], 'ptr',
- descr=sizedescr)
- r2 = self.execute_operation(rop.NEW_WITH_VTABLE, [T_box], 'ptr',
- descr=sizedescr)
+ cpu.set_class_sizes({T_box.value: cpu.sizeof(self.T)})
+ r1 = self.execute_operation(rop.NEW_WITH_VTABLE, [T_box], 'ptr')
+ r2 = self.execute_operation(rop.NEW_WITH_VTABLE, [T_box], 'ptr')
assert r1.value != r2.value
descr1 = cpu.fielddescrof(self.S, 'chr1')
descr2 = cpu.fielddescrof(self.S, 'chr2')
@@ -763,9 +761,9 @@
#
descrsize2 = cpu.sizeof(rclass.OBJECT)
vtable2 = lltype.malloc(rclass.OBJECT_VTABLE, immortal=True)
- x = cpu.do_new_with_vtable(
- [BoxInt(cpu.cast_adr_to_int(llmemory.cast_ptr_to_adr(vtable2)))],
- descrsize2)
+ vtable2_int = cpu.cast_adr_to_int(llmemory.cast_ptr_to_adr(vtable2))
+ cpu.set_class_sizes({vtable2_int: descrsize2})
+ x = cpu.do_new_with_vtable([ConstInt(vtable2_int)])
assert isinstance(x, BoxPtr)
# well...
#assert x.getptr(rclass.OBJECTPTR).typeptr == vtable2
More information about the Pypy-commit
mailing list