[pypy-svn] r54362 - pypy/branch/oo-jit/pypy/jit/rainbow

antocuni at codespeak.net antocuni at codespeak.net
Sat May 3 15:36:12 CEST 2008


Author: antocuni
Date: Sat May  3 15:36:10 2008
New Revision: 54362

Modified:
   pypy/branch/oo-jit/pypy/jit/rainbow/codewriter.py
Log:
remove the (hopefully) last direct references to lltype from
codewriter



Modified: pypy/branch/oo-jit/pypy/jit/rainbow/codewriter.py
==============================================================================
--- pypy/branch/oo-jit/pypy/jit/rainbow/codewriter.py	(original)
+++ pypy/branch/oo-jit/pypy/jit/rainbow/codewriter.py	Sat May  3 15:36:10 2008
@@ -368,17 +368,17 @@
     def make_own_call_information(self, graph):
         ARGS = [v.concretetype for v in graph.getargs()]
         RESULT = graph.getreturnvar().concretetype
-        FUNCTYPE = lltype.FuncType(ARGS, RESULT)
+        FUNCTYPE = self.FuncType(ARGS, RESULT)
 
         colororder = make_colororder(graph, self.hannotator)
         owncalldesc = CallDesc(self.RGenOp, self.exceptiondesc,
-                               lltype.Ptr(FUNCTYPE), colororder)
+                               self.Ptr(FUNCTYPE), colororder)
         # detect the special ts_stub or ts_metacall graphs and replace
         # a real function pointer to them with a function pointer to
         # the graph they are stubs for
         if hasattr(graph, 'ts_stub_for'):
             graph = graph.ts_stub_for
-        ownfnptr = lltype.functionptr(FUNCTYPE, graph.name, graph=graph)
+        ownfnptr = self.functionptr(FUNCTYPE, graph.name, graph=graph)
         gv_ownfnptr = self.RGenOp.constPrebuiltGlobal(ownfnptr)
         return owncalldesc, gv_ownfnptr
 
@@ -1635,6 +1635,9 @@
 
     ExceptionDesc = exception.LLTypeExceptionDesc
     StructTypeDesc = rcontainer.StructTypeDesc
+    FuncType = staticmethod(lltype.FuncType)
+    Ptr = staticmethod(lltype.Ptr)
+    functionptr = staticmethod(lltype.functionptr)
 
     def cast_fnptr_to_root(self, fnptr):
         return llmemory.cast_ptr_to_adr(fnptr)
@@ -1672,7 +1675,10 @@
 
     ExceptionDesc = exception.OOTypeExceptionDesc
     StructTypeDesc = rcontainer.InstanceTypeDesc
-
+    FuncType = staticmethod(ootype.StaticMethod)
+    Ptr = staticmethod(lambda x: x)
+    functionptr = staticmethod(ootype.static_meth)        
+    
     def decompose_oosend(self, op):
         name = op.args[0].value
         opargs = op.args[1:]



More information about the Pypy-commit mailing list