Author: Carl Friedrich Bolz <[email protected]>
Branch:
Changeset: r47920:9afae5e2f69a
Date: 2011-10-10 13:16 +0200
http://bitbucket.org/pypy/pypy/changeset/9afae5e2f69a/
Log: merge
diff --git a/pypy/jit/metainterp/heapcache.py b/pypy/jit/metainterp/heapcache.py
--- a/pypy/jit/metainterp/heapcache.py
+++ b/pypy/jit/metainterp/heapcache.py
@@ -54,9 +54,10 @@
if box in self.new_boxes:
self.new_boxes[box] = False
if box in self.dependencies:
- for dep in self.dependencies[box]:
+ deps = self.dependencies[box]
+ del self.dependencies[box]
+ for dep in deps:
self._escape(dep)
- del self.dependencies[box]
def clear_caches(self, opnum, descr, argboxes):
if opnum == rop.SETFIELD_GC:
diff --git a/pypy/jit/metainterp/test/test_heapcache.py
b/pypy/jit/metainterp/test/test_heapcache.py
--- a/pypy/jit/metainterp/test/test_heapcache.py
+++ b/pypy/jit/metainterp/test/test_heapcache.py
@@ -355,6 +355,14 @@
assert not h.is_unescaped(box1)
assert not h.is_unescaped(box2)
+ def test_circular_virtuals(self):
+ h = HeapCache()
+ h.new(box1)
+ h.new(box2)
+ h.invalidate_caches(rop.SETFIELD_GC, None, [box1, box2])
+ h.invalidate_caches(rop.SETFIELD_GC, None, [box2, box1])
+ h.invalidate_caches(rop.SETFIELD_GC, None, [box3, box1]) # does not
crash
+
def test_unescaped_array(self):
h = HeapCache()
h.new_array(box1, lengthbox1)
@@ -362,4 +370,4 @@
h.invalidate_caches(rop.SETARRAYITEM_GC, None, [box1, index1, box2])
assert h.is_unescaped(box1)
h.invalidate_caches(rop.SETARRAYITEM_GC, None, [box2, index1, box1])
- assert not h.is_unescaped(box1)
\ No newline at end of file
+ assert not h.is_unescaped(box1)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit