[pypy-svn] r65293 - in pypy/branch/pyjitpl5/pypy/jit/backend/cli: . test

antocuni at codespeak.net antocuni at codespeak.net
Mon May 18 10:53:04 CEST 2009


Author: antocuni
Date: Mon May 18 10:53:03 2009
New Revision: 65293

Modified:
   pypy/branch/pyjitpl5/pypy/jit/backend/cli/method.py
   pypy/branch/pyjitpl5/pypy/jit/backend/cli/runner.py
   pypy/branch/pyjitpl5/pypy/jit/backend/cli/test/test_zrpy_slist.py
Log:
implement arraylen_gc. test_lazy_getitem_4 mostly passes, but it's skipped at the end



Modified: pypy/branch/pyjitpl5/pypy/jit/backend/cli/method.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/cli/method.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/cli/method.py	Mon May 18 10:53:03 2009
@@ -406,7 +406,13 @@
         self.il.Emit(OpCodes.Stelem, itemtype)
 
     def emit_op_arraylen_gc(self, op):
-        raise NotImplementedError
+        descr = op.descr
+        assert isinstance(descr, runner.TypeDescr)
+        clitype = descr.get_array_clitype()
+        op.args[0].load(self)
+        self.il.Emit(OpCodes.Castclass, clitype)
+        self.il.Emit(OpCodes.Ldlen)
+        self.store_result(op)
         
     def not_implemented(self, op):
         raise NotImplementedError

Modified: pypy/branch/pyjitpl5/pypy/jit/backend/cli/runner.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/cli/runner.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/cli/runner.py	Mon May 18 10:53:03 2009
@@ -151,7 +151,12 @@
         ibox = args[1]
         valuebox = args[2]
         descr.setarrayitem(arraybox, ibox, valuebox)
-        
+
+    def do_arraylen_gc(self, args, descr):
+        assert isinstance(descr, TypeDescr)
+        assert len(args) == 1
+        arraybox = args[0]
+        return descr.getarraylength(arraybox)
 
 # ----------------------------------------------------------------------
 key_manager = KeyManager()

Modified: pypy/branch/pyjitpl5/pypy/jit/backend/cli/test/test_zrpy_slist.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/cli/test/test_zrpy_slist.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/cli/test/test_zrpy_slist.py	Mon May 18 10:53:03 2009
@@ -6,9 +6,4 @@
 class TestSList(CliTranslatedJitMixin, test_slist.TestOOtype):
     # for the individual tests see
     # ====> ../../../metainterp/test/test_slist.py
-
-    def skip(self):
-        py.test.skip('in-progress')
-
-
-    test_lazy_getitem_4 = skip
+    pass



More information about the Pypy-commit mailing list