Commits

Maciej Fijalkowski  committed 04f3b0f

fix fix fix

  • Participants
  • Parent commits 4db1084
  • Branches result-in-resops

Comments (0)

Files changed (2)

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

                                         arg1=op.getarg(0))
             oldop = self.get_pure_result(key_op)
             if oldop is not None and oldop.getdescr() is op.getdescr():
-                self.replace(op, oldop)
+                self.optimizer.replace(op, oldop)
                 return True
 
         oldopnum = opboolinvers[opboolreflex[op.getopnum()]]
         v1 = self.getvalue(op.getarg(0))
         v2 = self.getvalue(op.getarg(1))
         if v1.is_null():
-            self.replace(op, op.getarg(1))
+            self.optimizer.replace(op, op.getarg(1))
         elif v2.is_null():
-            self.replace(op, op.getarg(0))
+            self.optimizer.replace(op, op.getarg(0))
         else:
             self.emit_operation(op)
 
     def optimize_INT_SUB(self, op):
         v2 = self.getforwarded(op.getarg(1))
         if v2.is_constant() and v2.getint() == 0:
-            self.replace(op, op.getarg(0))
+            self.optimizer.replace(op, op.getarg(0))
         else:
             # Synthesize the reverse ops for optimize_default to reuse
             self.pure(op.getarg(0), rop.INT_ADD, op.getarg(1), op)
 
         # If one side of the op is 0 the result is the other side.
         if v1.is_constant() and v1.getint() == 0:
-            self.replace(op, arg2)
+            self.optimizer.replace(op, arg2)
         elif v2.is_constant() and v2.getint() == 0:
-            self.replace(op, arg1)
+            self.optimizer.replace(op, arg1)
         else:
             # Synthesize the reverse op for optimize_default to reuse
             self.pure(op.getarg(0), rop.INT_SUB, op, op.getarg(1))
 
             if v1.is_constant():
                 if v1.op.getfloat() == 1.0:
-                    self.replace(op, rhs)
+                    self.optimizer.replace(op, rhs)
                     return
                 elif v1.op.getfloat() == -1.0:
                     new_op = create_resop_1(rop.FLOAT_NEG, 0.0, rhs)
-                    self.replace(op, new_op)
+                    self.optimizer.replace(op, new_op)
                     self.emit_operation(new_op)
                     return
         self.emit_operation(op)
 
             resop = self.loop_invariant_results.get(key, None)
             if resop is not None:
-                self.replace(op, resop)
+                self.optimizer.replace(op, resop)
                 self.last_emitted_operation = REMOVED
                 return
             # change the op to be a normal call, from the backend's point of view
 
     def optimize_INT_IS_TRUE(self, op):
         if op.getarg(0).returns_bool_result():
-            self.replace(op, op.getarg(0))
+            self.optimizer.replace(op, op.getarg(0))
             return
         return self._optimize_nullness(op, op.getarg(0), True)
 

File pypy/jit/metainterp/optimizeopt/test/test_optimizebasic.py

     def test_ooisnull_oononnull_1(self):
         ops = """
         [p0]
-        guard_class(p0, ConstClass(node_vtable)) []
-        guard_nonnull(p0) []
+        guard_class(p0, ConstClass(node_vtable))
+        guard_nonnull(p0)
         jump(p0)
         """
         expected = """
         [p0]
-        guard_class(p0, ConstClass(node_vtable)) []
+        guard_class(p0, ConstClass(node_vtable))
         jump(p0)
         """
         self.optimize_loop(ops, expected)