Author: Maciej Fijalkowski <[email protected]>
Branch: rewritten-loop-logging
Changeset: r66186:87cf0e737036
Date: 2013-08-17 17:51 +0200
http://bitbucket.org/pypy/pypy/changeset/87cf0e737036/
Log: Fix the tests
diff --git a/rpython/jit/backend/llsupport/test/test_gc_integration.py
b/rpython/jit/backend/llsupport/test/test_gc_integration.py
--- a/rpython/jit/backend/llsupport/test/test_gc_integration.py
+++ b/rpython/jit/backend/llsupport/test/test_gc_integration.py
@@ -676,7 +676,7 @@
'checkdescr': checkdescr,
'fielddescr': cpu.fielddescrof(S, 'x')})
token = JitCellToken()
- cpu.compile_loop(loop.inputargs, loop.operations, token)
+ cpu.compile_loop(None, loop.inputargs, loop.operations, token)
p0 = lltype.malloc(S, zero=True)
p1 = lltype.malloc(S)
p2 = lltype.malloc(S)
@@ -715,7 +715,7 @@
'calldescr': checkdescr,
})
token = JitCellToken()
- cpu.compile_loop(loop.inputargs, loop.operations, token)
+ cpu.compile_loop(None, loop.inputargs, loop.operations, token)
S = self.S
s = lltype.malloc(S)
cpu.execute_token(token, 1, s)
@@ -743,7 +743,7 @@
token = JitCellToken()
cpu.gc_ll_descr.init_nursery(20)
cpu.setup_once()
- cpu.compile_loop(loop.inputargs, loop.operations, token)
+ cpu.compile_loop(None, loop.inputargs, loop.operations, token)
arg = longlong.getfloatstorage(2.3)
frame = cpu.execute_token(token, arg)
ofs = cpu.get_baseofs_of_frame_field()
@@ -770,7 +770,7 @@
cpu.gc_ll_descr.collections = [[0, sizeof.size]]
cpu.gc_ll_descr.init_nursery(2 * sizeof.size)
cpu.setup_once()
- cpu.compile_loop(loop.inputargs, loop.operations, token)
+ cpu.compile_loop(None, loop.inputargs, loop.operations, token)
frame = cpu.execute_token(token)
# now we should be able to track everything from the frame
frame = lltype.cast_opaque_ptr(JITFRAMEPTR, frame)
@@ -821,7 +821,7 @@
token = JitCellToken()
cpu.gc_ll_descr.init_nursery(100)
cpu.setup_once()
- cpu.compile_loop(loop.inputargs, loop.operations, token)
+ cpu.compile_loop(None, loop.inputargs, loop.operations, token)
args = [lltype.nullptr(llmemory.GCREF.TO) for i in range(7)]
frame = cpu.execute_token(token, 1, *args)
frame = rffi.cast(JITFRAMEPTR, frame)
@@ -867,7 +867,7 @@
token = JitCellToken()
cpu.gc_ll_descr.init_nursery(100)
cpu.setup_once()
- cpu.compile_loop(loop.inputargs, loop.operations, token)
+ cpu.compile_loop(None, loop.inputargs, loop.operations, token)
frame = lltype.cast_opaque_ptr(JITFRAMEPTR,
cpu.execute_token(token, 1, a))
@@ -911,7 +911,7 @@
token = JitCellToken()
cpu.gc_ll_descr.init_nursery(100)
cpu.setup_once()
- cpu.compile_loop(loop.inputargs, loop.operations, token)
+ cpu.compile_loop(None, loop.inputargs, loop.operations, token)
frame = lltype.cast_opaque_ptr(JITFRAMEPTR,
cpu.execute_token(token, 1, a))
assert getmap(frame).count('1') == 4
diff --git a/rpython/jit/backend/llsupport/test/test_regalloc_integration.py
b/rpython/jit/backend/llsupport/test/test_regalloc_integration.py
--- a/rpython/jit/backend/llsupport/test/test_regalloc_integration.py
+++ b/rpython/jit/backend/llsupport/test/test_regalloc_integration.py
@@ -97,7 +97,7 @@
loop = self.parse(ops, namespace=namespace)
self.loop = loop
looptoken = JitCellToken()
- self.cpu.compile_loop(loop.inputargs, loop.operations, looptoken)
+ self.cpu.compile_loop(None, loop.inputargs, loop.operations, looptoken)
arguments = []
for arg in args:
if isinstance(arg, int):
@@ -147,7 +147,8 @@
assert ([box.type for box in bridge.inputargs] ==
[box.type for box in guard_op.getfailargs()])
faildescr = guard_op.getdescr()
- self.cpu.compile_bridge(faildescr, bridge.inputargs, bridge.operations,
+ self.cpu.compile_bridge(None, faildescr, bridge.inputargs,
+ bridge.operations,
loop._jitcelltoken)
return bridge
@@ -335,7 +336,7 @@
'''
self.interpret(ops, [0, 0, 3, 0])
assert self.getints(3) == [1, -3, 10]
-
+
def test_compare_memory_result_survives(self):
ops = '''
[i0, i1, i2, i3]
@@ -409,7 +410,7 @@
class TestRegallocCompOps(BaseTestRegalloc):
-
+
def test_cmp_op_0(self):
ops = '''
[i0, i3]
@@ -575,7 +576,7 @@
class TestRegAllocCallAndStackDepth(BaseTestRegalloc):
def setup_class(cls):
py.test.skip("skip for now, not sure what do we do")
-
+
def expected_frame_depth(self, num_call_args, num_pushed_input_args=0):
# Assumes the arguments are all non-float
if not self.cpu.IS_64_BIT:
@@ -612,7 +613,7 @@
ops = '''
[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9]
i10 = call(ConstClass(f1ptr), i0, descr=f1_calldescr)
- i11 = call(ConstClass(f2ptr), i10, i1, descr=f2_calldescr)
+ i11 = call(ConstClass(f2ptr), i10, i1, descr=f2_calldescr)
guard_false(i5) [i11, i1, i2, i3, i4, i5, i6, i7, i8, i9]
'''
loop = self.interpret(ops, [4, 7, 9, 9 ,9, 9, 9, 9, 9, 9])
@@ -649,7 +650,7 @@
ops = '''
[i2, i0, i1]
- i3 = call(ConstClass(f2ptr), i2, i1, descr=f2_calldescr)
+ i3 = call(ConstClass(f2ptr), i2, i1, descr=f2_calldescr)
guard_false(i0, descr=fdescr2) [i3, i0]
'''
bridge = self.attach_bridge(ops, loop, -2)
@@ -676,7 +677,7 @@
ops = '''
[i2]
- i3 = call(ConstClass(f1ptr), i2, descr=f1_calldescr)
+ i3 = call(ConstClass(f1ptr), i2, descr=f1_calldescr)
guard_false(i3, descr=fdescr2) [i3]
'''
bridge = self.attach_bridge(ops, loop, -2)
diff --git a/rpython/jit/backend/llsupport/test/test_runner.py
b/rpython/jit/backend/llsupport/test/test_runner.py
--- a/rpython/jit/backend/llsupport/test/test_runner.py
+++ b/rpython/jit/backend/llsupport/test/test_runner.py
@@ -14,7 +14,7 @@
def set_debug(flag):
pass
- def compile_loop(self, inputargs, operations, looptoken):
+ def compile_loop(self, logger, inputargs, operations, looptoken):
py.test.skip("llsupport test: cannot compile operations")
diff --git a/rpython/jit/backend/test/calling_convention_test.py
b/rpython/jit/backend/test/calling_convention_test.py
--- a/rpython/jit/backend/test/calling_convention_test.py
+++ b/rpython/jit/backend/test/calling_convention_test.py
@@ -105,7 +105,7 @@
loop = parse(ops, namespace=locals())
looptoken = JitCellToken()
- self.cpu.compile_loop(loop.inputargs, loop.operations, looptoken)
+ self.cpu.compile_loop(None, loop.inputargs, loop.operations,
looptoken)
argvals, expected_result = self._prepare_args(args, floats, ints)
deadframe = self.cpu.execute_token(looptoken, *argvals)
@@ -249,7 +249,7 @@
called_looptoken = JitCellToken()
called_looptoken.outermost_jitdriver_sd = FakeJitDriverSD()
done_descr = called_loop.operations[-1].getdescr()
- self.cpu.compile_loop(called_loop.inputargs,
called_loop.operations, called_looptoken)
+ self.cpu.compile_loop(None, called_loop.inputargs,
called_loop.operations, called_looptoken)
argvals, expected_result = self._prepare_args(args, floats, ints)
deadframe = cpu.execute_token(called_looptoken, *argvals)
@@ -278,7 +278,7 @@
self.cpu.done_with_this_frame_descr_float = done_descr
try:
othertoken = JitCellToken()
- self.cpu.compile_loop(loop.inputargs, loop.operations,
othertoken)
+ self.cpu.compile_loop(None, loop.inputargs, loop.operations,
othertoken)
# prepare call to called_loop
argvals, _ = self._prepare_args(args, floats, ints)
@@ -424,7 +424,7 @@
loop = parse(ops, namespace=locals())
looptoken = JitCellToken()
- self.cpu.compile_loop(loop.inputargs, loop.operations, looptoken)
+ self.cpu.compile_loop(None, loop.inputargs, loop.operations,
looptoken)
argvals, expected_result = self._prepare_args(args, floats, ints)
deadframe = self.cpu.execute_token(looptoken, *argvals)
diff --git a/rpython/jit/backend/test/test_random.py
b/rpython/jit/backend/test/test_random.py
--- a/rpython/jit/backend/test/test_random.py
+++ b/rpython/jit/backend/test/test_random.py
@@ -239,9 +239,9 @@
print >>s, ' operations[%d].setfailargs([%s])' % (i, fa)
if fail_descr is None:
print >>s, ' looptoken = JitCellToken()'
- print >>s, ' cpu.compile_loop(inputargs, operations, looptoken)'
+ print >>s, ' cpu.compile_loop(None, inputargs, operations,
looptoken)'
else:
- print >>s, ' cpu.compile_bridge(%s, inputargs, operations,
looptoken)' % self.descr_counters[fail_descr]
+ print >>s, ' cpu.compile_bridge(None, %s, inputargs,
operations, looptoken)' % self.descr_counters[fail_descr]
if hasattr(self.loop, 'inputargs'):
vals = []
for i, v in enumerate(self.loop.inputargs):
@@ -643,7 +643,7 @@
self.builder = builder
self.loop = loop
dump(loop)
- cpu.compile_loop(loop.inputargs, loop.operations, loop._jitcelltoken)
+ cpu.compile_loop(None, loop.inputargs, loop.operations,
loop._jitcelltoken)
if self.output:
builder.print_loop(self.output)
@@ -715,7 +715,7 @@
if box not in self.loop.inputargs:
box = box.constbox()
args.append(box)
- self.cpu.compile_loop(self.loop.inputargs,
+ self.cpu.compile_loop(None, self.loop.inputargs,
[ResOperation(rop.JUMP, args, None,
descr=self.loop._targettoken)],
self._initialjumploop_celltoken)
@@ -851,7 +851,7 @@
if r.random() < .05:
return False
dump(subloop)
- self.builder.cpu.compile_bridge(fail_descr, fail_args,
+ self.builder.cpu.compile_bridge(None, fail_descr, fail_args,
subloop.operations,
self.loop._jitcelltoken)
diff --git a/rpython/jit/backend/x86/test/test_regalloc2.py
b/rpython/jit/backend/x86/test/test_regalloc2.py
--- a/rpython/jit/backend/x86/test/test_regalloc2.py
+++ b/rpython/jit/backend/x86/test/test_regalloc2.py
@@ -32,7 +32,7 @@
cpu = CPU(None, None)
cpu.setup_once()
looptoken = JitCellToken()
- cpu.compile_loop(inputargs, operations, looptoken)
+ cpu.compile_loop(None, inputargs, operations, looptoken)
deadframe = cpu.execute_token(looptoken, 9)
assert cpu.get_int_value(deadframe, 0) == (9 >> 3)
assert cpu.get_int_value(deadframe, 1) == (~18)
@@ -58,7 +58,7 @@
cpu = CPU(None, None)
cpu.setup_once()
looptoken = JitCellToken()
- cpu.compile_loop(inputargs, operations, looptoken)
+ cpu.compile_loop(None, inputargs, operations, looptoken)
deadframe = cpu.execute_token(looptoken, -10)
assert cpu.get_int_value(deadframe, 0) == 0
assert cpu.get_int_value(deadframe, 1) == -1000
@@ -159,7 +159,7 @@
cpu = CPU(None, None)
cpu.setup_once()
looptoken = JitCellToken()
- cpu.compile_loop(inputargs, operations, looptoken)
+ cpu.compile_loop(None, inputargs, operations, looptoken)
deadframe = cpu.execute_token(looptoken, -13, 10, 10, 8, -8,
-16, -18, 46, -12, 26)
assert cpu.get_int_value(deadframe, 0) == 0
@@ -271,7 +271,7 @@
cpu = CPU(None, None)
cpu.setup_once()
looptoken = JitCellToken()
- cpu.compile_loop(inputargs, operations, looptoken)
+ cpu.compile_loop(None, inputargs, operations, looptoken)
deadframe = cpu.execute_token(looptoken, 17, -20, -6, 6, 1,
13, 13, 9, 49, 8)
assert cpu.get_int_value(deadframe, 0) == 0
@@ -386,7 +386,7 @@
operations[4].setfailargs([v4, v8, v10, v2, v9, v7, v6, v1])
operations[8].setfailargs([v3, v9, v2, v6, v4])
looptoken = JitCellToken()
- cpu.compile_loop(inputargs, operations, looptoken)
+ cpu.compile_loop(None, inputargs, operations, looptoken)
loop_args = [1, -39, 46, 21, 16, 6, -4611686018427387905, 12, 14, 2]
frame = cpu.execute_token(looptoken, *loop_args)
assert cpu.get_int_value(frame, 0) == 46
@@ -493,7 +493,7 @@
operations[16].setfailargs([v5, v9])
operations[34].setfailargs([])
operations[37].setfailargs([v12, v19, v10, v7, v4, v8, v18, v15, v9])
- cpu.compile_bridge(faildescr1, inputargs, operations, looptoken)
+ cpu.compile_bridge(None, faildescr1, inputargs, operations, looptoken)
frame = cpu.execute_token(looptoken, *loop_args)
#assert cpu.get_int_value(frame, 0) == -9223372036854775766
assert cpu.get_int_value(frame, 1) == 0
@@ -583,7 +583,7 @@
operations[0].setfailargs([])
operations[8].setfailargs([tmp23, v5, v3, v11, v6])
operations[30].setfailargs([v6])
- cpu.compile_bridge(faildescr6, inputargs, operations, looptoken)
+ cpu.compile_bridge(None, faildescr6, inputargs, operations, looptoken)
frame = cpu.execute_token(looptoken, *loop_args)
#assert cpu.get_int_value(frame, 0) == -9223372036854775808
v1 = BoxInt()
@@ -607,6 +607,6 @@
ResOperation(rop.FINISH, [], None, descr=finishdescr13),
]
operations[4].setfailargs([v2])
- cpu.compile_bridge(faildescr10, inputargs, operations, looptoken)
+ cpu.compile_bridge(None, faildescr10, inputargs, operations, looptoken)
frame = cpu.execute_token(looptoken, *loop_args)
#assert cpu.get_int_value(frame, 0) == 10
diff --git a/rpython/jit/metainterp/compile.py
b/rpython/jit/metainterp/compile.py
--- a/rpython/jit/metainterp/compile.py
+++ b/rpython/jit/metainterp/compile.py
@@ -934,7 +934,7 @@
]
operations[1].setfailargs([])
operations = get_deep_immutable_oplist(operations)
- cpu.compile_loop(inputargs, operations, jitcell_token, log=False)
+ cpu.compile_loop(None, inputargs, operations, jitcell_token, log=False)
if memory_manager is not None: # for tests
memory_manager.keep_loop_alive(jitcell_token)
return jitcell_token
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit