[pypy-svn] r65370 - pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp

fijal at codespeak.net fijal at codespeak.net
Sat May 23 19:22:01 CEST 2009


Author: fijal
Date: Sat May 23 19:22:00 2009
New Revision: 65370

Modified:
   pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/optimize2.py
Log:
kill all optimizations for now, will try to readd them in a modular manner


Modified: pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/optimize2.py
==============================================================================
--- pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/optimize2.py	(original)
+++ pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/optimize2.py	Sat May 23 19:22:00 2009
@@ -87,45 +87,9 @@
         newoperations = []
         for op in self.loop.operations:
             if op.is_guard():
-                if op.opnum == rop.GUARD_NONVIRTUALIZED:
-                    continue
-                elif op.opnum == rop.GUARD_CLASS:
-                    node = self.getnode(op.args[0])
-                    if node.cls is not None:
-                        # assert that they're equal maybe
-                        continue
-                    node.cls = InstanceNode(op.args[1], const=True)
-                elif op.opnum == rop.GUARD_VALUE:
-                    instnode = self.nodes[op.args[0]]
-                    assert isinstance(op.args[1], Const)
-                    if instnode.const:
-                        continue
-                    self.optimize_guard(op)
-                    instnode.const = True
-                    instnode.source = op.args[0].constbox()
-                    newoperations.append(op)
-                    continue
                 self.optimize_guard(op)
                 newoperations.append(op)
                 continue
-            elif op.opnum == rop.GETFIELD_GC:
-                instnode = self.getnode(op.args[0])
-                descr = op.descr
-                node = instnode.cleanfields.get(descr, None)
-                if node is not None:
-                    self.nodes[op.result] = node
-                    continue
-                else:
-                    instnode.cleanfields[descr] = self.getnode(op.result)
-            elif op.opnum == rop.SETFIELD_GC:
-                instnode = self.getnode(op.args[0])
-                descr = op.descr
-                node = self.getnode(op.args[1])
-                instnode.dirtyfields[descr] = node
-                instnode.cleanfields[descr] = node
-                l = self.field_caches.setdefault(descr, [])
-                l.append((instnode, node))
-                continue
             # default handler
             op = op.clone()
             op.args = self.new_arguments(op)
@@ -140,19 +104,9 @@
                     instnode = InstanceNode(box.constbox(), const=True)
                     self.nodes[box] = instnode
                     continue
-            elif not op.has_no_side_effect():
-                self.clean_up_caches(newoperations)
             newoperations.append(op)
         print "Length of the loop:", len(newoperations)
         self.loop.operations = newoperations
-
-    def clean_up_caches(self, newoperations):
-        for descr, v in self.field_caches.iteritems():
-            for instnode, fieldnode in v:
-                newoperations.append(ResOperation(rop.SETFIELD_GC,
-                    [instnode.source, fieldnode.source], None, descr))
-                del instnode.cleanfields[descr]
-                del instnode.dirtyfields[descr]
     
     def optimize_loop(self, loop):
         self.nodes = {}



More information about the Pypy-commit mailing list