Commits

Maciej Fijalkowski committed 97c7263

invent new descrs only for labels

  • Participants
  • Parent commits 6ee1610
  • Branches better-jit-hooks

Comments (0)

Files changed (2)

File pypy/jit/tool/oparser.py

                 assert typ == 'class'
                 return self.model.ConstObj(ootype.cast_to_object(obj))
 
-    def get_descr(self, poss_descr):
+    def get_descr(self, poss_descr, allow_invent):
         if poss_descr.startswith('<'):
             return None
         try:
             return self._consts[poss_descr]
         except KeyError:
-            int(poss_descr)
-            token = self.model.JitCellToken()
-            tt = self.model.TargetToken(token)
-            self._consts[poss_descr] = tt
-            return tt
+            if allow_invent:
+                int(poss_descr)
+                token = self.model.JitCellToken()
+                tt = self.model.TargetToken(token)
+                self._consts[poss_descr] = tt
+                return tt
 
     def box_for_var(self, elem):
         try:
 
             poss_descr = allargs[-1].strip()
             if poss_descr.startswith('descr='):
-                descr = self.get_descr(poss_descr[len('descr='):])
+                descr = self.get_descr(poss_descr[len('descr='):],
+                                       opname == 'label')
                 allargs = allargs[:-1]
             for arg in allargs:
                 arg = arg.strip()

File pypy/jit/tool/oparser_model.py

         class JitCellToken(object):
             I_am_a_descr = True
 
+        class TargetToken(object):
+            def __init__(self, jct):
+                pass
+
         class BasicFailDescr(object):
             I_am_a_descr = True