[pypy-svn] r66993 - in pypy/branch/pyjitpl5/pypy/jit/metainterp: . test
benjamin at codespeak.net
benjamin at codespeak.net
Wed Aug 19 18:32:12 CEST 2009
Author: benjamin
Date: Wed Aug 19 18:32:11 2009
New Revision: 66993
Modified:
pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_virtualizable.py
pypy/branch/pyjitpl5/pypy/jit/metainterp/virtualizable.py
Log:
(arigo, benjamin) account for changes in the FieldListAccessor API
Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_virtualizable.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_virtualizable.py (original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_virtualizable.py Wed Aug 19 18:32:11 2009
@@ -27,7 +27,7 @@
('inst_node', lltype.Ptr(LLtypeMixin.NODE)),
hints = {'virtualizable2_accessor': FieldListAccessor()})
XY._hints['virtualizable2_accessor'].initialize(
- XY, ['inst_x', 'inst_node'])
+ XY, {'inst_x' : "", 'inst_node' : ""})
xy_vtable = lltype.malloc(rclass.OBJECT_VTABLE, immortal=True)
heaptracker.set_testing_vtable_for_gcstruct(XY, xy_vtable, 'XY')
@@ -249,7 +249,7 @@
('inst_l2', lltype.Ptr(lltype.GcArray(lltype.Signed))),
hints = {'virtualizable2_accessor': FieldListAccessor()})
XY2._hints['virtualizable2_accessor'].initialize(
- XY2, ['inst_x', 'inst_l1[*]', 'inst_l2[*]'])
+ XY2, {'inst_x' : "", 'inst_l1' : "[*]", 'inst_l2' : "[*]"})
xy2_vtable = lltype.malloc(rclass.OBJECT_VTABLE, immortal=True)
heaptracker.set_testing_vtable_for_gcstruct(XY2, xy2_vtable, 'XY2')
Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/virtualizable.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/virtualizable.py (original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/virtualizable.py Wed Aug 19 18:32:11 2009
@@ -45,9 +45,9 @@
all_fields = accessor.fields
static_fields = []
array_fields = []
- for name in all_fields:
- if name.endswith('[*]'):
- array_fields.append(name[:-3])
+ for name, suffix in all_fields.iteritems():
+ if suffix == '[*]':
+ array_fields.append(name)
else:
static_fields.append(name)
self.static_fields = static_fields
More information about the Pypy-commit
mailing list