[pypy-svn] r76065 - pypy/branch/kill-caninline/pypy/jit/backend/llgraph

arigo at codespeak.net arigo at codespeak.net
Fri Jul 9 12:35:03 CEST 2010


Author: arigo
Date: Fri Jul  9 12:35:02 2010
New Revision: 76065

Modified:
   pypy/branch/kill-caninline/pypy/jit/backend/llgraph/llimpl.py
Log:
Fix the llgraph backend: there is a case in which
self.loop.operations becomes different from operations.
Fixed by killing the local vars and only using the self.*
version.


Modified: pypy/branch/kill-caninline/pypy/jit/backend/llgraph/llimpl.py
==============================================================================
--- pypy/branch/kill-caninline/pypy/jit/backend/llgraph/llimpl.py	(original)
+++ pypy/branch/kill-caninline/pypy/jit/backend/llgraph/llimpl.py	Fri Jul  9 12:35:02 2010
@@ -421,11 +421,9 @@
         global _last_exception
         assert _last_exception is None, "exception left behind"
         verbose = True
-        operations = self.loop.operations
-        opindex = 0
+        self.opindex = 0
         while True:
-            self.opindex = opindex
-            op = operations[opindex]
+            op = self.loop.operations[self.opindex]
             args = [self.getenv(v) for v in op.args]
             if not op.is_final():
                 try:
@@ -439,8 +437,8 @@
                         args = [self.getenv(v) for v in op.fail_args if v]
                         assert len(op.jump_target.inputargs) == len(args)
                         self.env = dict(zip(op.jump_target.inputargs, args))
-                        operations = op.jump_target.operations
-                        opindex = 0
+                        self.loop = op.jump_target
+                        self.opindex = 0
                         continue
                     else:
                         self._populate_fail_args(op)
@@ -465,14 +463,13 @@
                         raise Exception("op.result.concretetype is %r"
                                         % (RESTYPE,))
                     self.env[op.result] = x
-                opindex += 1
+                self.opindex += 1
                 continue
             if op.opnum == rop.JUMP:
                 assert len(op.jump_target.inputargs) == len(args)
                 self.env = dict(zip(op.jump_target.inputargs, args))
                 self.loop = op.jump_target
-                operations = self.loop.operations
-                opindex = 0
+                self.opindex = 0
                 _stats.exec_jumps += 1
             elif op.opnum == rop.FINISH:
                 if self.verbose:



More information about the Pypy-commit mailing list