[pypy-svn] r18422 - in pypy/dist/pypy/translator/c: . src

tismer at codespeak.net tismer at codespeak.net
Tue Oct 11 18:21:48 CEST 2005


Author: tismer
Date: Tue Oct 11 18:21:46 2005
New Revision: 18422

Modified:
   pypy/dist/pypy/translator/c/src/ll_stackless.h
   pypy/dist/pypy/translator/c/stackless.py
Log:
small tweaks 

Modified: pypy/dist/pypy/translator/c/src/ll_stackless.h
==============================================================================
--- pypy/dist/pypy/translator/c/src/ll_stackless.h	(original)
+++ pypy/dist/pypy/translator/c/src/ll_stackless.h	Tue Oct 11 18:21:46 2005
@@ -6,7 +6,7 @@
 #endif
 
 #ifndef MAX_STACK_SIZE
-#define MAX_STACK_SIZE (1 << 20)
+#define MAX_STACK_SIZE (1 << (20-1))
 #endif
 
 #define STANDALONE_ENTRY_POINT   slp_standalone_entry_point

Modified: pypy/dist/pypy/translator/c/stackless.py
==============================================================================
--- pypy/dist/pypy/translator/c/stackless.py	(original)
+++ pypy/dist/pypy/translator/c/stackless.py	Tue Oct 11 18:21:46 2005
@@ -16,7 +16,7 @@
 
     def __init__(self):
         self.frame_types = {}
-        self.globalstatecounter = 1
+        self.globalstatecounter = 2
         self.allsignatures = {}
         self.decode_table = []
         # start the decoding table with entries for the functions that
@@ -81,15 +81,14 @@
                 saving_lines.append('((struct %s*) f)->%s = %s;' % (
                     structname, varname, varname))
 
-            head = 'void *save_%(name)s(%(arguments)s);'
+            head = 'void save_%(name)s(%(arguments)s);'
             code = str(py.code.Source('''
-             void *save_%(name)s(%(arguments)s)
+             void save_%(name)s(%(arguments)s)
              {
                  slp_frame_t* f = slp_new_frame(sizeof(struct %(name)s), state);
                  slp_frame_stack_bottom->f_back = f;
                  slp_frame_stack_bottom = f;
                  %(saving_lines)s
-                 return NULL;
              }
             '''))
             argdict = {'name': structname,
@@ -218,13 +217,7 @@
         arguments = ['%d' % stacklessdata.globalstatecounter] + vars
         stacklessdata.globalstatecounter += 1
         savecall = 'save_%s(%s);' % (structname, ', '.join(arguments))
-        retvar = self.graph.getreturnvar()
-        if retvar.concretetype is lltype.Void:
-            savecall += ' return;'
-        else:
-            retvartype = self.lltypename(retvar)
-            savecall = 'return (%s) %s' % (cdecl(retvartype, ''),
-                                           savecall)
+        savecall += ' return %s;' % self.error_return_value()
         self.savelines.append('%s: %s' % (savelabel, savecall))
 
         # generate the resume block, e.g.



More information about the Pypy-commit mailing list