[pypy-svn] r53329 - in pypy/branch/jit-hotpath/pypy: jit/rainbow jit/rainbow/test jit/timeshifter rpython/ootypesystem

antocuni at codespeak.net antocuni at codespeak.net
Fri Apr 4 14:52:47 CEST 2008


Author: antocuni
Date: Fri Apr  4 14:52:46 2008
New Revision: 53329

Modified:
   pypy/branch/jit-hotpath/pypy/jit/rainbow/test/test_interpreter.py
   pypy/branch/jit-hotpath/pypy/jit/rainbow/typesystem.py
   pypy/branch/jit-hotpath/pypy/jit/timeshifter/rcontainer.py
   pypy/branch/jit-hotpath/pypy/rpython/ootypesystem/ootype.py
Log:
more passing tests



Modified: pypy/branch/jit-hotpath/pypy/jit/rainbow/test/test_interpreter.py
==============================================================================
--- pypy/branch/jit-hotpath/pypy/jit/rainbow/test/test_interpreter.py	(original)
+++ pypy/branch/jit-hotpath/pypy/jit/rainbow/test/test_interpreter.py	Fri Apr  4 14:52:46 2008
@@ -991,22 +991,6 @@
         assert res == True
         self.check_insns({'setfield': 2, 'getfield': 1})
 
-    def test_deepfrozen_interior(self):
-        T = lltype.Struct('T', ('x', lltype.Signed))
-        A = lltype.Array(T)
-        S = lltype.GcStruct('S', ('a', A))
-        s = lltype.malloc(S, 3, zero=True)
-        s.a[2].x = 42
-        def f(n):
-            s1 = hint(s, variable=True)
-            s1 = hint(s1, deepfreeze=True)
-            return s1.a[n].x
-
-        # malloc-remove the interior ptr
-        res = self.interpret(f, [2], [0], backendoptimize=True)
-        assert res == 42
-        self.check_insns({})
-
     def test_compile_time_const_tuple(self):
         d = {(4, 5): 42, (6, 7): 12}
         def f(a, b):
@@ -2063,6 +2047,22 @@
         assert res == 42
         self.check_insns({'int_lt': 1, 'int_mul': 1, 'int_sub': 1})
 
+    def test_deepfrozen_interior(self):
+        T = lltype.Struct('T', ('x', lltype.Signed))
+        A = lltype.Array(T)
+        S = lltype.GcStruct('S', ('a', A))
+        s = lltype.malloc(S, 3, zero=True)
+        s.a[2].x = 42
+        def f(n):
+            s1 = hint(s, variable=True)
+            s1 = hint(s1, deepfreeze=True)
+            return s1.a[n].x
+
+        # malloc-remove the interior ptr
+        res = self.interpret(f, [2], [0], backendoptimize=True)
+        assert res == 42
+        self.check_insns({})
+
 
 class TestOOType(SimpleTests):
     type_system = "ootype"
@@ -2201,10 +2201,7 @@
     test_red_struct_array = _skip
     test_red_varsized_struct = _skip
     test_array_of_voids = _skip
-    test_deepfrozen_interior = _skip
-    test_compile_time_const_tuple = _skip
-    test_residual_red_call = _skip
-    test_residual_red_call_with_exc = _skip
+    test_compile_time_const_tuple = _skip    # needs vdict
     test_simple_meth = _skip
     test_simple_red_meth = _skip
     test_simple_red_meth_vars_around = _skip

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 Apr  4 14:52:46 2008
@@ -4,7 +4,7 @@
 def deref(T):
     if isinstance(T, lltype.Ptr):
         return T.TO
-    assert isinstance(T, (ootype.Instance, ootype.BuiltinType))
+    assert isinstance(T, ootype.OOType)
     return T
 
 def fieldType(T, name):

Modified: pypy/branch/jit-hotpath/pypy/jit/timeshifter/rcontainer.py
==============================================================================
--- pypy/branch/jit-hotpath/pypy/jit/timeshifter/rcontainer.py	(original)
+++ pypy/branch/jit-hotpath/pypy/jit/timeshifter/rcontainer.py	Fri Apr  4 14:52:46 2008
@@ -637,12 +637,10 @@
                     self.canbevirtual = True
             else:
                 T = None
-        elif isinstance(RESTYPE, ootype.Instance):
+        elif isinstance(RESTYPE, ootype.OOType):
             self._set_hints(PTRTYPE, RESTYPE)
             self.gcref = True        # XXX: is it right?
             self.canbevirtual = True # XXX: is it right?
-        elif isinstance(RESTYPE, ootype.OOType):
-            assert False, 'XXX: TODO'
         self.RESTYPE = RESTYPE
         self.ptrkind = RGenOp.kindToken(PTRTYPE)
         self.kind = RGenOp.kindToken(RESTYPE)

Modified: pypy/branch/jit-hotpath/pypy/rpython/ootypesystem/ootype.py
==============================================================================
--- pypy/branch/jit-hotpath/pypy/rpython/ootypesystem/ootype.py	(original)
+++ pypy/branch/jit-hotpath/pypy/rpython/ootypesystem/ootype.py	Fri Apr  4 14:52:46 2008
@@ -59,6 +59,9 @@
 
     def _defl(self):
         return nullruntimeclass
+
+    def _example(self):
+        return _class(ROOT)
     
 Class = Class()
 



More information about the Pypy-commit mailing list