[pypy-commit] pypy globals-quasiimmut: rejigger test_pypy_c tests
cfbolz
pypy.commits at gmail.com
Thu Jan 14 03:40:58 EST 2016
Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: globals-quasiimmut
Changeset: r81753:4588aac79c87
Date: 2016-01-14 09:39 +0100
http://bitbucket.org/pypy/pypy/changeset/4588aac79c87/
Log: rejigger test_pypy_c tests
diff --git a/pypy/module/pypyjit/test_pypy_c/test_00_model.py b/pypy/module/pypyjit/test_pypy_c/test_00_model.py
--- a/pypy/module/pypyjit/test_pypy_c/test_00_model.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_00_model.py
@@ -526,7 +526,7 @@
log = self.run(f)
loop, = log.loops_by_filename(self.filepath)
call_ops = log.opnames(loop.ops_by_id('call'))
- assert call_ops == ['force_token'] # it does not follow inlining
+ assert call_ops == ['guard_not_invalidated', 'force_token'] # it does not follow inlining
#
add_ops = log.opnames(loop.ops_by_id('add'))
assert add_ops == ['int_add']
@@ -534,9 +534,10 @@
ops = log.opnames(loop.allops())
assert ops == [
# this is the actual loop
- 'int_lt', 'guard_true', 'force_token', 'int_add',
+ 'int_lt', 'guard_true',
+ 'guard_not_invalidated', 'force_token', 'int_add',
# this is the signal checking stuff
- 'guard_not_invalidated', 'getfield_raw_i', 'int_lt', 'guard_false',
+ 'getfield_raw_i', 'int_lt', 'guard_false',
'jump'
]
diff --git a/pypy/module/pypyjit/test_pypy_c/test_call.py b/pypy/module/pypyjit/test_pypy_c/test_call.py
--- a/pypy/module/pypyjit/test_pypy_c/test_call.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_call.py
@@ -72,8 +72,6 @@
# LOAD_GLOBAL of OFFSET
ops = entry_bridge.ops_by_id('cond', opcode='LOAD_GLOBAL')
assert log.opnames(ops) == ["guard_value",
- "guard_value",
- "getfield_gc_r", "guard_value",
"guard_not_invalidated"]
ops = entry_bridge.ops_by_id('add', opcode='LOAD_GLOBAL')
assert log.opnames(ops) == []
@@ -200,6 +198,7 @@
assert log.result == 1000
loop, = log.loops_by_id('call')
assert loop.match_by_id('call', """
+ guard_not_invalidated?
i14 = force_token()
i16 = force_token()
""")
@@ -222,7 +221,7 @@
loop, = log.loops_by_id('call')
ops = log.opnames(loop.ops_by_id('call'))
guards = [ops for ops in ops if ops.startswith('guard')]
- assert guards == ["guard_no_overflow"]
+ assert guards == ["guard_not_invalidated", "guard_no_overflow"]
def test_kwargs(self):
# this is not a very precise test, could be improved
@@ -281,6 +280,7 @@
assert log.result == 13000
loop0, = log.loops_by_id('g1')
assert loop0.match_by_id('g1', """
+ guard_not_invalidated?
i20 = force_token()
i22 = int_add_ovf(i8, 3)
guard_no_overflow(descr=...)
@@ -438,9 +438,6 @@
i22 = getfield_gc_pure_i(p12, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval .*>)
i24 = int_lt(i22, 5000)
guard_true(i24, descr=...)
- guard_value(p7, ConstPtr(ptr25), descr=...)
- p26 = getfield_gc_r(p7, descr=<FieldP pypy.objspace.std.dictmultiobject.W_DictMultiObject.inst_strategy .*>)
- guard_value(p26, ConstPtr(ptr27), descr=...)
guard_not_invalidated(descr=...)
p29 = call_r(ConstClass(_ll_1_threadlocalref_get__Ptr_GcStruct_objectLlT_Signed), #, descr=<Callr . i EF=1 OS=5>)
p30 = getfield_gc_r(p29, descr=<FieldP pypy.interpreter.executioncontext.ExecutionContext.inst_topframeref .*>)
@@ -472,6 +469,7 @@
i8 = getfield_gc_pure_i(p6, descr=<FieldS pypy.objspace.std.intobject.W_IntObject.inst_intval .*>)
i10 = int_lt(i8, 5000)
guard_true(i10, descr=...)
+ guard_not_invalidated?
i11 = force_token()
i13 = int_add(i8, 1)
--TICK--
diff --git a/pypy/module/pypyjit/test_pypy_c/test_globals.py b/pypy/module/pypyjit/test_pypy_c/test_globals.py
--- a/pypy/module/pypyjit/test_pypy_c/test_globals.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_globals.py
@@ -16,9 +16,5 @@
assert log.result == 500
loop, = log.loops_by_filename(self.filepath)
assert loop.match_by_id("loadglobal", """
- p12 = getfield_gc_r(p10, descr=<FieldP .*W_DictMultiObject.inst_strategy .*>)
- guard_value(p12, ConstPtr(ptr13), descr=...)
guard_not_invalidated(descr=...)
- p19 = getfield_gc_r(ConstPtr(p17), descr=<FieldP .*W_DictMultiObject.inst_strategy .*>)
- guard_value(p19, ConstPtr(ptr20), descr=...)
""")
diff --git a/pypy/module/pypyjit/test_pypy_c/test_instance.py b/pypy/module/pypyjit/test_pypy_c/test_instance.py
--- a/pypy/module/pypyjit/test_pypy_c/test_instance.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_instance.py
@@ -124,7 +124,7 @@
setfield_gc(ConstPtr(ptr39), i59, descr=...)
i62 = int_lt(i61, 0)
guard_false(i62, descr=...)
- jump(p0, p1, p3, p6, p7, p12, i59, p18, i31, i59, p100, descr=...)
+ jump(..., descr=...)
""")
def test_mutate_class(self):
@@ -183,7 +183,7 @@
setfield_gc(p77, ConstPtr(null), descr=...)
setfield_gc(p77, ConstPtr(ptr42), descr=...)
setfield_gc(ConstPtr(ptr69), p77, descr=...)
- jump(p0, p1, p3, p6, p7, p12, i74, p20, p26, i33, p77, p100, descr=...)
+ jump(..., descr=...)
""")
diff --git a/pypy/module/pypyjit/test_pypy_c/test_misc.py b/pypy/module/pypyjit/test_pypy_c/test_misc.py
--- a/pypy/module/pypyjit/test_pypy_c/test_misc.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_misc.py
@@ -145,9 +145,9 @@
i15 = int_lt(i10, i11)
guard_true(i15, descr=...)
i17 = int_add(i10, 1)
- i18 = force_token()
setfield_gc(p9, i17, descr=<.* .*W_XRangeIterator.inst_current .*>)
guard_not_invalidated(descr=...)
+ i18 = force_token()
i84 = int_sub(i14, 1)
i21 = int_lt(i10, 0)
guard_false(i21, descr=...)
@@ -178,9 +178,9 @@
i16 = int_ge(i11, i12)
guard_false(i16, descr=...)
i20 = int_add(i11, 1)
- i21 = force_token()
setfield_gc(p4, i20, descr=<.* .*W_AbstractSeqIterObject.inst_index .*>)
guard_not_invalidated?
+ i21 = force_token()
i88 = int_sub(i9, 1)
i25 = int_ge(i11, i9)
guard_false(i25, descr=...)
@@ -211,9 +211,9 @@
i17 = int_mul(i11, i14)
i18 = int_add(i15, i17)
i20 = int_add(i11, 1)
- i21 = force_token()
setfield_gc(p4, i20, descr=<.* .*W_AbstractSeqIterObject.inst_index .*>)
guard_not_invalidated?
+ i21 = force_token()
i95 = int_sub(i9, 1)
i23 = int_lt(i18, 0)
guard_false(i23, descr=...)
diff --git a/pypy/module/pypyjit/test_pypy_c/test_weakref.py b/pypy/module/pypyjit/test_pypy_c/test_weakref.py
--- a/pypy/module/pypyjit/test_pypy_c/test_weakref.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_weakref.py
@@ -23,12 +23,8 @@
i60 = int_lt(i58, i31)
guard_true(i60, descr=...)
i61 = int_add(i58, 1)
- p62 = getfield_gc_r(ConstPtr(ptr37), descr=<FieldP pypy.objspace.std.dictmultiobject.W_DictMultiObject.inst_strategy \d+>)
setfield_gc(p18, i61, descr=<FieldS pypy.module.__builtin__.functional.W_XRangeIterator.inst_current 8>)
- guard_value(p62, ConstPtr(ptr39), descr=...)
guard_not_invalidated(descr=...)
- p64 = getfield_gc_r(ConstPtr(ptr40), descr=<FieldP pypy.objspace.std.dictmultiobject.W_DictMultiObject.inst_strategy \d+>)
- guard_value(p64, ConstPtr(ptr42), descr=...)
p65 = getfield_gc_r(p14, descr=<FieldP pypy.objspace.std.mapdict.W_ObjectObjectSize5.inst_map \d+>)
guard_value(p65, ConstPtr(ptr45), descr=...)
p66 = getfield_gc_r(p14, descr=<FieldP pypy.objspace.std.mapdict.W_ObjectObjectSize5.inst__value0 \d+>)
More information about the pypy-commit
mailing list