[pypy-svn] r56415 - in pypy/branch/oo-jit/pypy: jit/rainbow/test jit/tl rpython/ootypesystem

antocuni at codespeak.net antocuni at codespeak.net
Thu Jul 10 15:27:10 CEST 2008


Author: antocuni
Date: Thu Jul 10 15:27:10 2008
New Revision: 56415

Modified:
   pypy/branch/oo-jit/pypy/jit/rainbow/test/test_0tlc.py
   pypy/branch/oo-jit/pypy/jit/tl/tlc.py
   pypy/branch/oo-jit/pypy/rpython/ootypesystem/rclass.py
Log:
cool, tlc starts working properly on ootype :-)



Modified: pypy/branch/oo-jit/pypy/jit/rainbow/test/test_0tlc.py
==============================================================================
--- pypy/branch/oo-jit/pypy/jit/rainbow/test/test_0tlc.py	(original)
+++ pypy/branch/oo-jit/pypy/jit/rainbow/test/test_0tlc.py	Thu Jul 10 15:27:10 2008
@@ -2,6 +2,7 @@
 from pypy.rpython.module.support import LLSupport, OOSupport
 from pypy.jit.rainbow.test.test_portal import PortalTest
 from pypy.jit.rainbow.test.test_vlist import P_OOPSPEC
+from pypy.jit.rainbow.test.test_interpreter import OOTypeMixin
 from pypy.tool.sourcetools import func_with_new_name
 from pypy.jit.conftest import Benchmark
 
@@ -69,6 +70,9 @@
     type_system = "lltype"
     to_rstr = staticmethod(LLSupport.to_rstr)
 
-##class TestOOType(BaseTestTLC):
-##    type_system = "ootype"
-##    to_rstr = staticmethod(OOSupport.to_rstr)
+class TestOOType(OOTypeMixin, BaseTestTLC):
+    type_system = "ootype"
+    to_rstr = staticmethod(OOSupport.to_rstr)
+
+    def test_nth_item(self):
+        py.test.skip('in progress')

Modified: pypy/branch/oo-jit/pypy/jit/tl/tlc.py
==============================================================================
--- pypy/branch/oo-jit/pypy/jit/tl/tlc.py	(original)
+++ pypy/branch/oo-jit/pypy/jit/tl/tlc.py	Thu Jul 10 15:27:10 2008
@@ -180,62 +180,62 @@
 
             elif opcode == ADD:
                 a, b = stack.pop(), stack.pop()
-                hint(a.__class__, promote=True)
-                hint(b.__class__, promote=True)
+                hint(a, promote_class=True)
+                hint(b, promote_class=True)
                 stack.append(b.add(a))
 
             elif opcode == SUB:
                 a, b = stack.pop(), stack.pop()
-                hint(a.__class__, promote=True)
-                hint(b.__class__, promote=True)
+                hint(a, promote_class=True)
+                hint(b, promote_class=True)
                 stack.append(b.sub(a))
 
             elif opcode == MUL:
                 a, b = stack.pop(), stack.pop()
-                hint(a.__class__, promote=True)
-                hint(b.__class__, promote=True)
+                hint(a, promote_class=True)
+                hint(b, promote_class=True)
                 stack.append(b.mul(a))
 
             elif opcode == DIV:
                 a, b = stack.pop(), stack.pop()
-                hint(a.__class__, promote=True)
-                hint(b.__class__, promote=True)
+                hint(a, promote_class=True)
+                hint(b, promote_class=True)
                 stack.append(b.div(a))
 
             elif opcode == EQ:
                 a, b = stack.pop(), stack.pop()
-                hint(a.__class__, promote=True)
-                hint(b.__class__, promote=True)
+                hint(a, promote_class=True)
+                hint(b, promote_class=True)
                 stack.append(IntObj(b.eq(a)))
 
             elif opcode == NE:
                 a, b = stack.pop(), stack.pop()
-                hint(a.__class__, promote=True)
-                hint(b.__class__, promote=True)
+                hint(a, promote_class=True)
+                hint(b, promote_class=True)
                 stack.append(IntObj(not b.eq(a)))
 
             elif opcode == LT:
                 a, b = stack.pop(), stack.pop()
-                hint(a.__class__, promote=True)
-                hint(b.__class__, promote=True)
+                hint(a, promote_class=True)
+                hint(b, promote_class=True)
                 stack.append(IntObj(b.lt(a)))
 
             elif opcode == LE:
                 a, b = stack.pop(), stack.pop()
-                hint(a.__class__, promote=True)
-                hint(b.__class__, promote=True)
+                hint(a, promote_class=True)
+                hint(b, promote_class=True)
                 stack.append(IntObj(not a.lt(b)))
 
             elif opcode == GT:
                 a, b = stack.pop(), stack.pop()
-                hint(a.__class__, promote=True)
-                hint(b.__class__, promote=True)
+                hint(a, promote_class=True)
+                hint(b, promote_class=True)
                 stack.append(IntObj(a.lt(b)))
 
             elif opcode == GE:
                 a, b = stack.pop(), stack.pop()
-                hint(a.__class__, promote=True)
-                hint(b.__class__, promote=True)
+                hint(a, promote_class=True)
+                hint(b, promote_class=True)
                 stack.append(IntObj(not b.lt(a)))
 
             elif opcode == BR_COND:

Modified: pypy/branch/oo-jit/pypy/rpython/ootypesystem/rclass.py
==============================================================================
--- pypy/branch/oo-jit/pypy/rpython/ootypesystem/rclass.py	(original)
+++ pypy/branch/oo-jit/pypy/rpython/ootypesystem/rclass.py	Thu Jul 10 15:27:10 2008
@@ -549,4 +549,5 @@
         # type(None) -> NULL  (for now)
         return ootype.null(CLASSTYPE)
 
-ll_type = ll_inst_type
+def ll_type(obj):
+    return obj.meta



More information about the Pypy-commit mailing list