[pypy-svn] r56096 - pypy/branch/async-del/pypy/interpreter
arigo at codespeak.net
arigo at codespeak.net
Thu Jun 26 21:44:25 CEST 2008
Author: arigo
Date: Thu Jun 26 21:44:25 2008
New Revision: 56096
Modified:
pypy/branch/async-del/pypy/interpreter/executioncontext.py
Log:
Small optimizations for the case where we don't use tracing.
Modified: pypy/branch/async-del/pypy/interpreter/executioncontext.py
==============================================================================
--- pypy/branch/async-del/pypy/interpreter/executioncontext.py (original)
+++ pypy/branch/async-del/pypy/interpreter/executioncontext.py Thu Jun 26 21:44:25 2008
@@ -106,11 +106,13 @@
def call_trace(self, frame):
"Trace the call of a function"
- self._trace(frame, 'call', self.space.w_None)
+ if self.w_tracefunc is not None or self.profilefunc is not None:
+ self._trace(frame, 'call', self.space.w_None)
def return_trace(self, frame, w_retval):
"Trace the return from a function"
- self._trace(frame, 'return', w_retval)
+ if self.w_tracefunc is not None:
+ self._trace(frame, 'return', w_retval)
def bytecode_trace(self, frame):
"Trace function called before each bytecode."
@@ -128,8 +130,8 @@
def exception_trace(self, frame, operationerr):
"Trace function called upon OperationError."
operationerr.record_interpreter_traceback()
- space = self.space
- self._trace(frame, 'exception', None, operationerr)
+ if self.w_tracefunc is not None:
+ self._trace(frame, 'exception', None, operationerr)
#operationerr.print_detailed_traceback(self.space)
def sys_exc_info(self): # attn: the result is not the wrapped sys.exc_info() !!!
More information about the Pypy-commit
mailing list