Commits

Daniel Roberts committed bc1f407

Cleaning up a bit.

  • Participants
  • Parent commits 76b1630
  • Branches fold_intadd

Comments (0)

Files changed (1)

File pypy/jit/metainterp/optimizeopt/fold_intadd.py

                 func(self, op)
                 break
         else:
-            #self.optimize_default(op)
             self.emit_operation(op)
 
     def _int_operation(self, variable, constant, result):
         if lv.is_constant() and rv.is_constant():
             self.emit_operation(op) # XXX: there's support for optimizing this elsewhere, right?
         elif lv.is_constant():
-            #constant = lv.box.getint()
-            #self._process_add(op.getarg(1), constant, result)
-            # TODO: implement
+            # TODO: implement?
             self.emit_operation(op)
         elif rv.is_constant():
             constant = rv.box.getint()
         else:
             self.emit_operation(op)
 
-    def optimize_default(self, op):
-        for i in range(op.numargs()):
-            arg = self.getvalue(op.getarg(i))
-            if arg.is_constant():
-                continue
-
-            try:
-                variable = op.getarg(i)
-                root, constant = self.args[variable]
-
-                new_op = self._int_operation(root, constant, variable)
-                self.emit_operation(new_op)
-            except KeyError:
-                pass
-        self.emit_operation(op)
-
-
 optimize_ops = _findall(OptAddition, 'optimize_')