Author: Brian Kearns <[email protected]>
Branch:
Changeset: r60598:c4d480f3bce6
Date: 2013-01-28 04:48 -0500
http://bitbucket.org/pypy/pypy/changeset/c4d480f3bce6/
Log: merge heads
diff --git a/rpython/jit/backend/llsupport/ffisupport.py
b/rpython/jit/backend/llsupport/ffisupport.py
--- a/rpython/jit/backend/llsupport/ffisupport.py
+++ b/rpython/jit/backend/llsupport/ffisupport.py
@@ -42,11 +42,14 @@
@specialize.memo()
def _get_ffi2descr_dict(cpu):
- d = {('v', 0): ('v', None)}
+ def entry(letter, TYPE):
+ return (letter, cpu.arraydescrof(rffi.CArray(TYPE)), rffi.sizeof(TYPE))
+ #
+ d = {('v', 0): ('v', None, 1)}
if cpu.supports_floats:
- d[('f', 0)] = ('f', cpu.arraydescrof(rffi.CArray(lltype.Float)))
+ d[('f', 0)] = entry('f', lltype.Float)
if cpu.supports_singlefloats:
- d[('S', 0)] = ('i', cpu.arraydescrof(rffi.CArray(lltype.SingleFloat)))
+ d[('S', 0)] = entry('i', lltype.SingleFloat)
for SIGNED_TYPE in [rffi.SIGNEDCHAR,
rffi.SHORT,
rffi.INT,
@@ -59,7 +62,7 @@
continue
key = ('L', 0)
kind = 'f'
- d[key] = (kind, cpu.arraydescrof(rffi.CArray(SIGNED_TYPE)))
+ d[key] = entry(kind, SIGNED_TYPE)
for UNSIGNED_TYPE in [rffi.UCHAR,
rffi.USHORT,
rffi.UINT,
@@ -68,7 +71,7 @@
key = ('u', rffi.sizeof(UNSIGNED_TYPE))
if key[1] > rffi.sizeof(lltype.Signed):
continue
- d[key] = ('i', cpu.arraydescrof(rffi.CArray(UNSIGNED_TYPE)))
+ d[key] = entry('i', UNSIGNED_TYPE)
return d
def get_arg_descr(cpu, ffi_type):
diff --git a/rpython/jit/metainterp/pyjitpl.py
b/rpython/jit/metainterp/pyjitpl.py
--- a/rpython/jit/metainterp/pyjitpl.py
+++ b/rpython/jit/metainterp/pyjitpl.py
@@ -2567,7 +2567,8 @@
self.history.operations.pop()
arg_boxes = []
for i in range(cif_description.nargs):
- kind, descr = get_arg_descr(self.cpu, cif_description.atypes[i])
+ kind, descr, itemsize = get_arg_descr(self.cpu,
+ cif_description.atypes[i])
if kind == 'i':
box_arg = history.BoxInt()
elif kind == 'f':
@@ -2576,16 +2577,14 @@
assert kind == 'v'
continue
ofs = cif_description.exchange_args[i]
- box_argpos = history.BoxInt()
- self.history.record(rop.INT_ADD,
- [box_exchange_buffer, ConstInt(ofs)],
- box_argpos)
+ assert ofs % itemsize == 0 # alignment check
self.history.record(rop.GETARRAYITEM_RAW,
- [box_argpos, ConstInt(0)],
+ [box_exchange_buffer,
+ ConstInt(ofs // itemsize)],
box_arg, descr)
arg_boxes.append(box_arg)
#
- kind, descr = get_arg_descr(self.cpu, cif_description.rtype)
+ kind, descr, itemsize = get_arg_descr(self.cpu, cif_description.rtype)
if kind == 'i':
box_result = history.BoxInt()
elif kind == 'f':
@@ -2601,12 +2600,10 @@
#
if box_result is not None:
ofs = cif_description.exchange_result
- box_resultpos = history.BoxInt()
- self.history.record(rop.INT_ADD,
- [box_exchange_buffer, ConstInt(ofs)],
- box_resultpos)
+ assert ofs % itemsize == 0 # alignment check (result)
self.history.record(rop.SETARRAYITEM_RAW,
- [box_resultpos, ConstInt(0), box_result],
+ [box_exchange_buffer,
+ ConstInt(ofs // itemsize), box_result],
None, descr)
def direct_call_release_gil(self):
diff --git a/rpython/jit/metainterp/test/test_warmspot.py
b/rpython/jit/metainterp/test/test_warmspot.py
--- a/rpython/jit/metainterp/test/test_warmspot.py
+++ b/rpython/jit/metainterp/test/test_warmspot.py
@@ -401,6 +401,7 @@
assert len(oplabel.getarglist()) == 2 # 'n', 'res' in some order
def test_inline_jit_merge_point(self):
+ py.test.skip("fix the test if you want to re-enable this")
# test that the machinery to inline jit_merge_points in callers
# works. The final user does not need to mess manually with the
# _inline_jit_merge_point_ attribute and similar, it is all nicely
@@ -430,6 +431,7 @@
self.check_resops(int_add=4)
def test_jitdriver_inline(self):
+ py.test.skip("fix the test if you want to re-enable this")
myjitdriver = JitDriver(greens = [], reds = 'auto')
class MyRange(object):
def __init__(self, n):
@@ -462,6 +464,7 @@
self.check_trace_count(1)
def test_jitdriver_inline_twice(self):
+ py.test.skip("fix the test if you want to re-enable this")
myjitdriver = JitDriver(greens = [], reds = 'auto')
def jit_merge_point(a, b):
@@ -492,6 +495,7 @@
self.check_trace_count(2)
def test_jitdriver_inline_exception(self):
+ py.test.skip("fix the test if you want to re-enable this")
# this simulates what happens in a real case scenario: inside the next
# we have a call which we cannot inline (e.g. space.next in the case
# of W_InterpIterable), but we need to put it in a try/except block.
diff --git a/rpython/rlib/jit.py b/rpython/rlib/jit.py
--- a/rpython/rlib/jit.py
+++ b/rpython/rlib/jit.py
@@ -578,6 +578,8 @@
pass
def inline(self, call_jit_merge_point):
+ assert False, "@inline off: see skipped failures in test_warmspot."
+ #
assert self.autoreds, "@inline works only with reds='auto'"
self.inline_jit_merge_point = True
def decorate(func):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit