[pypy-svn] r23365 - in pypy/branch/genc-gc-refactoring: . test

arigo at codespeak.net arigo at codespeak.net
Wed Feb 15 17:12:30 CET 2006


Author: arigo
Date: Wed Feb 15 17:12:28 2006
New Revision: 23365

Modified:
   pypy/branch/genc-gc-refactoring/genc.py
   pypy/branch/genc-gc-refactoring/node.py
   pypy/branch/genc-gc-refactoring/test/test_stackless.py
Log:
svn merge -r23356:23357 http://codespeak.net/svn/pypy/dist/pypy/translator/c


Modified: pypy/branch/genc-gc-refactoring/genc.py
==============================================================================
--- pypy/branch/genc-gc-refactoring/genc.py	(original)
+++ pypy/branch/genc-gc-refactoring/genc.py	Wed Feb 15 17:12:28 2006
@@ -19,6 +19,7 @@
     _compiled = False
     symboltable = None
     stackless = False
+    use_stackless_transformation = False
     
     def __init__(self, translator, entrypoint, gcpolicy=None, libraries=None, thread_enabled=False):
         self.translator = translator
@@ -38,6 +39,7 @@
         if self.stackless:
             from pypy.translator.c.stackless import StacklessData
             db.stacklessdata = StacklessData(db)
+            db.use_stackless_transformation = self.use_stackless_transformation
 
         # we need a concrete gcpolicy to do this
         self.libraries += db.gcpolicy.gc_libraries()
@@ -74,6 +76,10 @@
         else:
             if self.stackless:
                 defines['USE_STACKLESS'] = '1'
+                if self.use_stackless_transformation: #set in test_stackless.py
+                    from pypy.translator.backendopt.stackless import stackless
+                    from pypy.translator.c.stackless import StacklessData
+                    stackless(translator, StacklessData(db))
             cfile, extra = gen_source_standalone(db, modulename, targetdir,
                                                  entrypointname = pfname,
                                                  defines = defines)

Modified: pypy/branch/genc-gc-refactoring/node.py
==============================================================================
--- pypy/branch/genc-gc-refactoring/node.py	(original)
+++ pypy/branch/genc-gc-refactoring/node.py	Wed Feb 15 17:12:28 2006
@@ -512,7 +512,7 @@
             fnobj._callable,)
     elif hasattr(fnobj, 'graph'):
         cpython_exc = getattr(fnobj, 'exception_policy', None) == "CPython"
-        if hasattr(db, 'stacklessdata'):
+        if hasattr(db, 'stacklessdata') and not db.use_stackless_transformation:
             from pypy.translator.c.stackless import SlpFunctionCodeGenerator
             gencls = SlpFunctionCodeGenerator
         else:

Modified: pypy/branch/genc-gc-refactoring/test/test_stackless.py
==============================================================================
--- pypy/branch/genc-gc-refactoring/test/test_stackless.py	(original)
+++ pypy/branch/genc-gc-refactoring/test/test_stackless.py	Wed Feb 15 17:12:28 2006
@@ -19,6 +19,7 @@
 
     cbuilder = CStandaloneBuilder(t, entry_point)
     cbuilder.stackless = True
+    #cbuilder.use_stackless_transformation = True
     cbuilder.generate_source()
     cbuilder.compile()
     return cbuilder.cmdexec('')



More information about the Pypy-commit mailing list