[pypy-svn] r22401 - pypy/branch/arre-experiments/pypy/interpreter

ac at codespeak.net ac at codespeak.net
Wed Jan 18 23:02:59 CET 2006


Author: ac
Date: Wed Jan 18 23:02:58 2006
New Revision: 22401

Modified:
   pypy/branch/arre-experiments/pypy/interpreter/argument.py
   pypy/branch/arre-experiments/pypy/interpreter/function.py
   pypy/branch/arre-experiments/pypy/interpreter/pyopcode.py
Log:
Bugfixes.

Modified: pypy/branch/arre-experiments/pypy/interpreter/argument.py
==============================================================================
--- pypy/branch/arre-experiments/pypy/interpreter/argument.py	(original)
+++ pypy/branch/arre-experiments/pypy/interpreter/argument.py	Wed Jan 18 23:02:58 2006
@@ -187,7 +187,7 @@
                               (co_argcount, has_vararg, has_kwarg),
                               defaults_w, co_argcount - blindargs -
                               self.nargs - len(defaults_w))
-        if self.nargs > co_argcount and has_vararg:
+        if blindargs + self.nargs > co_argcount and not has_vararg:
             raise ArgErrCount(blindargs + self.nargs, 0,
                               (co_argcount, has_vararg, has_kwarg),
                               defaults_w, 0)

Modified: pypy/branch/arre-experiments/pypy/interpreter/function.py
==============================================================================
--- pypy/branch/arre-experiments/pypy/interpreter/function.py	(original)
+++ pypy/branch/arre-experiments/pypy/interpreter/function.py	Wed Jan 18 23:02:58 2006
@@ -36,12 +36,13 @@
         frame = self.code.create_frame(self.space, self.w_func_globals,
                                        self.closure)
         sig = self.code.signature()
+        # XXX start of hack for performance
         if (isinstance(frame, PyFrame) and
             frame.setfastscope is PyFrame.setfastscope):
-            # XXX: Performance hack!
             args_matched = args.parse_into_scope(frame.fastlocals_w, self.name,
                                                  sig, self.defs_w)
             frame.init_cells(args_matched)
+        # XXX end of hack for performance
         else:
             scope_w = args.parse(self.name, sig, self.defs_w)
             frame.setfastscope(scope_w)

Modified: pypy/branch/arre-experiments/pypy/interpreter/pyopcode.py
==============================================================================
--- pypy/branch/arre-experiments/pypy/interpreter/pyopcode.py	(original)
+++ pypy/branch/arre-experiments/pypy/interpreter/pyopcode.py	Wed Jan 18 23:02:58 2006
@@ -679,7 +679,7 @@
             w_function = f.valuestack.pop()
             w_result = f.space.call_function(w_function, w_arg1, w_arg2, w_arg3)
             f.valuestack.push(w_result)
-        elif False and (oparg >> 8) & 0xff == 0:
+        elif (oparg >> 8) & 0xff == 0:
             # Only positional arguments
             nargs = oparg & 0xff
             args = ArgumentsFromValuestack(f.space, f.valuestack, nargs)



More information about the Pypy-commit mailing list