[pypy-svn] r16092 - in pypy/dist/pypy: interpreter module/__builtin__ translator

tismer at codespeak.net tismer at codespeak.net
Tue Aug 16 00:23:00 CEST 2005


Author: tismer
Date: Tue Aug 16 00:22:53 2005
New Revision: 16092

Modified:
   pypy/dist/pypy/interpreter/argument.py
   pypy/dist/pypy/module/__builtin__/app_functional.py
   pypy/dist/pypy/translator/geninterplevel.py
Log:
undid changes to argument.py
enabled app_functional for geninterp
changed geninterp to pass a proper shape to fromshape
that contains a list and no tuple second argument

Thanks to Samuele for the hint!

Remark: geninterp seems to have pretty low effect
(some more than 10%) now. Raw interpretation of code
objects seems to be quite close to executing generated code.
This might change,again, when we waste less time with refcounting
and tiny access functions all ovr the place...

Modified: pypy/dist/pypy/interpreter/argument.py
==============================================================================
--- pypy/dist/pypy/interpreter/argument.py	(original)
+++ pypy/dist/pypy/interpreter/argument.py	Tue Aug 16 00:22:53 2005
@@ -243,8 +243,6 @@
         args_w = data_w[:shape_cnt]
         p = shape_cnt
         kwds_w = {}
-        shape_keys = list(shape_keys) # XXX seems to be needed by the rtyper
-        # this showed up when I temporarily enabled geninterp
         for i in range(len(shape_keys)):
             kwds_w[shape_keys[i]] = data_w[p]
             p += 1

Modified: pypy/dist/pypy/module/__builtin__/app_functional.py
==============================================================================
--- pypy/dist/pypy/module/__builtin__/app_functional.py	(original)
+++ pypy/dist/pypy/module/__builtin__/app_functional.py	Tue Aug 16 00:22:53 2005
@@ -1,5 +1,3 @@
-# NOT_RPYTHON because it triggers an annotator error in fromshape
-# otherwise it could be geninterped.
 """
 Plain Python definition of the builtin functions oriented towards
 functional programming.
@@ -156,11 +154,11 @@
             stop = y
 
     if not isinstance(start, (int, long)):
-        raise TypeError('range() interger start argument expected, got %s' % type(start))
+        raise TypeError('range() integer start argument expected, got %s' % type(start))
     if not isinstance(stop, (int, long)):
-        raise TypeError('range() interger stop argument expected, got %s' % type(stop))
+        raise TypeError('range() integer stop argument expected, got %s' % type(stop))
     if not isinstance(step, (int, long)):
-        raise TypeError('range() interger step argument expected, got %s' % type(step))
+        raise TypeError('range() integer step argument expected, got %s' % type(step))
 
     if step == 0:
         raise ValueError, 'range() arg 3 must not be zero'

Modified: pypy/dist/pypy/translator/geninterplevel.py
==============================================================================
--- pypy/dist/pypy/translator/geninterplevel.py	(original)
+++ pypy/dist/pypy/translator/geninterplevel.py	Tue Aug 16 00:22:53 2005
@@ -264,6 +264,8 @@
                 "%(res)s = space.call_args(%(func)s, _args)")
             assert isinstance(op.args[1], Constant)
             shape = op.args[1].value
+            # make a list out of the second shape elt.
+            shape = shape[0], list(shape[1]), shape[2], shape[3]
             return fmt % {"res": self.expr(op.result, localscope),
                           "func": exv,
                           "shape": repr(shape),



More information about the Pypy-commit mailing list