Author: Hakan Ardo <ha...@debian.org>
Branch: jit-targets
Changeset: r48777:743a06937826
Date: 2011-11-05 10:23 +0100
http://bitbucket.org/pypy/pypy/changeset/743a06937826/

Log:    rename TARGET to LABEL

diff --git a/pypy/jit/metainterp/executor.py b/pypy/jit/metainterp/executor.py
--- a/pypy/jit/metainterp/executor.py
+++ b/pypy/jit/metainterp/executor.py
@@ -342,7 +342,7 @@
                          rop.SETARRAYITEM_RAW,
                          rop.CALL_RELEASE_GIL,
                          rop.QUASIIMMUT_FIELD,
-                         rop.TARGET,
+                         rop.LABEL,
                          ):      # list of opcodes never executed by pyjitpl
                 continue
             raise AssertionError("missing %r" % (key,))
diff --git a/pypy/jit/metainterp/history.py b/pypy/jit/metainterp/history.py
--- a/pypy/jit/metainterp/history.py
+++ b/pypy/jit/metainterp/history.py
@@ -790,7 +790,7 @@
         "NOT_RPYTHON"
         if self._inputargs is not None:
             return self._inputargs
-        assert self.operations[0].getopnum() == rop.TARGET
+        assert self.operations[0].getopnum() == rop.LABEL
         return self.operations[0].getarglist()
 
     def set_inputargs(self, inputargs):
@@ -829,7 +829,7 @@
 
     @staticmethod
     def check_consistency_of(operations):
-        assert operations[0].getopnum() == rop.TARGET
+        assert operations[0].getopnum() == rop.LABEL
         inputargs = operations[0].getarglist()
         seen = dict.fromkeys(inputargs)
         TreeLoop.check_consistency_of_branch(operations, seen)
@@ -858,13 +858,13 @@
                 assert isinstance(box, Box)
                 assert box not in seen
                 seen[box] = True
-            if op.getopnum() == rop.TARGET:
+            if op.getopnum() == rop.LABEL:
                 inputargs = op.getarglist()
                 for box in inputargs:
-                    assert isinstance(box, Box), "TARGET contains %r" % (box,)
+                    assert isinstance(box, Box), "LABEL contains %r" % (box,)
                 seen = dict.fromkeys(inputargs)
                 assert len(seen) == len(inputargs), (
-                    "duplicate Box in the TARGET arguments")
+                    "duplicate Box in the LABEL arguments")
                 
         assert operations[-1].is_final()
         if operations[-1].getopnum() == rop.JUMP:
diff --git a/pypy/jit/metainterp/optimizeopt/test/test_optimizeopt.py 
b/pypy/jit/metainterp/optimizeopt/test/test_optimizeopt.py
--- a/pypy/jit/metainterp/optimizeopt/test/test_optimizeopt.py
+++ b/pypy/jit/metainterp/optimizeopt/test/test_optimizeopt.py
@@ -95,22 +95,22 @@
         preamble.start_resumedescr = FakeDescr()
 
         token = LoopToken() # FIXME: Make this a MergePointToken?
-        preamble.operations = [ResOperation(rop.TARGET, inputargs, None, 
descr=TargetToken(token))] + \
+        preamble.operations = [ResOperation(rop.LABEL, inputargs, None, 
descr=TargetToken(token))] + \
                               operations +  \
-                              [ResOperation(rop.TARGET, jump_args, None, 
descr=TargetToken(token))]
+                              [ResOperation(rop.LABEL, jump_args, None, 
descr=TargetToken(token))]
         self._do_optimize_loop(preamble, call_pure_results)
 
         inliner = Inliner(inputargs, jump_args)
         loop.start_resumedescr = preamble.start_resumedescr
         loop.operations = [preamble.operations[-1]] + \
                           [inliner.inline_op(op, clone=False) for op in 
cloned_operations] + \
-                          [ResOperation(rop.TARGET, [inliner.inline_arg(a) for 
a in jump_args],
+                          [ResOperation(rop.LABEL, [inliner.inline_arg(a) for 
a in jump_args],
                                         None, descr=TargetToken(token))] 
                           #[inliner.inline_op(jumpop)]
 
         self._do_optimize_loop(loop, call_pure_results)
         extra_same_as = []
-        while loop.operations[0].getopnum() != rop.TARGET:
+        while loop.operations[0].getopnum() != rop.LABEL:
             extra_same_as.append(loop.operations[0])
             del loop.operations[0]
             
@@ -155,11 +155,11 @@
 
 def convert_old_style_to_targets(loop, jump):
     newloop = TreeLoop(loop.name)
-    newloop.operations = [ResOperation(rop.TARGET, loop.inputargs, None, 
descr=FakeDescr())] + \
+    newloop.operations = [ResOperation(rop.LABEL, loop.inputargs, None, 
descr=FakeDescr())] + \
                       loop.operations
     if not jump:
         assert newloop.operations[-1].getopnum() == rop.JUMP
-        newloop.operations[-1] = ResOperation(rop.TARGET, 
newloop.operations[-1].getarglist(), None, descr=FakeDescr())
+        newloop.operations[-1] = ResOperation(rop.LABEL, 
newloop.operations[-1].getarglist(), None, descr=FakeDescr())
     return newloop
 
 class OptimizeOptTest(BaseTestWithUnroll):
diff --git a/pypy/jit/metainterp/optimizeopt/unroll.py 
b/pypy/jit/metainterp/optimizeopt/unroll.py
--- a/pypy/jit/metainterp/optimizeopt/unroll.py
+++ b/pypy/jit/metainterp/optimizeopt/unroll.py
@@ -118,7 +118,7 @@
     def propagate_all_forward(self):
         loop = self.optimizer.loop
         start_targetop = loop.operations[0]
-        assert start_targetop.getopnum() == rop.TARGET
+        assert start_targetop.getopnum() == rop.LABEL
         loop.operations = loop.operations[1:]
         self.optimizer.clear_newoperations()
         self.optimizer.send_extra_operation(start_targetop)
@@ -126,15 +126,15 @@
         self.import_state(start_targetop)
         
         lastop = loop.operations[-1]
-        assert lastop.getopnum() == rop.TARGET
+        assert lastop.getopnum() == rop.LABEL
         loop.operations = loop.operations[:-1]
-        #if lastop.getopnum() == rop.TARGET or lastop.getopnum() == rop.JUMP:
+        #if lastop.getopnum() == rop.LABEL or lastop.getopnum() == rop.JUMP:
         #    loop.operations = loop.operations[:-1]
         #FIXME: FINISH
         
         self.optimizer.propagate_all_forward(clear=False)
         
-        #if lastop.getopnum() == rop.TARGET:
+        #if lastop.getopnum() == rop.LABEL:
         if not self.did_peel_one: # Enforce the previous behaviour of always 
peeling  exactly one iteration (for now)
             self.optimizer.flush()
             KillHugeIntBounds(self.optimizer).apply()
@@ -189,7 +189,7 @@
         assert isinstance(target_token, TargetToken)
         targetop.initarglist(inputargs)
         target_token.virtual_state = virtual_state
-        target_token.short_preamble = [ResOperation(rop.TARGET, 
short_inputargs, None)]
+        target_token.short_preamble = [ResOperation(rop.LABEL, 
short_inputargs, None)]
         target_token.exported_state = ExportedState(constant_inputargs, 
short_boxes,
                                                     inputarg_setup_ops, 
self.optimizer,
                                                     start_resumedescr)
@@ -276,7 +276,7 @@
         newoperations = self.optimizer.get_newoperations()
         self.boxes_created_this_iteration = {}
         i = j = 0
-        while newoperations[i].getopnum() != rop.TARGET:
+        while newoperations[i].getopnum() != rop.LABEL:
             i += 1
         while i < len(newoperations) or j < len(jumpargs):
             if i == len(newoperations):
diff --git a/pypy/jit/metainterp/optimizeopt/util.py 
b/pypy/jit/metainterp/optimizeopt/util.py
--- a/pypy/jit/metainterp/optimizeopt/util.py
+++ b/pypy/jit/metainterp/optimizeopt/util.py
@@ -148,7 +148,7 @@
                 assert op1.result.same_box(remap[op2.result])
         else:
             remap[op2.result] = op1.result
-        if op1.getopnum() not in (rop.JUMP, rop.TARGET):      # xxx obscure
+        if op1.getopnum() not in (rop.JUMP, rop.LABEL):      # xxx obscure
             assert op1.getdescr() == op2.getdescr()
         if op1.getfailargs() or op2.getfailargs():
             assert len(op1.getfailargs()) == len(op2.getfailargs())
diff --git a/pypy/jit/metainterp/resoperation.py 
b/pypy/jit/metainterp/resoperation.py
--- a/pypy/jit/metainterp/resoperation.py
+++ b/pypy/jit/metainterp/resoperation.py
@@ -366,7 +366,7 @@
     'FINISH/*d',
     '_FINAL_LAST',
 
-    'TARGET/*d',
+    'LABEL/*d',
 
     '_GUARD_FIRST',
     '_GUARD_FOLDABLE_FIRST',
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to