[pypy-svn] r64634 - in pypy/branch/pyjitpl5-simplify/pypy/jit: backend/llgraph metainterp/test
antocuni at codespeak.net
antocuni at codespeak.net
Fri Apr 24 12:40:32 CEST 2009
Author: antocuni
Date: Fri Apr 24 12:40:32 2009
New Revision: 64634
Modified:
pypy/branch/pyjitpl5-simplify/pypy/jit/backend/llgraph/llimpl.py
pypy/branch/pyjitpl5-simplify/pypy/jit/backend/llgraph/runner.py
pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/test/test_vlist.py
Log:
implement array_getlength_gc for ootype, and the last vlist test passes
Modified: pypy/branch/pyjitpl5-simplify/pypy/jit/backend/llgraph/llimpl.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/jit/backend/llgraph/llimpl.py (original)
+++ pypy/branch/pyjitpl5-simplify/pypy/jit/backend/llgraph/llimpl.py Fri Apr 24 12:40:32 2009
@@ -738,6 +738,10 @@
array = ootype.cast_from_object(typedescr.ARRAY, obj)
array.ll_setitem_fast(index, newvalue)
+ def op_arraylen_gc(self, typedescr, obj):
+ array = ootype.cast_from_object(typedescr.ARRAY, obj)
+ return array.ll_length()
+
def op_call(self, calldescr, func, *args):
sm = ootype.cast_from_object(calldescr.FUNC, func)
newargs = cast_call_args(calldescr.FUNC.ARGS, args, self.memocast)
Modified: pypy/branch/pyjitpl5-simplify/pypy/jit/backend/llgraph/runner.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/jit/backend/llgraph/runner.py (original)
+++ pypy/branch/pyjitpl5-simplify/pypy/jit/backend/llgraph/runner.py Fri Apr 24 12:40:32 2009
@@ -471,6 +471,11 @@
assert len(args) == 3
return typedescr.setarrayitem(*args)
+ def do_arraylen_gc(self, args, typedescr):
+ assert isinstance(typedescr, TypeDescr)
+ assert len(args) == 1
+ return typedescr.getarraylength(*args)
+
def do_call(self, args, descr):
assert isinstance(descr, StaticMethDescr)
funcbox = args[0]
@@ -599,11 +604,16 @@
i = ibox.getint()
value = unwrap(TYPE, valuebox)
array.ll_setitem_fast(i, value)
-
+
+ def getarraylength(arraybox):
+ array = ootype.cast_from_object(ARRAY, arraybox.getobj())
+ return boxresult(ootype.Signed, array.ll_length())
+
self.create = create
self.create_array = create_array
self.getarrayitem = getarrayitem
self.setarrayitem = setarrayitem
+ self.getarraylength = getarraylength
class FieldDescr(OODescr):
Modified: pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/test/test_vlist.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/test/test_vlist.py (original)
+++ pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/test/test_vlist.py Fri Apr 24 12:40:32 2009
@@ -357,11 +357,7 @@
class TestOOtype(ListTests, OOJitMixin):
- def skip(self):
- py.test.skip('in-progress')
-
- test_ll_fixed_setitem_fast = skip
-
+ pass
class TestLLtype(ListTests, LLJitMixin):
pass
More information about the Pypy-commit
mailing list