[pypy-svn] r64955 - in pypy/branch/pyjitpl5/pypy/jit/backend/minimal: . test

antocuni at codespeak.net antocuni at codespeak.net
Fri May 1 19:40:15 CEST 2009


Author: antocuni
Date: Fri May  1 19:40:15 2009
New Revision: 64955

Modified:
   pypy/branch/pyjitpl5/pypy/jit/backend/minimal/runner.py
   pypy/branch/pyjitpl5/pypy/jit/backend/minimal/test/test_zrpy_tl.py
Log:
impressive, test_tiny1 passes with a minimal fix: we need to use our own copy
of MethDescr because the llgraph one calls maybe_on_top_of_llinterp, and it's
hard to convince the annotator to ignore it



Modified: pypy/branch/pyjitpl5/pypy/jit/backend/minimal/runner.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/minimal/runner.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/minimal/runner.py	Fri May  1 19:40:15 2009
@@ -629,6 +629,26 @@
         self.call = call
         self.errbox = errbox
 
+class MethDescr(AbstractMethDescr):
+    callmeth = None
+    def __init__(self, SELFTYPE, methname):
+        from pypy.jit.backend.llgraph.runner import boxresult, make_getargs
+        _, meth = SELFTYPE._lookup(methname)
+        METH = ootype.typeOf(meth)
+        self.SELFTYPE = SELFTYPE
+        self.METH = METH
+        self.methname = methname
+        RESULT = METH.RESULT
+        getargs = make_getargs(METH.ARGS)
+        def callmeth(selfbox, argboxes):
+            selfobj = ootype.cast_from_object(SELFTYPE, selfbox.getobj())
+            meth = getattr(selfobj, methname)
+            methargs = getargs(argboxes)
+            res = meth(*methargs)
+            if RESULT is not ootype.Void:
+                return boxresult(RESULT, res)
+        self.callmeth = callmeth
+
 
 # ____________________________________________________________
 
@@ -692,6 +712,7 @@
     'rffi': rffi,
     'BoxInt': BoxInt,
     'BoxPtr': BoxPtr,
+    'BoxObj': BoxObj,
     }
 
 class GuardFailed(Exception):

Modified: pypy/branch/pyjitpl5/pypy/jit/backend/minimal/test/test_zrpy_tl.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/minimal/test/test_zrpy_tl.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/minimal/test/test_zrpy_tl.py	Fri May  1 19:40:15 2009
@@ -1,8 +1,19 @@
 import py
 from pypy.jit.metainterp.test.test_tl import ToyLanguageTests
-from pypy.jit.backend.minimal.test.test_zrpy_exception import LLTranslatedJitMixin
+from pypy.jit.backend.minimal.test.test_zrpy_exception import LLTranslatedJitMixin, OOTranslatedJitMixin
 
-class TestTL(LLTranslatedJitMixin, ToyLanguageTests):
+class TestOOtype(OOTranslatedJitMixin, ToyLanguageTests):
+
+    def skip(self):
+        py.test.skip('in-progress')
+    
+    test_tlr = skip
+    test_tl_base = skip
+    test_tl_2 = skip
+    test_tl_call = skip
+
+
+class TestLLtype(LLTranslatedJitMixin, ToyLanguageTests):
     # for the individual tests see
     # ====> ../../../metainterp/test/test_tl.py
     pass



More information about the Pypy-commit mailing list