Author: Alex Gaynor <[email protected]>
Branch: logging-perf
Changeset: r64548:6d3b4aaf4678
Date: 2013-05-24 14:41 -0400
http://bitbucket.org/pypy/pypy/changeset/6d3b4aaf4678/

Log:    Now it's also possible to access the top JIT'd frame "for free"

diff --git a/pypy/module/sys/vm.py b/pypy/module/sys/vm.py
--- a/pypy/module/sys/vm.py
+++ b/pypy/module/sys/vm.py
@@ -41,6 +41,16 @@
             return space.wrap(f)
         depth -= 1
         f = ec.getnextframe_nohidden(f)
+
+    if f is None:
+        raise OperationError(space.w_ValueError,
+                             space.wrap("call stack is not deep enough"))
+    if depth == 0:
+        f.mark_as_escaped()
+        return space.wrap(f)
+    depth -= 1
+    f = ec.getnextframe_nohidden(f)
+
     return getframe_fallback(space, ec, depth, f)
 
 
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to