Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r47242:5809fd22dee2
Date: 2011-09-13 10:56 +0200
http://bitbucket.org/pypy/pypy/changeset/5809fd22dee2/

Log:    Performance issue: reading the f_back attribute at app-level would
        now force its result. Thanks fijal for spotting it!

diff --git a/pypy/interpreter/executioncontext.py 
b/pypy/interpreter/executioncontext.py
--- a/pypy/interpreter/executioncontext.py
+++ b/pypy/interpreter/executioncontext.py
@@ -48,6 +48,7 @@
         return frame
 
     @staticmethod
+    @jit.unroll_safe  # should usually loop 0 times, very rarely more than once
     def getnextframe_nohidden(frame):
         frame = frame.f_backref()
         while frame and frame.hide():
diff --git a/pypy/interpreter/pyframe.py b/pypy/interpreter/pyframe.py
--- a/pypy/interpreter/pyframe.py
+++ b/pypy/interpreter/pyframe.py
@@ -614,8 +614,8 @@
         return self.get_builtin().getdict(space)
 
     def fget_f_back(self, space):
-        f_backref = ExecutionContext.getnextframe_nohidden(self)
-        return self.space.wrap(f_backref)
+        f_back = ExecutionContext.getnextframe_nohidden(self)
+        return self.space.wrap(f_back)
 
     def fget_f_lasti(self, space):
         return self.space.wrap(self.last_instr)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to