[pypy-commit] pypy range-immutable: merge default again x2
fijal
noreply at buildbot.pypy.org
Thu Jul 21 18:17:05 CEST 2011
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: range-immutable
Changeset: r45832:a17d21b7ede9
Date: 2011-07-21 18:15 +0200
http://bitbucket.org/pypy/pypy/changeset/a17d21b7ede9/
Log: merge default again x2
diff --git a/pypy/jit/metainterp/test/test_ajit.py b/pypy/jit/metainterp/test/test_ajit.py
--- a/pypy/jit/metainterp/test/test_ajit.py
+++ b/pypy/jit/metainterp/test/test_ajit.py
@@ -2586,7 +2586,23 @@
return n
res = self.meta_interp(f, [10, 1])
self.check_loops(getfield_gc=2)
+ assert res == f(10, 1)
+ def test_jit_merge_point_with_raw_pointer(self):
+ driver = JitDriver(greens = [], reds = ['n', 'x'])
+
+ TP = lltype.Array(lltype.Signed, hints={'nolength': True})
+
+ def f(n):
+ x = lltype.malloc(TP, 10, flavor='raw')
+ x[0] = 1
+ while n > 0:
+ driver.jit_merge_point(n=n, x=x)
+ n -= x[0]
+ lltype.free(x, flavor='raw')
+ return n
+
+ self.meta_interp(f, [10], repeat=3)
class TestLLtype(BaseLLtypeTests, LLJitMixin):
pass
diff --git a/pypy/jit/metainterp/warmstate.py b/pypy/jit/metainterp/warmstate.py
--- a/pypy/jit/metainterp/warmstate.py
+++ b/pypy/jit/metainterp/warmstate.py
@@ -138,6 +138,9 @@
refvalue = cpu.ts.cast_to_ref(value)
cpu.set_future_value_ref(j, refvalue)
elif typecode == 'int':
+ if isinstance(lltype.typeOf(value), lltype.Ptr):
+ intvalue = llmemory.AddressAsInt(llmemory.cast_ptr_to_adr(value))
+ else:
intvalue = lltype.cast_primitive(lltype.Signed, value)
cpu.set_future_value_int(j, intvalue)
elif typecode == 'float':
diff --git a/pypy/module/micronumpy/interp_numarray.py b/pypy/module/micronumpy/interp_numarray.py
--- a/pypy/module/micronumpy/interp_numarray.py
+++ b/pypy/module/micronumpy/interp_numarray.py
@@ -272,8 +272,8 @@
i = start
j = 0
while i < stop:
- slice_driver1.jit_merge_point(signature=arr.signature,
- step=step, stop=stop, i=i, j=j, arr=arr, storage=storage)
+ #slice_driver1.jit_merge_point(signature=arr.signature,
+ # step=step, stop=stop, i=i, j=j, arr=arr, storage=storage)
storage[i] = arr.eval(j)
j += 1
i += step
@@ -282,8 +282,8 @@
i = start
j = 0
while i > stop:
- slice_driver2.jit_merge_point(signature=arr.signature,
- step=step, stop=stop, i=i, j=j, arr=arr, storage=storage)
+ #slice_driver2.jit_merge_point(signature=arr.signature,
+ # step=step, stop=stop, i=i, j=j, arr=arr, storage=storage)
storage[i] = arr.eval(j)
j += 1
i += step
More information about the pypy-commit
mailing list