Author: Brian Kearns <bdkea...@gmail.com> Branch: Changeset: r69964:d5b78e64b2f0 Date: 2014-03-14 16:58 -0400 http://bitbucket.org/pypy/pypy/changeset/d5b78e64b2f0/
Log: cleanup diff --git a/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py b/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py --- a/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py +++ b/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py @@ -1,14 +1,15 @@ import py from rpython.rlib.objectmodel import instantiate +from rpython.jit.metainterp import compile, resume +from rpython.jit.metainterp.history import AbstractDescr, ConstInt, BoxInt, TreeLoop +from rpython.jit.metainterp.optimize import InvalidLoop +from rpython.jit.metainterp.optimizeopt import build_opt_chain from rpython.jit.metainterp.optimizeopt.test.test_util import ( LLtypeMixin, BaseTest, convert_old_style_to_targets) -from rpython.jit.metainterp.optimizeopt import build_opt_chain -from rpython.jit.metainterp.optimize import InvalidLoop -from rpython.jit.metainterp.history import AbstractDescr, ConstInt, BoxInt -from rpython.jit.metainterp.history import TreeLoop -from rpython.jit.metainterp import compile, resume +from rpython.jit.metainterp.optimizeopt.test.test_optimizebasic import \ + FakeMetaInterpStaticData from rpython.jit.metainterp.resoperation import rop, opname, oparity -from rpython.jit.metainterp.optimizeopt.test.test_optimizebasic import FakeMetaInterpStaticData + def test_build_opt_chain(): def check(chain, expected_names): @@ -40,7 +41,6 @@ class BaseTestWithUnroll(BaseTest): - enable_opts = "intbounds:rewrite:virtualize:string:earlyforce:pure:heap:unroll" def optimize_loop(self, ops, expected, expected_preamble=None, @@ -93,8 +93,8 @@ def raises(self, e, fn, *args): return py.test.raises(e, fn, *args).value + class OptimizeOptTest(BaseTestWithUnroll): - def setup_method(self, meth=None): class FailDescr(compile.ResumeGuardDescr): oparse = None @@ -130,7 +130,6 @@ self.namespace.pop('fdescr', None) self.namespace.pop('fdescr2', None) - def test_simple(self): ops = """ [] @@ -974,7 +973,6 @@ """ self.optimize_loop(ops, expected, preamble) - # ---------- def test_virtual_1(self): @@ -1252,7 +1250,6 @@ """ self.optimize_loop(ops, expected, preamble) - def test_virtual_constant_isnonnull(self): ops = """ [i0] @@ -2789,8 +2786,7 @@ p2 = new_with_vtable(ConstClass(node_vtable)) jump(p2) """ - self.raises(InvalidLoop, self.optimize_loop, - ops, "crash!") + self.raises(InvalidLoop, self.optimize_loop, ops, "crash!") def test_invalid_loop_2(self): ops = """ @@ -2801,8 +2797,7 @@ escape(p2) # prevent it from staying Virtual jump(p2) """ - self.raises(InvalidLoop, self.optimize_loop, - ops, "crash!") + self.raises(InvalidLoop, self.optimize_loop, ops, "crash!") def test_invalid_loop_3(self): ops = """ @@ -2824,8 +2819,7 @@ guard_value(p2, ConstPtr(myptr)) [] jump(p2) """ - exc = self.raises(InvalidLoop, self.optimize_loop, - ops, "crash!") + exc = self.raises(InvalidLoop, self.optimize_loop, ops, "crash!") if exc: assert "node" in exc.msg @@ -3151,7 +3145,6 @@ """ self.optimize_loop(ops, expected) - def test_int_and_or_with_zero(self): ops = """ [i0, i1] @@ -5107,7 +5100,6 @@ """ self.optimize_loop(ops, expected) - def test_division_nonneg(self): py.test.skip("harder") # this is how an app-level division turns into right now @@ -5444,7 +5436,6 @@ """ self.optimize_loop(ops, ops, ops) - def test_mul_ovf(self): ops = """ [i0, i1] @@ -5591,7 +5582,6 @@ def is_integer_bounded(self): return False - for n in ('inst_w_seq', 'inst_index', 'inst_w_list', 'inst_length', 'inst_start', 'inst_step'): self.namespace[n] = FakeDescr(n) @@ -5847,7 +5837,7 @@ self.optimize_loop(ops, optops, preamble) # check with replacing 'str' with 'unicode' everywhere def r(s): - return s.replace('str','unicode').replace('s"', 'u"') + return s.replace('str', 'unicode').replace('s"', 'u"') self.optimize_loop(r(ops), r(optops), r(preamble)) def test_newstr_1(self): @@ -6277,7 +6267,7 @@ if isinstance(value, calldescrtype): extra = value.get_extra_info() if (extra and isinstance(extra, effectinfotype) and - extra.oopspecindex == oopspecindex): + extra.oopspecindex == oopspecindex): # returns 0 for 'func' in this test return value, 0 raise AssertionError("not found: oopspecindex=%d" % @@ -7395,7 +7385,6 @@ """ self.optimize_loop(ops, expected, expected_short=short) - def test_loopinvariant_constant_strgetitem(self): ops = """ [p0] @@ -7454,7 +7443,7 @@ """ self.optimize_loop(ops, expected, expected_short=short) - def test_propagate_virtual_arryalen(self): + def test_propagate_virtual_arraylen(self): ops = """ [p0] p404 = new_array(2, descr=arraydescr) @@ -7831,7 +7820,6 @@ """ self.optimize_loop(ops, expected) - def test_setarrayitem_followed_by_arraycopy(self): ops = """ [p1, p2] @@ -8124,7 +8112,6 @@ """ self.optimize_loop(ops, expected) - def test_issue1080_infinitie_loop_simple(self): ops = """ [p69] @@ -8149,8 +8136,7 @@ guard_value(p1, ConstPtr(myptr)) [] jump(p1) """ - self.raises(InvalidLoop, self.optimize_loop, - ops, ops) + self.raises(InvalidLoop, self.optimize_loop, ops, ops) def test_licm_boxed_opaque_getitem(self): ops = """ @@ -8225,8 +8211,7 @@ guard_value(p1, ConstPtr(myptr)) [] jump(p1) """ - self.raises(InvalidLoop, self.optimize_loop, - ops, ops) + self.raises(InvalidLoop, self.optimize_loop, ops, ops) def test_cond_call_with_a_constant(self): ops = """ @@ -8263,6 +8248,6 @@ """ self.optimize_loop(ops, ops) + class TestLLtype(OptimizeOptTest, LLtypeMixin): pass - _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit