[pypy-commit] pypy store-sink-array: Kill for now support for variable index in setarrayitem_gc in heap.py.
arigo
noreply at buildbot.pypy.org
Sun Jun 19 19:52:40 CEST 2011
Author: Armin Rigo <arigo at tunes.org>
Branch: store-sink-array
Changeset: r45014:497c4512ee97
Date: 2011-06-19 18:38 +0200
http://bitbucket.org/pypy/pypy/changeset/497c4512ee97/
Log: Kill for now support for variable index in setarrayitem_gc in
heap.py.
diff --git a/pypy/jit/metainterp/optimizeopt/heap.py b/pypy/jit/metainterp/optimizeopt/heap.py
--- a/pypy/jit/metainterp/optimizeopt/heap.py
+++ b/pypy/jit/metainterp/optimizeopt/heap.py
@@ -103,8 +103,6 @@
class CachedArrayItems(object):
def __init__(self):
self.fixed_index_items = {}
- self.var_index_item = None
- self.var_index_indexvalue = None
class BogusPureField(JitException):
pass
@@ -140,12 +138,6 @@
for value, cache in d.items():
newcache = CachedArrayItems()
newd[value.get_reconstructed(optimizer, valuemap)] = newcache
- if cache.var_index_item:
- newcache.var_index_item = \
- cache.var_index_item.get_reconstructed(optimizer, valuemap)
- if cache.var_index_indexvalue:
- newcache.var_index_indexvalue = \
- cache.var_index_indexvalue.get_reconstructed(optimizer, valuemap)
for index, fieldvalue in cache.fixed_index_items.items():
newcache.fixed_index_items[index] = \
fieldvalue.get_reconstructed(optimizer, valuemap)
@@ -178,8 +170,6 @@
for value, othercache in d.iteritems():
# fixed index, clean the variable index cache, in case the
# index is the same
- othercache.var_index_indexvalue = None
- othercache.var_index_item = None
try:
del othercache.fixed_index_items[index]
except KeyError:
@@ -189,11 +179,7 @@
if write:
for value, othercache in d.iteritems():
# variable index, clear all caches for this descr
- othercache.var_index_indexvalue = None
- othercache.var_index_item = None
othercache.fixed_index_items.clear()
- cache.var_index_indexvalue = indexvalue
- cache.var_index_item = fieldvalue
def read_cached_arrayitem(self, descr, value, indexvalue):
d = self.cached_arrayitems.get(descr, None)
@@ -205,8 +191,6 @@
indexbox = self.get_constant_box(indexvalue.box)
if indexbox is not None:
return cache.fixed_index_items.get(indexbox.getint(), None)
- elif cache.var_index_indexvalue is indexvalue:
- return cache.var_index_item
return None
def emit_operation(self, op):
diff --git a/pypy/jit/metainterp/optimizeopt/test/test_optimizebasic.py b/pypy/jit/metainterp/optimizeopt/test/test_optimizebasic.py
--- a/pypy/jit/metainterp/optimizeopt/test/test_optimizebasic.py
+++ b/pypy/jit/metainterp/optimizeopt/test/test_optimizebasic.py
@@ -1612,6 +1612,7 @@
self.optimize_loop(ops, expected)
def test_duplicate_getarrayitem_after_setarrayitem_2(self):
+ py.test.skip("setarrayitem with variable index")
ops = """
[p1, p2, p3, i1]
setarrayitem_gc(p1, 0, p2, descr=arraydescr2)
diff --git a/pypy/jit/metainterp/optimizeopt/test/test_optimizeopt.py b/pypy/jit/metainterp/optimizeopt/test/test_optimizeopt.py
--- a/pypy/jit/metainterp/optimizeopt/test/test_optimizeopt.py
+++ b/pypy/jit/metainterp/optimizeopt/test/test_optimizeopt.py
@@ -2055,6 +2055,7 @@
self.optimize_loop(ops, expected)
def test_duplicate_getarrayitem_after_setarrayitem_2(self):
+ py.test.skip("setarrayitem with variable index")
ops = """
[p1, p2, p3, i1]
setarrayitem_gc(p1, 0, p2, descr=arraydescr2)
More information about the pypy-commit
mailing list