[pypy-svn] r67083 - in pypy/branch/pyjitpl5/pypy: config jit/tl
arigo at codespeak.net
arigo at codespeak.net
Fri Aug 21 18:53:08 CEST 2009
Author: arigo
Date: Fri Aug 21 18:53:06 2009
New Revision: 67083
Modified:
pypy/branch/pyjitpl5/pypy/config/pypyoption.py
pypy/branch/pyjitpl5/pypy/config/translationoption.py
pypy/branch/pyjitpl5/pypy/jit/tl/pypyjit.py
Log:
(iko, arigo)
Replace the option --jit with using the optimization level -Ojit.
Much more flexible.
Modified: pypy/branch/pyjitpl5/pypy/config/pypyoption.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/config/pypyoption.py (original)
+++ pypy/branch/pyjitpl5/pypy/config/pypyoption.py Fri Aug 21 18:53:06 2009
@@ -356,7 +356,7 @@
backend = config.translation.backend
# all the good optimizations for PyPy should be listed here
- if level in ['2', '3']:
+ if level in ['2', '3', 'jit']:
config.objspace.opcodes.suggest(CALL_LIKELY_BUILTIN=True)
config.objspace.opcodes.suggest(CALL_METHOD=True)
config.objspace.std.suggest(withmultidict=True)
@@ -392,6 +392,10 @@
if type_system == 'ootype':
config.objspace.std.suggest(multimethods="doubledispatch")
+ # extra optimizations with the JIT
+ if level == 'jit':
+ config.objspace.std.suggest(withsharingdict=True)
+
def enable_allworkingmodules(config):
if config.translation.type_system == 'ootype':
Modified: pypy/branch/pyjitpl5/pypy/config/translationoption.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/config/translationoption.py (original)
+++ pypy/branch/pyjitpl5/pypy/config/translationoption.py Fri Aug 21 18:53:06 2009
@@ -94,9 +94,9 @@
BoolOption("rweakref", "The backend supports RPython-level weakrefs",
default=True),
- # JIT generation
+ # JIT generation: use -Ojit to enable it
BoolOption("jit", "generate a JIT",
- default=False, cmdline="--jit",
+ default=False,
requires=[("translation.thread", False)],
suggests=[("translation.gc", "boehm"), # for now
("translation.list_comprehension_operations", True)]),
@@ -298,7 +298,7 @@
# ____________________________________________________________
-OPT_LEVELS = ['0', '1', 'size', 'mem', '2', '3']
+OPT_LEVELS = ['0', '1', 'size', 'mem', '2', '3', 'jit']
DEFAULT_OPT_LEVEL = '2'
OPT_TABLE_DOC = {
@@ -308,6 +308,7 @@
'mem': 'Optimize for run-time memory usage and use a memory-saving GC.',
'2': 'Enable most optimizations and use a high-performance GC.',
'3': 'Enable all optimizations and use a high-performance GC.',
+ 'jit': 'Enable the JIT.',
}
OPT_TABLE = {
@@ -318,6 +319,7 @@
'mem': 'markcompact lowinline remove_asserts',
'2': 'hybrid extraopts',
'3': 'hybrid extraopts remove_asserts',
+ 'jit': 'boehm extraopts', # XXX boehm for now, fix me
}
def set_opt_level(config, level):
Modified: pypy/branch/pyjitpl5/pypy/jit/tl/pypyjit.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/tl/pypyjit.py (original)
+++ pypy/branch/pyjitpl5/pypy/jit/tl/pypyjit.py Fri Aug 21 18:53:06 2009
@@ -31,19 +31,15 @@
config = get_pypy_config(translating=True)
config.translation.backendopt.inline_threshold = 0
-set_opt_level(config, level='1')
-config.objspace.compiler = 'ast'
config.objspace.nofaking = True
+config.objspace.compiler = "ast"
+config.translating = True
+set_opt_level(config, level='jit')
config.objspace.allworkingmodules = False
config.objspace.usemodules.pypyjit = True
config.objspace.usemodules._weakref = False
config.objspace.usemodules._sre = False
-set_pypy_opt_level(config, level='0')
-config.objspace.std.builtinshortcut = True
-config.objspace.opcodes.CALL_LIKELY_BUILTIN = True
-config.objspace.std.withrangelist = True
-config.objspace.std.withsharingdict = True
-config.objspace.std.withmethodcache = True
+set_pypy_opt_level(config, level='jit')
if BACKEND == 'c':
config.objspace.std.multimethods = 'mrd'
More information about the Pypy-commit
mailing list