[pypy-svn] r64591 - in pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp: . test

antocuni at codespeak.net antocuni at codespeak.net
Thu Apr 23 14:20:20 CEST 2009


Author: antocuni
Date: Thu Apr 23 14:20:18 2009
New Revision: 64591

Modified:
   pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/codewriter.py
   pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/test/test_slist.py
Log:
smooth some lltype/ootype differences, and test_slist passes


Modified: pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/codewriter.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/codewriter.py	(original)
+++ pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/codewriter.py	Thu Apr 23 14:20:18 2009
@@ -929,14 +929,12 @@
         self.emit_varargs([c_func] + non_void_args)
         self.register_var(op.result)
 
-    def handle_list_call(self, op, oopspec_name, args, TP):
+    def handle_list_call(self, op, oopspec_name, args, LIST):
         if not (oopspec_name.startswith('list.') or oopspec_name == 'newlist'):
             return False
-        if hasattr(TP.TO, '_ll_resize'):
-            return False
-        # non-resizable lists: they are just arrays
-        ARRAY = TP.TO
-        assert isinstance(ARRAY, lltype.GcArray)
+        if not isinstance(deref(LIST), lltype.GcArray):
+            return False # resizable lists
+        ARRAY = deref(LIST)
         arraydescr = self.cpu.arraydescrof(ARRAY)
         #
         if oopspec_name == 'newlist':
@@ -946,7 +944,7 @@
             if len(args) > 1:
                 v_default = args[1]
                 if (not isinstance(v_default, Constant) or
-                    v_default.value != TP.TO.OF._defl()):
+                    v_default.value != ARRAY.OF._defl()):
                     return False     # variable or non-null initial value
             self.emit('new_array')
             self.emit(self.get_position(arraydescr))

Modified: pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/test/test_slist.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/test/test_slist.py	(original)
+++ pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/test/test_slist.py	Thu Apr 23 14:20:18 2009
@@ -97,8 +97,8 @@
         assert res == 42
         py.test.skip("not virtualized away so far")
 
-#class TestOOtype(ListTests, OOJitMixin):
-#    pass
+class TestOOtype(ListTests, OOJitMixin):
+   pass
 
 class TestLLtype(ListTests, LLJitMixin):
     pass



More information about the Pypy-commit mailing list