Commits

Christian Tismer committed 7293bfa

added a new translation option "-laptop"
this saves a lot of memory, by disabling geninterplevel

  • Participants
  • Parent commits 7942b5c

Comments (0)

Files changed (6)

pypy/translator/goal/targetpypymain.py

 
 # _____ Define and setup target ___
 
-def target():
+def target(geninterp=True):
     global space, w_entry_point
     # disable translation of the whole of classobjinterp.py
     StdObjSpace.setup_old_style_classes = lambda self: None
-    # disable geninterp for now -- we have faaar toooo much interp-level code
-    # for the poor translator already
-    # XXX why can't I enable this? crashes the annotator!
     space = StdObjSpace(nofaking=True,
                         compiler="pyparseapp",
                         translating=True,
-                        #usemodules=['marhsal', '_sre'],
-                        geninterp=False)
+                        #usemodules=['marshal', '_sre'],
+                        geninterp=geninterp)
 
     # manually imports app_main.py
     filename = os.path.join(this_dir, 'app_main.py')

pypy/translator/goal/targetpypystandalone.py

 
 # _____ Define and setup target ___
 
-def target():
+def target(geninterp=True):
     global space, w_entry_point
     # disable translation of the whole of classobjinterp.py
     StdObjSpace.setup_old_style_classes = lambda self: None
-    # disable geninterp for now -- we have faaar toooo much interp-level code
-    # for the poor translator already
-    # XXX why can't I enable this? crashes the annotator!
     space = StdObjSpace(nofaking=True,
                         compiler="pyparseapp",
                         translating=True,
-                        #usemodules=['marhsal', '_sre'],
-                        geninterp=True)
-
+                        #usemodules=['marshal', '_sre'],
+                        geninterp=geninterp)
     # manually imports app_main.py
     filename = os.path.join(this_dir, 'app_main.py')
     w_dict = space.newdict([])

pypy/translator/goal/targetrichards.py

 
 # _____ Define and setup target ___
 
-def target():
+def target(*args):
     return entry_point, []
 
 def get_llinterp_args():

pypy/translator/goal/targetrpystonex.py

         g.PtrGlbNext = None
         return rpystone.pystones(loops), id(g)
 
-    def target():
+    def target(*args):
         return entry_point, [int]
     
     def run(c_entry_point):

pypy/translator/goal/targetsegfault.py

 def entry_point(i):
     return getitem([i, 2, 3, 4], 2) + getitem(None, i)
 
-def target():
+def target(*args):
     return entry_point, [int]
 
 def get_llinterp_args():

pypy/translator/goal/translate_pypy.py

               be either .py or .zip .
    -llinterpret
               interprets the flow graph after rtyping it
+   -laptop    try to save as much memory as possible, since laptops tend to
+              have less than a gigabyte of memory (512 MB is typical).
+              Currently, we avoid to use geninterplevel, which creates a lot
+              of extra blocks, but gains only som 10-20 % of speed, because
+              we are still lacking annotation of applevel code.
+   -batch     don't use interactive helpers,like pdb
 """
 import autopath, sys, os
 
 
     policy = AnnotatorPolicy()
     if target:
-        spec = target()
+        spec = target(not options['-laptop'])
         try:
             entry_point, inputtypes, policy = spec
         except ValueError:
                '-fork': False,
                '-fork2': False,
                '-llinterpret': False,
+               '-laptop': False,
                '-batch': False,
                }
     listen_port = None