[pypy-svn] r78806 - pypy/branch/ootype-virtualrefs/pypy/rlib

dan at codespeak.net dan at codespeak.net
Sun Nov 7 11:34:31 CET 2010


Author: dan
Date: Sun Nov  7 11:34:29 2010
New Revision: 78806

Modified:
   pypy/branch/ootype-virtualrefs/pypy/rlib/_jit_vref.py
Log:
Passing another test by implementing OOVRefRepr.convert_const(), hopefully correctly.

Modified: pypy/branch/ootype-virtualrefs/pypy/rlib/_jit_vref.py
==============================================================================
--- pypy/branch/ootype-virtualrefs/pypy/rlib/_jit_vref.py	(original)
+++ pypy/branch/ootype-virtualrefs/pypy/rlib/_jit_vref.py	Sun Nov  7 11:34:29 2010
@@ -8,6 +8,8 @@
 from pypy.rpython.lltypesystem import lltype
 from pypy.rpython.error import TyperError
 
+from pypy.rpython.ootypesystem import ootype
+
 
 class SomeVRef(annmodel.SomeObject):
 
@@ -61,6 +63,16 @@
 
 class OOVRefRepr(VRefRepr):
     lowleveltype = OBJECT
+    def rtype_simple_call(self, hop):
+        [v] = hop.inputargs(self)
+        #v = hop.genop('jit_force_virtual', [v], resulttype = OBJECT)
+        return hop.genop('ooupcast', [v], resulttype = hop.r_result)
+    
+    def convert_const(self, value):
+        if value() is not None:
+            raise TypeError("only supports virtual_ref_None as a"
+                            " prebuilt virtual_ref")
+        return ootype.ROOT._null
 
 vrefrepr = VRefRepr()
 oovrefrepr = OOVRefRepr()



More information about the Pypy-commit mailing list