[pypy-svn] r56479 - pypy/branch/builtin-profiling/pypy/interpreter

antocuni at codespeak.net antocuni at codespeak.net
Sat Jul 12 11:33:44 CEST 2008


Author: antocuni
Date: Sat Jul 12 11:33:42 2008
New Revision: 56479

Modified:
   pypy/branch/builtin-profiling/pypy/interpreter/baseobjspace.py
   pypy/branch/builtin-profiling/pypy/interpreter/executioncontext.py
   pypy/branch/builtin-profiling/pypy/interpreter/function.py
   pypy/branch/builtin-profiling/pypy/interpreter/pyopcode.py
Log:
rpython fixes



Modified: pypy/branch/builtin-profiling/pypy/interpreter/baseobjspace.py
==============================================================================
--- pypy/branch/builtin-profiling/pypy/interpreter/baseobjspace.py	(original)
+++ pypy/branch/builtin-profiling/pypy/interpreter/baseobjspace.py	Sat Jul 12 11:33:42 2008
@@ -714,7 +714,7 @@
                     return w_res
                 except OperationError, e:
                     if is_c_call:
-                        ec.c_exception_trace(frame, e)
+                        ec.c_exception_trace(frame, e.w_value)
                     raise
             finally:
                 if isinstance(args, ArgumentsFromValuestack):

Modified: pypy/branch/builtin-profiling/pypy/interpreter/executioncontext.py
==============================================================================
--- pypy/branch/builtin-profiling/pypy/interpreter/executioncontext.py	(original)
+++ pypy/branch/builtin-profiling/pypy/interpreter/executioncontext.py	Sat Jul 12 11:33:42 2008
@@ -117,12 +117,12 @@
         else:
             self._trace(frame, 'c_return', w_retval)
 
-    def c_exception_trace(self, frame, operationerr):
+    def c_exception_trace(self, frame, w_exc):
         "Profile function called upon OperationError."
         if self.profilefunc is None:
             frame.is_being_profiled = False
         else:
-            self._trace(frame, 'c_exception', operationerr)
+            self._trace(frame, 'c_exception', w_exc)
 
     def _llprofile(self, event, w_arg):
         fr = self.framestack.items

Modified: pypy/branch/builtin-profiling/pypy/interpreter/function.py
==============================================================================
--- pypy/branch/builtin-profiling/pypy/interpreter/function.py	(original)
+++ pypy/branch/builtin-profiling/pypy/interpreter/function.py	Sat Jul 12 11:33:42 2008
@@ -506,7 +506,11 @@
 def is_builtin_code(w_func):
     from pypy.interpreter.gateway import BuiltinCode
     if isinstance(w_func, Method):
-        code = w_func.w_function.getcode()
+        w_f = w_func.w_function
+        assert isinstance(w_f, Function)
+        code = w_f.getcode()
     elif isinstance(w_func, Function):
         code = w_func.getcode()
+    else:
+        code = None
     return isinstance(code, BuiltinCode)

Modified: pypy/branch/builtin-profiling/pypy/interpreter/pyopcode.py
==============================================================================
--- pypy/branch/builtin-profiling/pypy/interpreter/pyopcode.py	(original)
+++ pypy/branch/builtin-profiling/pypy/interpreter/pyopcode.py	Sat Jul 12 11:33:42 2008
@@ -875,7 +875,7 @@
                 w_result = f.space.call_args(w_function, args)
             except OperationError, e:
                 if is_c_call:
-                    ec.c_exception_trace(f, e)
+                    ec.c_exception_trace(f, e.w_value)
                 raise
             if is_c_call:
                 ec.c_return_trace(f, w_function)



More information about the Pypy-commit mailing list