[pypy-svn] r53068 - in pypy/branch/jit-hotpath/pypy/jit: codegen/llgraph hintannotator rainbow timeshifter

antocuni at codespeak.net antocuni at codespeak.net
Fri Mar 28 21:09:20 CET 2008


Author: antocuni
Date: Fri Mar 28 21:09:18 2008
New Revision: 53068

Modified:
   pypy/branch/jit-hotpath/pypy/jit/codegen/llgraph/llimpl.py
   pypy/branch/jit-hotpath/pypy/jit/hintannotator/model.py
   pypy/branch/jit-hotpath/pypy/jit/rainbow/typesystem.py
   pypy/branch/jit-hotpath/pypy/jit/timeshifter/rvalue.py
Log:
erase all non primitive types to ootype.Object instead of ootype.ROOT.
Surprinsingly enough, all tests passes out of the box :-)



Modified: pypy/branch/jit-hotpath/pypy/jit/codegen/llgraph/llimpl.py
==============================================================================
--- pypy/branch/jit-hotpath/pypy/jit/codegen/llgraph/llimpl.py	(original)
+++ pypy/branch/jit-hotpath/pypy/jit/codegen/llgraph/llimpl.py	Fri Mar 28 21:09:18 2008
@@ -235,11 +235,10 @@
         return lltype.cast_pointer(T, value)
     elif T == llmemory.Address:
         return llmemory.cast_ptr_to_adr(value)
-    elif isinstance(T, ootype.StaticMethod):
-        fn = value._obj
-        return ootype._static_meth(T, graph=fn.graph, _callable=fn._callable)
-    elif isinstance(T, ootype.Instance):
-        return ootype.ooupcast(T, value) # XXX: oodowncast?
+    elif T is ootype.Object:
+        return ootype.cast_to_object(value)
+    elif isinstance(T, ootype.OOType) and ootype.typeOf(value) is ootype.Object:
+        return ootype.cast_from_object(T, value)
     else:
         T1 = lltype.typeOf(value)
         if T1 is llmemory.Address:

Modified: pypy/branch/jit-hotpath/pypy/jit/hintannotator/model.py
==============================================================================
--- pypy/branch/jit-hotpath/pypy/jit/hintannotator/model.py	(original)
+++ pypy/branch/jit-hotpath/pypy/jit/hintannotator/model.py	Fri Mar 28 21:09:18 2008
@@ -29,6 +29,8 @@
                       ooisnull
                       ooupcast
                       oodowncast
+                      cast_to_object
+                      cast_from_object
                       oois
                       subclassof
                       instanceof

Modified: pypy/branch/jit-hotpath/pypy/jit/rainbow/typesystem.py
==============================================================================
--- pypy/branch/jit-hotpath/pypy/jit/rainbow/typesystem.py	(original)
+++ pypy/branch/jit-hotpath/pypy/jit/rainbow/typesystem.py	Fri Mar 28 21:09:18 2008
@@ -41,7 +41,7 @@
 class OOTypeHelper(TypeSystemHelper):
 
     name = 'ootype'
-    ROOT_TYPE = ootype.ROOT
+    ROOT_TYPE = ootype.Object
 
     def get_typeptr(self, obj):
         return obj.meta

Modified: pypy/branch/jit-hotpath/pypy/jit/timeshifter/rvalue.py
==============================================================================
--- pypy/branch/jit-hotpath/pypy/jit/timeshifter/rvalue.py	(original)
+++ pypy/branch/jit-hotpath/pypy/jit/timeshifter/rvalue.py	Fri Mar 28 21:09:18 2008
@@ -43,7 +43,7 @@
     _mixin_ = True
 
     def _revealconst(self, gv):
-        return gv.revealconst(ootype.ROOT) # ???
+        return gv.revealconst(ootype.Object)
 
 
 class RedBox(object):
@@ -110,10 +110,7 @@
         return redboxbuilder_ptr
     elif TYPE is lltype.Float:
         return redboxbuilder_dbl
-    elif (isinstance(TYPE, ootype.Instance) or
-          isinstance(TYPE, ootype.Record) or 
-          isinstance(TYPE, ootype.StaticMethod)):
-        # XXX: probably it won't translate, because we can't mix these types
+    elif isinstance(TYPE, ootype.OOType):
         return redboxbuilder_inst
     else:
         assert isinstance(TYPE, lltype.Primitive)



More information about the Pypy-commit mailing list