[pypy-svn] r76418 - in pypy/trunk/pypy: interpreter/astcompiler objspace/std

agaynor at codespeak.net agaynor at codespeak.net
Sat Jul 31 17:24:50 CEST 2010


Author: agaynor
Date: Sat Jul 31 17:24:48 2010
New Revision: 76418

Modified:
   pypy/trunk/pypy/interpreter/astcompiler/assemble.py
   pypy/trunk/pypy/objspace/std/callmethod.py
Log:
FIx CALL_FUNCTION and family effect on stack.

Modified: pypy/trunk/pypy/interpreter/astcompiler/assemble.py
==============================================================================
--- pypy/trunk/pypy/interpreter/astcompiler/assemble.py	(original)
+++ pypy/trunk/pypy/interpreter/astcompiler/assemble.py	Sat Jul 31 17:24:48 2010
@@ -566,22 +566,22 @@
     return (oparg % 256) + 2 * (oparg / 256)
 
 def _compute_CALL_FUNCTION(arg):
-    return _num_args(arg)
+    return -_num_args(arg)
 
 def _compute_CALL_FUNCTION_VAR(arg):
-    return _num_args(arg) - 1
+    return -_num_args(arg) - 1
 
 def _compute_CALL_FUNCTION_KW(arg):
-    return _num_args(arg) - 1
+    return -_num_args(arg) - 1
 
 def _compute_CALL_FUNCTION_VAR_KW(arg):
-    return _num_args(arg) - 2
+    return -_num_args(arg) - 2
 
 def _compute_CALL_LIKELY_BUILTIN(arg):
     return -(arg & 0xFF) + 1
 
 def _compute_CALL_METHOD(arg):
-    return _num_args(arg) - 1
+    return -_num_args(arg) - 1
 
 
 _stack_effect_computers = {}

Modified: pypy/trunk/pypy/objspace/std/callmethod.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/callmethod.py	(original)
+++ pypy/trunk/pypy/objspace/std/callmethod.py	Sat Jul 31 17:24:48 2010
@@ -12,7 +12,7 @@
 
 from pypy.interpreter import function
 from pypy.objspace.descroperation import object_getattribute
-from pypy.rlib import rstack # for resume points
+from pypy.rlib import jit, rstack # for resume points
 
 # This module exports two extra methods for StdObjSpaceFrame implementing
 # the LOOKUP_METHOD and CALL_METHOD opcodes in an efficient way, as well
@@ -56,6 +56,7 @@
     f.pushvalue(w_value)
     f.pushvalue(None)
 
+ at jit.unroll_safe
 def CALL_METHOD(f, oparg, *ignored):
     # opargs contains the arg, and kwarg count, excluding the implicit 'self'
     n_args = oparg & 0xff



More information about the Pypy-commit mailing list