[pypy-svn] r35456 - in pypy/dist/pypy: config rpython rpython/test

mwh at codespeak.net mwh at codespeak.net
Thu Dec 7 20:37:05 CET 2006


Author: mwh
Date: Thu Dec  7 20:37:01 2006
New Revision: 35456

Modified:
   pypy/dist/pypy/config/translationoption.py
   pypy/dist/pypy/rpython/rpbc.py
   pypy/dist/pypy/rpython/test/test_rpbc.py
Log:
make withsmallfuncsets an IntOption


Modified: pypy/dist/pypy/config/translationoption.py
==============================================================================
--- pypy/dist/pypy/config/translationoption.py	(original)
+++ pypy/dist/pypy/config/translationoption.py	Thu Dec  7 20:37:01 2006
@@ -36,8 +36,9 @@
                cmdline="-d --debug", default=False),
     BoolOption("insist", "Try hard to go on RTyping", default=False,
                cmdline="--insist"),
-    BoolOption("withsmallfuncsets", "Represent small groups of functions as small integers",
-               default=False),
+    IntOption("withsmallfuncsets",
+              "Represent groups of less funtions than this as indices into an array",
+               default=0),
     BoolOption("countmallocs", "Count mallocs and frees", default=False,
                cmdline=None),
 

Modified: pypy/dist/pypy/rpython/rpbc.py
==============================================================================
--- pypy/dist/pypy/rpython/rpbc.py	(original)
+++ pypy/dist/pypy/rpython/rpbc.py	Thu Dec  7 20:37:01 2006
@@ -27,8 +27,7 @@
                     getRepr = OverriddenFunctionPBCRepr
                 else:
                     getRepr = rtyper.type_system.rpbc.FunctionsPBCRepr
-                    if rtyper.getconfig().translation.withsmallfuncsets and \
-                           1 < len(self.descriptions) < 120 and \
+                    if 1 < len(self.descriptions) < rtyper.getconfig().translation.withsmallfuncsets and \
                            hasattr(rtyper.type_system.rpbc, 'SmallFunctionSetPBCRepr'):
                         callfamily = self.descriptions.iterkeys().next().getcallfamily()
                         concretetable, uniquerows = get_concrete_calltable(rtyper, callfamily)

Modified: pypy/dist/pypy/rpython/test/test_rpbc.py
==============================================================================
--- pypy/dist/pypy/rpython/test/test_rpbc.py	(original)
+++ pypy/dist/pypy/rpython/test/test_rpbc.py	Thu Dec  7 20:37:01 2006
@@ -1750,12 +1750,12 @@
 class TestOOtype(BaseTestRPBC, OORtypeMixin):
     pass
 
-def test_smallfuncsets_simple():
+def test_smallfuncsets_basic():
     from pypy.translator.translator import TranslationContext, graphof
     from pypy.config.pypyoption import get_pypy_config
     from pypy.rpython.llinterp import LLInterpreter
     config = get_pypy_config(translating=True)
-    config.translation.withsmallfuncsets = True
+    config.translation.withsmallfuncsets = 10
 
     def g(x):
         return x + 1



More information about the Pypy-commit mailing list