[pypy-svn] r77135 - in pypy/branch/resoperation-refactoring/pypy/jit/metainterp: . optimizeopt

antocuni at codespeak.net antocuni at codespeak.net
Fri Sep 17 14:50:16 CEST 2010


Author: antocuni
Date: Fri Sep 17 14:50:14 2010
New Revision: 77135

Modified:
   pypy/branch/resoperation-refactoring/pypy/jit/metainterp/optimizeopt/intbounds.py
   pypy/branch/resoperation-refactoring/pypy/jit/metainterp/optimizeopt/rewrite.py
   pypy/branch/resoperation-refactoring/pypy/jit/metainterp/pyjitpl.py
Log:
(david, antocuni): remove all the remaining references to _opnum


Modified: pypy/branch/resoperation-refactoring/pypy/jit/metainterp/optimizeopt/intbounds.py
==============================================================================
--- pypy/branch/resoperation-refactoring/pypy/jit/metainterp/optimizeopt/intbounds.py	(original)
+++ pypy/branch/resoperation-refactoring/pypy/jit/metainterp/optimizeopt/intbounds.py	Fri Sep 17 14:50:14 2010
@@ -86,9 +86,9 @@
         if resbound.has_lower and resbound.has_upper and \
            self.nextop().getopnum() == rop.GUARD_NO_OVERFLOW:
             # Transform into INT_ADD and remove guard
-            op._opnum = rop.INT_ADD
+            op = op.copy_and_change(rop.INT_ADD)
             self.skip_nextop()
-            self.optimize_INT_ADD(op)
+            self.optimize_INT_ADD(op) # emit the op
         else:
             self.emit_operation(op)
             r = self.getvalue(op.result)
@@ -101,9 +101,9 @@
         if resbound.has_lower and resbound.has_upper and \
                self.nextop().getopnum() == rop.GUARD_NO_OVERFLOW:
             # Transform into INT_SUB and remove guard
-            op._opnum = rop.INT_SUB
+            op = op.copy_and_change(rop.INT_SUB)
             self.skip_nextop()
-            self.optimize_INT_SUB(op)
+            self.optimize_INT_SUB(op) # emit the op
         else:
             self.emit_operation(op)
             r = self.getvalue(op.result)
@@ -116,9 +116,9 @@
         if resbound.has_lower and resbound.has_upper and \
                self.nextop().getopnum() == rop.GUARD_NO_OVERFLOW:
             # Transform into INT_MUL and remove guard
-            op._opnum = rop.INT_MUL
+            op = op.copy_and_change(rop.INT_MUL)
             self.skip_nextop()
-            self.optimize_INT_MUL(op)
+            self.optimize_INT_MUL(op) # emit the op
         else:
             self.emit_operation(op)
             r = self.getvalue(op.result)

Modified: pypy/branch/resoperation-refactoring/pypy/jit/metainterp/optimizeopt/rewrite.py
==============================================================================
--- pypy/branch/resoperation-refactoring/pypy/jit/metainterp/optimizeopt/rewrite.py	(original)
+++ pypy/branch/resoperation-refactoring/pypy/jit/metainterp/optimizeopt/rewrite.py	Fri Sep 17 14:50:14 2010
@@ -253,7 +253,7 @@
             return
         # change the op to be a normal call, from the backend's point of view
         # there is no reason to have a separate operation for this
-        op._opnum = rop.CALL
+        op = op.copy_and_change(rop.CALL)
         self.emit_operation(op)
         resvalue = self.getvalue(op.result)
         self.optimizer.loop_invariant_results[key] = resvalue

Modified: pypy/branch/resoperation-refactoring/pypy/jit/metainterp/pyjitpl.py
==============================================================================
--- pypy/branch/resoperation-refactoring/pypy/jit/metainterp/pyjitpl.py	(original)
+++ pypy/branch/resoperation-refactoring/pypy/jit/metainterp/pyjitpl.py	Fri Sep 17 14:50:14 2010
@@ -2100,9 +2100,8 @@
             return resbox_as_const
         # not all constants (so far): turn CALL into CALL_PURE, which might
         # be either removed later by optimizeopt or turned back into CALL.
-        op._opnum = rop.CALL_PURE
-        # XXX XXX replace when the resoperation refactoring has been finished
-        op._args = [resbox_as_const] + op._args
+        newop = op.copy_and_change(rop.CALL_PURE, args=[resbox_as_const]+op.getarglist())
+        self.history.operations[-1] = newop
         return resbox
 
     def direct_assembler_call(self, targetjitdriver_sd):
@@ -2124,9 +2123,7 @@
             # ^^^ and not "+=", which makes 'args' a resizable list
         warmrunnerstate = targetjitdriver_sd.warmstate
         token = warmrunnerstate.get_assembler_token(greenargs, args)
-        op._opnum = rop.CALL_ASSEMBLER
-        op.setarglist(args)
-        op.descr = token
+        op = op.copy_and_change(rop.CALL_ASSEMBLER, args=args, descr=token)
         self.history.operations.append(op)
 
 # ____________________________________________________________



More information about the Pypy-commit mailing list