[pypy-commit] pypy stacklet: Kill some more references to stackless.

arigo noreply at buildbot.pypy.org
Sat Aug 6 17:35:00 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: stacklet
Changeset: r46326:06cbca2ceaeb
Date: 2011-08-06 17:35 +0200
http://bitbucket.org/pypy/pypy/changeset/06cbca2ceaeb/

Log:	Kill some more references to stackless.

diff --git a/pypy/doc/config/objspace.usemodules._stackless.txt b/pypy/doc/config/objspace.usemodules._stackless.txt
--- a/pypy/doc/config/objspace.usemodules._stackless.txt
+++ b/pypy/doc/config/objspace.usemodules._stackless.txt
@@ -1,6 +1,1 @@
-Use the '_stackless' module. 
-
-Exposes the `stackless` primitives, and also implies a stackless build. 
-See also :config:`translation.stackless`.
-
-.. _`stackless`: ../stackless.html
+Deprecated.
diff --git a/pypy/doc/config/objspace.usemodules._stackless.txt b/pypy/doc/config/objspace.usemodules._stacklet.txt
copy from pypy/doc/config/objspace.usemodules._stackless.txt
copy to pypy/doc/config/objspace.usemodules._stacklet.txt
--- a/pypy/doc/config/objspace.usemodules._stackless.txt
+++ b/pypy/doc/config/objspace.usemodules._stacklet.txt
@@ -1,6 +1,3 @@
-Use the '_stackless' module. 
+Use the '_stacklet' module. 
 
-Exposes the `stackless` primitives, and also implies a stackless build. 
-See also :config:`translation.stackless`.
-
-.. _`stackless`: ../stackless.html
+Exposes the `stacklet` primitives.  See also :config:`translation.stacklet`.
diff --git a/pypy/doc/config/translation.stackless.txt b/pypy/doc/config/translation.stacklet.txt
rename from pypy/doc/config/translation.stackless.txt
rename to pypy/doc/config/translation.stacklet.txt
--- a/pypy/doc/config/translation.stackless.txt
+++ b/pypy/doc/config/translation.stacklet.txt
@@ -1,5 +1,2 @@
-Run the `stackless transform`_ on each generated graph, which enables the use
-of coroutines at RPython level and the "stackless" module when translating
-PyPy.
-
-.. _`stackless transform`: ../stackless.html
+Enable the use of a stackless-like primitive called "stacklet",
+and the coroutines/greenlets/tasklets built on top.
diff --git a/pypy/interpreter/test/test_gateway.py b/pypy/interpreter/test/test_gateway.py
--- a/pypy/interpreter/test/test_gateway.py
+++ b/pypy/interpreter/test/test_gateway.py
@@ -704,7 +704,7 @@
 class TestPassThroughArguments_CALL_METHOD(TestPassThroughArguments):
 
     def setup_class(cls):
-        space = gettestobjspace(usemodules=('_stackless',), **{
+        space = gettestobjspace(usemodules=('_stacklet',), **{
             "objspace.opcodes.CALL_METHOD": True
             })
         cls.space = space
diff --git a/pypy/rlib/rstacklet.py b/pypy/rlib/rstacklet.py
--- a/pypy/rlib/rstacklet.py
+++ b/pypy/rlib/rstacklet.py
@@ -47,7 +47,7 @@
 _new = llexternal('stacklet_new', [thread_handle, run_fn, rffi.VOIDP],
                   handle)
 _switch = llexternal('stacklet_switch', [thread_handle, handle], handle)
-_destroy = llexternal('stacklet_destroy', [thread_handle, handle], lltype.Void)
+destroy = llexternal('stacklet_destroy', [thread_handle, handle], lltype.Void)
 
 _translate_pointer = llexternal("_stacklet_translate_pointer",
                                 [handle, llmemory.Address],
diff --git a/pypy/rpython/memory/gctransform/framework.py b/pypy/rpython/memory/gctransform/framework.py
--- a/pypy/rpython/memory/gctransform/framework.py
+++ b/pypy/rpython/memory/gctransform/framework.py
@@ -7,7 +7,7 @@
 from pypy.rpython.memory.gc import marksweep
 from pypy.rpython.memory.gcheader import GCHeaderBuilder
 from pypy.rlib.rarithmetic import ovfcheck
-from pypy.rlib import rstack, rgc
+from pypy.rlib import rgc
 from pypy.rlib.debug import ll_assert
 from pypy.rlib.objectmodel import we_are_translated
 from pypy.translator.backendopt import graphanalyze
@@ -33,8 +33,6 @@
         except AttributeError:
             pass
         else:
-            if func is rstack.stack_check:
-                return self.translator.config.translation.stackless
             if getattr(func, '_gctransformer_hint_cannot_collect_', False):
                 return False
             if getattr(func, '_gctransformer_hint_close_stack_', False):
@@ -134,7 +132,6 @@
     return result
 
 class FrameworkGCTransformer(GCTransformer):
-    use_stackless = False
     root_stack_depth = 163840
 
     def __init__(self, translator):
diff --git a/pypy/rpython/memory/gctransform/test/test_framework.py b/pypy/rpython/memory/gctransform/test/test_framework.py
--- a/pypy/rpython/memory/gctransform/test/test_framework.py
+++ b/pypy/rpython/memory/gctransform/test/test_framework.py
@@ -70,23 +70,6 @@
     gg = graphof(t, g)
     assert not CollectAnalyzer(t).analyze_direct_call(gg)    
 
-def test_cancollect_stack_check():
-    from pypy.rlib import rstack
-
-    def with_check():
-        rstack.stack_check()
-
-    t = rtype(with_check, [])
-    with_check_graph = graphof(t, with_check)
-
-    assert not t.config.translation.stackless
-    can_collect = CollectAnalyzer(t).analyze_direct_call(with_check_graph)
-    assert not can_collect
-    
-    t.config.translation.stackless = True
-    can_collect = CollectAnalyzer(t).analyze_direct_call(with_check_graph)
-    assert can_collect
-
 def test_cancollect_external():
     fext1 = rffi.llexternal('fext1', [], lltype.Void, threadsafe=False)
     def g():
diff --git a/pypy/rpython/memory/gctransform/transform.py b/pypy/rpython/memory/gctransform/transform.py
--- a/pypy/rpython/memory/gctransform/transform.py
+++ b/pypy/rpython/memory/gctransform/transform.py
@@ -307,7 +307,6 @@
             if backendopt:
                 self.mixlevelannotator.backend_optimize()
         # Make sure that the database also sees all finalizers now.
-        # XXX we need to think more about the interaction with stackless...
         # It is likely that the finalizers need special support there
         newgcdependencies = self.ll_finalizers_ptrs
         return newgcdependencies
diff --git a/pypy/tool/pytest/test/test_appsupport.py b/pypy/tool/pytest/test/test_appsupport.py
--- a/pypy/tool/pytest/test/test_appsupport.py
+++ b/pypy/tool/pytest/test/test_appsupport.py
@@ -39,7 +39,7 @@
         setpypyconftest(testdir)
         testdir.makepyfile("""
             class AppTestClass:
-                spaceconfig = {"objspace.usemodules._stackless": True}
+                spaceconfig = {"objspace.usemodules._random": True}
                 def setup_class(cls):
                     assert 0
                 def test_applevel(self):
@@ -48,7 +48,7 @@
         result = testdir.runpytest("-A")
         assert result.ret == 0
         if hasattr(sys, 'pypy_translation_info') and \
-           sys.pypy_translation_info.get('objspace.usemodules._stackless'):
+           sys.pypy_translation_info.get('objspace.usemodules._random'):
             result.stdout.fnmatch_lines(["*1 error*"])
         else:
             # setup_class didn't get called, otherwise it would error
@@ -58,9 +58,9 @@
         setpypyconftest(testdir)
         p = testdir.makepyfile("""
             class TestClass:
-                spaceconfig = {"objspace.usemodules._stackless": False}
+                spaceconfig = {"objspace.usemodules._random": False}
                 def setup_class(cls):
-                    assert not cls.space.config.objspace.usemodules._stackless
+                    assert not cls.space.config.objspace.usemodules._random
                 def test_interp(self, space):
                     assert self.space is space
                 def test_interp2(self, space):
diff --git a/pypy/tool/release/force-builds.py b/pypy/tool/release/force-builds.py
--- a/pypy/tool/release/force-builds.py
+++ b/pypy/tool/release/force-builds.py
@@ -22,7 +22,7 @@
 #    'own-macosx-x86-32',
 #    'pypy-c-app-level-linux-x86-32',
 #    'pypy-c-app-level-linux-x86-64',
-    'pypy-c-stackless-app-level-linux-x86-32',
+#    'pypy-c-stackless-app-level-linux-x86-32',
     'pypy-c-app-level-win-x86-32',
     'pypy-c-jit-linux-x86-32',
     'pypy-c-jit-linux-x86-64',
diff --git a/pypy/translator/driver.py b/pypy/translator/driver.py
--- a/pypy/translator/driver.py
+++ b/pypy/translator/driver.py
@@ -500,7 +500,6 @@
             cbuilder = CBuilder(self.translator, self.entry_point,
                                 config=self.config,
                                 secondary_entrypoints=self.secondary_entrypoints)
-            cbuilder.stackless = self.config.translation.stackless
         if not standalone:     # xxx more messy
             cbuilder.modulename = self.extmod_name
         database = cbuilder.build_database()


More information about the pypy-commit mailing list