[pypy-svn] pypy enable-opts: (alex, fijal): Remove some OPTIMIZE_ISMPLE.
alex_gaynor
commits-noreply at bitbucket.org
Sun Mar 13 19:23:06 CET 2011
Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: enable-opts
Changeset: r42562:bf1112c77983
Date: 2011-03-13 14:22 -0400
http://bitbucket.org/pypy/pypy/changeset/bf1112c77983/
Log: (alex, fijal): Remove some OPTIMIZE_ISMPLE.
diff --git a/pypy/jit/tl/tla/test_tla.py b/pypy/jit/tl/tla/test_tla.py
--- a/pypy/jit/tl/tla/test_tla.py
+++ b/pypy/jit/tl/tla/test_tla.py
@@ -61,7 +61,7 @@
tla.RETURN # stack depth == 2 here, error!
]
py.test.raises(AssertionError, "interp(code, tla.W_IntObject(234))")
-
+
def test_add():
code = [
tla.CONST_INT, 20,
@@ -90,7 +90,7 @@
]
res = interp(code, tla.W_IntObject(0))
assert res.intvalue == 123
-
+
res = interp(code, tla.W_IntObject(1))
assert res.intvalue == 234
@@ -138,7 +138,7 @@
tla.CONST_INT, 3,
tla.MUL,
tla.RETURN
- ]
+ ]
res = interp(code, tla.W_StringObject('foo '))
assert res.strvalue == 'foo foo foo '
@@ -153,10 +153,9 @@
assert isinstance(res, tla.W_FloatObject)
assert res.floatval == 2.5
-# ____________________________________________________________
+# ____________________________________________________________
from pypy.jit.metainterp.test.test_basic import LLJitMixin
-from pypy.rlib.jit import OPTIMIZER_FULL, OPTIMIZER_NO_UNROLL
class TestLLtype(LLJitMixin):
def test_loop(self):
@@ -177,6 +176,5 @@
w_result = interp(code, tla.W_IntObject(intvalue))
assert isinstance(w_result, tla.W_IntObject)
return w_result.intvalue
- res = self.meta_interp(interp_w, [42], listops=True,
- optimizer=OPTIMIZER_NO_UNROLL)
+ res = self.meta_interp(interp_w, [42], listops=True)
assert res == 0
diff --git a/pypy/jit/backend/x86/test/test_zrpy_gc.py b/pypy/jit/backend/x86/test/test_zrpy_gc.py
--- a/pypy/jit/backend/x86/test/test_zrpy_gc.py
+++ b/pypy/jit/backend/x86/test/test_zrpy_gc.py
@@ -11,7 +11,7 @@
from pypy.rlib import rgc
from pypy.rpython.lltypesystem import lltype, llmemory, rffi
from pypy.rpython.lltypesystem.lloperation import llop
-from pypy.rlib.jit import JitDriver, OPTIMIZER_SIMPLE, dont_look_inside
+from pypy.rlib.jit import JitDriver, dont_look_inside
from pypy.rlib.jit import purefunction, unroll_safe
from pypy.jit.backend.x86.runner import CPU386
from pypy.jit.backend.llsupport.gc import GcRefList, GcRootMap_asmgcc
@@ -88,7 +88,7 @@
ann.build_types(f, [s_list_of_strings], main_entry_point=True)
t.buildrtyper().specialize()
if kwds['jit']:
- apply_jit(t, optimizer=OPTIMIZER_SIMPLE)
+ apply_jit(t, enable_opts='')
cbuilder = genc.CStandaloneBuilder(t, f, t.config)
cbuilder.generate_source()
cbuilder.compile()
@@ -158,7 +158,7 @@
x.foo = 5
return weakref.ref(x)
def main_allfuncs(name, n, x):
- num = name_to_func[name]
+ num = name_to_func[name]
n, x, x0, x1, x2, x3, x4, x5, x6, x7, l, s = funcs[num][0](n, x)
while n > 0:
myjitdriver.can_enter_jit(num=num, n=n, x=x, x0=x0, x1=x1,
@@ -426,7 +426,7 @@
def define_compile_framework_external_exception_handling(cls):
def before(n, x):
x = X(0)
- return n, x, None, None, None, None, None, None, None, None, None, None
+ return n, x, None, None, None, None, None, None, None, None, None, None
@dont_look_inside
def g(x):
@@ -458,7 +458,7 @@
def test_compile_framework_external_exception_handling(self):
self.run('compile_framework_external_exception_handling')
-
+
def define_compile_framework_bug1(self):
@purefunction
def nonmoving():
diff --git a/pypy/jit/backend/x86/test/test_ztranslation.py b/pypy/jit/backend/x86/test/test_ztranslation.py
--- a/pypy/jit/backend/x86/test/test_ztranslation.py
+++ b/pypy/jit/backend/x86/test/test_ztranslation.py
@@ -1,6 +1,6 @@
import py, os, sys
from pypy.tool.udir import udir
-from pypy.rlib.jit import JitDriver, OPTIMIZER_FULL, unroll_parameters
+from pypy.rlib.jit import JitDriver, unroll_parameters
from pypy.rlib.jit import PARAMETERS, dont_look_inside
from pypy.rlib.jit import hint
from pypy.jit.metainterp.jitprof import Profiler
@@ -99,10 +99,10 @@
class Thing(object):
def __init__(self, val):
self.val = val
-
+
class Frame(object):
_virtualizable2_ = ['thing']
-
+
driver = JitDriver(greens = ['codeno'], reds = ['i', 'frame'],
virtualizables = ['frame'],
get_printable_location = lambda codeno: str(codeno))
diff --git a/pypy/jit/metainterp/warmspot.py b/pypy/jit/metainterp/warmspot.py
--- a/pypy/jit/metainterp/warmspot.py
+++ b/pypy/jit/metainterp/warmspot.py
@@ -30,7 +30,8 @@
# ____________________________________________________________
# Bootstrapping
-def apply_jit(translator, backend_name="auto", inline=False, **kwds):
+def apply_jit(translator, backend_name="auto", inline=False,
+ enable_opts=ALL_OPTS_NAMES, **kwds):
if 'CPUClass' not in kwds:
from pypy.jit.backend.detect_cpu import getcpuclass
kwds['CPUClass'] = getcpuclass(backend_name)
@@ -45,6 +46,7 @@
**kwds)
for jd in warmrunnerdesc.jitdrivers_sd:
jd.warmstate.set_param_inlining(inline)
+ jd.warmstate.set_param_enable_opts(enable_opts)
warmrunnerdesc.finish()
translator.warmrunnerdesc = warmrunnerdesc # for later debugging
@@ -275,7 +277,7 @@
stats = history.NoStats()
else:
stats = history.Stats()
- self.stats = stats
+ self.stats = stats
if translate_support_code:
self.annhelper = MixLevelHelperAnnotator(self.translator.rtyper)
annhelper = self.annhelper
@@ -329,7 +331,7 @@
return 'DoneWithThisFrameVoid()'
class DoneWithThisFrameInt(JitException):
- def __init__(self, result):
+ def __init__(self, result):
assert lltype.typeOf(result) is lltype.Signed
self.result = result
def __str__(self):
@@ -779,14 +781,14 @@
if self.metainterp_sd.profiler.initialized:
self.metainterp_sd.profiler.finish()
self.metainterp_sd.cpu.finish_once()
-
+
if self.cpu.translate_support_code:
call_final_function(self.translator, finish,
annhelper = self.annhelper)
def rewrite_set_param(self):
from pypy.rpython.lltypesystem.rstr import STR
-
+
closures = {}
graphs = self.translator.graphs
_, PTR_SET_PARAM_FUNCTYPE = self.cpu.ts.get_FuncType([lltype.Signed],
diff --git a/pypy/jit/backend/x86/test/test_basic.py b/pypy/jit/backend/x86/test/test_basic.py
--- a/pypy/jit/backend/x86/test/test_basic.py
+++ b/pypy/jit/backend/x86/test/test_basic.py
@@ -3,7 +3,7 @@
from pypy.jit.metainterp.warmspot import ll_meta_interp
from pypy.jit.metainterp.test import test_basic
from pypy.jit.codewriter.policy import StopAtXPolicy
-from pypy.rlib.jit import JitDriver, OPTIMIZER_SIMPLE
+from pypy.rlib.jit import JitDriver
class Jit386Mixin(test_basic.LLJitMixin):
type_system = 'lltype'
@@ -29,7 +29,7 @@
n -= x.arg
x.arg = 6 # prevents 'x.arg' from being annotated as constant
return n
- res = self.meta_interp(f, [31], optimizer=OPTIMIZER_SIMPLE)
+ res = self.meta_interp(f, [31], enable_opts='')
assert res == -4
def test_r_dict(self):
More information about the Pypy-commit
mailing list