[pypy-svn] r69715 - in pypy/branch/virtual-forcing/pypy/rpython: lltypesystem ootypesystem test

arigo at codespeak.net arigo at codespeak.net
Fri Nov 27 23:15:16 CET 2009


Author: arigo
Date: Fri Nov 27 23:15:16 2009
New Revision: 69715

Modified:
   pypy/branch/virtual-forcing/pypy/rpython/lltypesystem/rvirtualizable2.py
   pypy/branch/virtual-forcing/pypy/rpython/ootypesystem/rvirtualizable2.py
   pypy/branch/virtual-forcing/pypy/rpython/test/test_rvirtualizable2.py
Log:
Oups.


Modified: pypy/branch/virtual-forcing/pypy/rpython/lltypesystem/rvirtualizable2.py
==============================================================================
--- pypy/branch/virtual-forcing/pypy/rpython/lltypesystem/rvirtualizable2.py	(original)
+++ pypy/branch/virtual-forcing/pypy/rpython/lltypesystem/rvirtualizable2.py	Fri Nov 27 23:15:16 2009
@@ -3,23 +3,21 @@
 from pypy.rpython.lltypesystem.rclass import InstanceRepr, OBJECTPTR
 from pypy.rpython.rvirtualizable2 import AbstractVirtualizable2InstanceRepr
 
-VABLERTIPTR = OBJECTPTR
 
 class Virtualizable2InstanceRepr(AbstractVirtualizable2InstanceRepr, InstanceRepr):
 
     def _setup_repr_llfields(self):
         llfields = []
         if self.top_of_virtualizable_hierarchy:
-            llfields.append(('vable_base', llmemory.Address))
-            llfields.append(('vable_rti', VABLERTIPTR))
+            llfields.append(('vable_token', lltype.Signed))
         return llfields
 
     def set_vable(self, llops, vinst, force_cast=False):
         if self.top_of_virtualizable_hierarchy:
             if force_cast:
                 vinst = llops.genop('cast_pointer', [vinst], resulttype=self)
-            cname = inputconst(lltype.Void, 'vable_rti')
-            vvalue = inputconst(VABLERTIPTR, lltype.nullptr(VABLERTIPTR.TO))
-            llops.genop('setfield', [vinst, cname, vvalue])
+            cname = inputconst(lltype.Void, 'vable_token')
+            cvalue = inputconst(lltype.Signed, 0)
+            llops.genop('setfield', [vinst, cname, cvalue])
         else:
             self.rbase.set_vable(llops, vinst, force_cast=True)

Modified: pypy/branch/virtual-forcing/pypy/rpython/ootypesystem/rvirtualizable2.py
==============================================================================
--- pypy/branch/virtual-forcing/pypy/rpython/ootypesystem/rvirtualizable2.py	(original)
+++ pypy/branch/virtual-forcing/pypy/rpython/ootypesystem/rvirtualizable2.py	Fri Nov 27 23:15:16 2009
@@ -11,7 +11,7 @@
     def _setup_repr_llfields(self):
         llfields = []
         if self.top_of_virtualizable_hierarchy:
-            llfields.append(('vable_rti', VABLERTI))
+            llfields.append(('vable_token', VABLERTI))
         return llfields
 
     def set_vable(self, llops, vinst, force_cast=False):

Modified: pypy/branch/virtual-forcing/pypy/rpython/test/test_rvirtualizable2.py
==============================================================================
--- pypy/branch/virtual-forcing/pypy/rpython/test/test_rvirtualizable2.py	(original)
+++ pypy/branch/virtual-forcing/pypy/rpython/test/test_rvirtualizable2.py	Fri Nov 27 23:15:16 2009
@@ -361,7 +361,7 @@
         assert res.item1 == 42
         res = lltype.normalizeptr(res.item0)
         assert res.inst_v == 42
-        assert not res.vable_rti
+        assert res.vable_token == 0
 
 class TestOOtype(OORtypeMixin, BaseTest):
     prefix = 'o'



More information about the Pypy-commit mailing list