Source

pypy / pypy / translator / backendopt / storesink.py

Diff from to

pypy/translator/backendopt/storesink.py

 
 from pypy.rpython.lltypesystem.lloperation import llop
 from pypy.translator.backendopt import removenoops
-from pypy.objspace.flow.model import SpaceOperation
 
 def has_side_effects(op):
     if op.opname == 'debug_assert':
     for block in graph.iterblocks():
         newops = []
         cache = {}
-        for i, op in enumerate(block.operations):
+        for op in block.operations:
             if op.opname == 'getfield':
                 tup = (op.args[0], op.args[1].value)
                 res = cache.get(tup, None)
                 if res is not None:
-                    op = SpaceOperation('same_as', [res], op.result, i)
+                    op.opname = 'same_as'
+                    op.args = [res]
                     added_some_same_as = True
                 else:
                     cache[tup] = op.result