[pypy-svn] r28264 - in pypy/dist/pypy/rpython: ootypesystem test

antocuni at codespeak.net antocuni at codespeak.net
Sun Jun 4 16:43:43 CEST 2006


Author: antocuni
Date: Sun Jun  4 16:43:42 2006
New Revision: 28264

Modified:
   pypy/dist/pypy/rpython/ootypesystem/rootype.py
   pypy/dist/pypy/rpython/test/test_rpbc.py
Log:
(antocuni, nik)

Fixed a bug that prevented StaticMethods to be called inside low level
helpers when they are not constant.



Modified: pypy/dist/pypy/rpython/ootypesystem/rootype.py
==============================================================================
--- pypy/dist/pypy/rpython/ootypesystem/rootype.py	(original)
+++ pypy/dist/pypy/rpython/ootypesystem/rootype.py	Sun Jun  4 16:43:42 2006
@@ -22,6 +22,14 @@
     def rtyper_makekey(self):
         return self.__class__, self.ootype, self.name
 
+class __extend__(annmodel.SomeOOStaticMeth):
+    def rtyper_makerepr(self, rtyper):
+        return OOStaticMethRepr(self.method)
+    def rtyper_makekey(self):
+        return self.__class__, self.method
+
+
+
 class OOClassRepr(Repr):
     lowleveltype = Class
 ooclass_repr = OOClassRepr()
@@ -77,7 +85,12 @@
         hop.exception_is_here()
         return hop.genop("oosend", [cname]+vlist,
                          resulttype = hop.r_result.lowleveltype)
-        
+
+
+class OOStaticMethRepr(Repr):
+    def __init__(self, METHODTYPE):
+        self.lowleveltype = METHODTYPE
+
 
 class __extend__(pairtype(OOInstanceRepr, OOBoundMethRepr)):
 

Modified: pypy/dist/pypy/rpython/test/test_rpbc.py
==============================================================================
--- pypy/dist/pypy/rpython/test/test_rpbc.py	(original)
+++ pypy/dist/pypy/rpython/test/test_rpbc.py	Sun Jun  4 16:43:42 2006
@@ -490,7 +490,6 @@
         assert res == 42
 
     def test_simple_function_pointer(self): 
-        py.test.skip("a problem with ootypesystem")
         def f1(x):
             return x + 1
         def f2(x):



More information about the Pypy-commit mailing list