[pypy-svn] r69501 - in pypy/branch/compress-virtuals-resumedata/pypy/jit/metainterp: . test
pedronis at codespeak.net
pedronis at codespeak.net
Sun Nov 22 16:33:38 CET 2009
Author: pedronis
Date: Sun Nov 22 16:33:37 2009
New Revision: 69501
Modified:
pypy/branch/compress-virtuals-resumedata/pypy/jit/metainterp/resume.py
pypy/branch/compress-virtuals-resumedata/pypy/jit/metainterp/test/test_virtual.py
Log:
failing test about inputargs/holes interaction
Modified: pypy/branch/compress-virtuals-resumedata/pypy/jit/metainterp/resume.py
==============================================================================
--- pypy/branch/compress-virtuals-resumedata/pypy/jit/metainterp/resume.py (original)
+++ pypy/branch/compress-virtuals-resumedata/pypy/jit/metainterp/resume.py Sun Nov 22 16:33:37 2009
@@ -307,12 +307,14 @@
for box, tagged in self.liveboxes.iteritems():
i, tagbits = untag(tagged)
if tagbits == TAGBOX:
+ assert box not in self.liveboxes_from_env
assert tagged_eq(tagged, UNASSIGNED)
index = memo.assign_number_to_box(box, new_liveboxes)
self.liveboxes[box] = tag(index, TAGBOX)
else:
assert tagbits == TAGVIRTUAL
if tagged_eq(tagged, UNASSIGNEDVIRTUAL):
+ assert box not in self.liveboxes_from_env
index = memo.assign_number_to_virtual(box)
self.liveboxes[box] = tag(index, TAGVIRTUAL)
new_liveboxes.reverse()
Modified: pypy/branch/compress-virtuals-resumedata/pypy/jit/metainterp/test/test_virtual.py
==============================================================================
--- pypy/branch/compress-virtuals-resumedata/pypy/jit/metainterp/test/test_virtual.py (original)
+++ pypy/branch/compress-virtuals-resumedata/pypy/jit/metainterp/test/test_virtual.py Sun Nov 22 16:33:37 2009
@@ -304,6 +304,8 @@
# ENTER - compile the leaving path
self.check_enter_count(4)
+class VirtualMiscTests:
+
def test_guards_around_forcing(self):
class A(object):
def __init__(self, x):
@@ -329,6 +331,28 @@
return 0
self.meta_interp(f, [50])
+ def test_guards_and_holes(self):
+ class A(object):
+ def __init__(self, x):
+ self.x = x
+ mydriver = JitDriver(reds = ['n', 'tot'], greens = [])
+
+ def f(n):
+ tot = 0
+ while n > 0:
+ mydriver.can_enter_jit(n=n, tot=tot)
+ mydriver.jit_merge_point(n=n, tot=tot)
+ a = A(n)
+ b = A(n+1)
+ if n % 9 == 0:
+ tot += (a.x + b.x) % 3
+ c = A(n+1)
+ if n % 10 == 0:
+ tot -= (c.x + a.x) % 3
+ n -= 1
+ return tot
+ self.meta_interp(f, [70])
+
# ____________________________________________________________
# Run 1: all the tests instantiate a real RPython class
@@ -434,3 +458,11 @@
p = lltype.malloc(NODE2)
p.parent.typeptr = vtable2
return p
+
+# misc
+
+class TestOOTypeMisc(VirtualMiscTests, OOJitMixin):
+ pass
+
+class TestLLTypeMisc(VirtualMiscTests, LLJitMixin):
+ pass
More information about the Pypy-commit
mailing list