[pypy-svn] r78142 - in pypy/branch/cleanup-dict-impl/pypy: config config/test module/__builtin__/test objspace/std objspace/std/test

arigo at codespeak.net arigo at codespeak.net
Wed Oct 20 17:42:08 CEST 2010


Author: arigo
Date: Wed Oct 20 17:42:06 2010
New Revision: 78142

Removed:
   pypy/branch/cleanup-dict-impl/pypy/objspace/std/sharingdict.py
   pypy/branch/cleanup-dict-impl/pypy/objspace/std/test/test_sharingdict.py
Modified:
   pypy/branch/cleanup-dict-impl/pypy/config/pypyoption.py
   pypy/branch/cleanup-dict-impl/pypy/config/test/test_pypyoption.py
   pypy/branch/cleanup-dict-impl/pypy/module/__builtin__/test/test_classobj.py
   pypy/branch/cleanup-dict-impl/pypy/objspace/std/dictmultiobject.py
   pypy/branch/cleanup-dict-impl/pypy/objspace/std/test/test_dictmultiobject.py
Log:
(cfbolz, arigo) Kill sharingdict.


Modified: pypy/branch/cleanup-dict-impl/pypy/config/pypyoption.py
==============================================================================
--- pypy/branch/cleanup-dict-impl/pypy/config/pypyoption.py	(original)
+++ pypy/branch/cleanup-dict-impl/pypy/config/pypyoption.py	Wed Oct 20 17:42:06 2010
@@ -228,10 +228,6 @@
                    requires=[("objspace.opcodes.CALL_LIKELY_BUILTIN", False),
                              ("objspace.honor__builtins__", False)]),
 
-        BoolOption("withsharingdict",
-                   "use dictionaries that share the keys part",
-                   default=False),
-
         BoolOption("withdictmeasurement",
                    "create huge files with masses of information "
                    "about dictionaries",
@@ -240,8 +236,7 @@
         BoolOption("withmapdict",
                    "make instances really small but slow without the JIT",
                    default=False,
-                   requires=[("objspace.std.withsharingdict", False),
-                             ("objspace.std.getattributeshortcut", True),
+                   requires=[("objspace.std.getattributeshortcut", True),
                              ("objspace.std.withtypeversion", True),
                        ]),
 
@@ -329,8 +324,6 @@
         config.objspace.std.suggest(optimized_list_getitem=True)
         config.objspace.std.suggest(getattributeshortcut=True)
         config.objspace.std.suggest(newshortcut=True)        
-        if type_system != 'ootype':
-            config.objspace.std.suggest(withsharingdict=True)
 
     # extra costly optimizations only go in level 3
     if level == '3':
@@ -359,7 +352,7 @@
     # extra optimizations with the JIT
     if level == 'jit':
         config.objspace.std.suggest(withcelldict=True)
-        #config.objspace.std.suggest(withmapdict=True)
+        config.objspace.std.suggest(withmapdict=True)
 
 
 def enable_allworkingmodules(config):

Modified: pypy/branch/cleanup-dict-impl/pypy/config/test/test_pypyoption.py
==============================================================================
--- pypy/branch/cleanup-dict-impl/pypy/config/test/test_pypyoption.py	(original)
+++ pypy/branch/cleanup-dict-impl/pypy/config/test/test_pypyoption.py	Wed Oct 20 17:42:06 2010
@@ -47,7 +47,7 @@
 def test_set_pypy_opt_level():
     conf = get_pypy_config()
     set_pypy_opt_level(conf, '2')
-    assert conf.objspace.std.withsharingdict
+    assert conf.objspace.std.newshortcut
     conf = get_pypy_config()
     set_pypy_opt_level(conf, '0')
     assert not conf.objspace.std.newshortcut

Modified: pypy/branch/cleanup-dict-impl/pypy/module/__builtin__/test/test_classobj.py
==============================================================================
--- pypy/branch/cleanup-dict-impl/pypy/module/__builtin__/test/test_classobj.py	(original)
+++ pypy/branch/cleanup-dict-impl/pypy/module/__builtin__/test/test_classobj.py	Wed Oct 20 17:42:06 2010
@@ -954,28 +954,7 @@
         raises(TypeError, descr.__delete__, a)
 
 
-class AppTestOldStyleSharing(AppTestOldstyle):
-    def setup_class(cls):
-        cls.space = gettestobjspace(**{"objspace.std.withsharingdict": True})
-        if option.runappdirect:
-            py.test.skip("can only be run on py.py")
-        def is_sharing(space, w_inst):
-            from pypy.objspace.std.sharingdict import SharedDictImplementation
-            w_d = w_inst.getdict()
-            return space.wrap(isinstance(w_d, SharedDictImplementation) and w_d.r_dict_content is None)
-        cls.w_is_sharing = cls.space.wrap(gateway.interp2app(is_sharing))
-
-
-    def test_real_sharing(self):
-        class A:
-            def __init__(self):
-                self.x = 42
-        A1, A2, A3 = A(), A(), A()
-        assert self.is_sharing(A3)
-        assert self.is_sharing(A2)
-        assert self.is_sharing(A1)
-
-class AppTestOldStyleModDict(object):
+class AppTestOldStyleClassStrDict(object):
     def setup_class(cls):
         if option.runappdirect:
             py.test.skip("can only be run on py.py")

Modified: pypy/branch/cleanup-dict-impl/pypy/objspace/std/dictmultiobject.py
==============================================================================
--- pypy/branch/cleanup-dict-impl/pypy/objspace/std/dictmultiobject.py	(original)
+++ pypy/branch/cleanup-dict-impl/pypy/objspace/std/dictmultiobject.py	Wed Oct 20 17:42:06 2010
@@ -49,10 +49,6 @@
         elif space.config.objspace.std.withdictmeasurement:
             assert w_type is None
             return MeasuringDictImplementation(space)
-        elif space.config.objspace.std.withsharingdict and instance:
-            from pypy.objspace.std.sharingdict import SharedDictImplementation
-            assert w_type is None
-            return SharedDictImplementation(space)
         elif instance or strdict or module:
             assert w_type is None
             return StrDictImplementation(space)

Modified: pypy/branch/cleanup-dict-impl/pypy/objspace/std/test/test_dictmultiobject.py
==============================================================================
--- pypy/branch/cleanup-dict-impl/pypy/objspace/std/test/test_dictmultiobject.py	(original)
+++ pypy/branch/cleanup-dict-impl/pypy/objspace/std/test/test_dictmultiobject.py	Wed Oct 20 17:42:06 2010
@@ -4,7 +4,6 @@
      StrDictImplementation
 
 from pypy.objspace.std.celldict import ModuleDictImplementation
-from pypy.objspace.std.sharingdict import SharedDictImplementation
 from pypy.conftest import gettestobjspace
 
 
@@ -510,32 +509,6 @@
         assert getattr(a, s) == 42
 
 
-class TestW_DictSharing(TestW_DictObject):
-    def setup_class(cls):
-        cls.space = gettestobjspace(**{"objspace.std.withsharingdict": True})
-
-class AppTest_DictSharing(AppTest_DictObject):
-    def setup_class(cls):
-        cls.space = gettestobjspace(**{"objspace.std.withsharingdict": True})
-
-    def test_values_does_not_share(self):
-        class A(object):
-            pass
-        a = A()
-        a.abc = 12
-        l = a.__dict__.values()
-        assert l == [12]
-        l[0] = 24
-        assert a.abc == 12
-
-    def test_items(self):
-        class A(object):
-            pass
-        a = A()
-        a.abc = 12
-        a.__dict__.items() == [("abc", 12)]
-
-
 class AppTestModuleDict(object):
     def setup_class(cls):
         cls.space = gettestobjspace(**{"objspace.std.withcelldict": True})
@@ -629,7 +602,6 @@
     class objspace:
         class std:
             withdictmeasurement = False
-            withsharingdict = False
             withsmalldicts = False
             withcelldict = False
         class opcodes:
@@ -766,9 +738,6 @@
     string = "int"
     string2 = "isinstance"
 
-class TestSharedDictImplementation(BaseTestRDictImplementation):
-    ImplementionClass = SharedDictImplementation
-
 
 class BaseTestDevolvedDictImplementation(BaseTestRDictImplementation):
     def fill_impl(self):
@@ -790,8 +759,6 @@
     string = "int"
     string2 = "isinstance"
 
-class TestDevolvedSharedDictImplementation(BaseTestDevolvedDictImplementation):
-    ImplementionClass = SharedDictImplementation
 
 def test_module_uses_strdict():
     fakespace = FakeSpace()



More information about the Pypy-commit mailing list