Armin Rigo avatar Armin Rigo committed 1f6c986

Remove simple_optimize, left behind.

Comments (0)

Files changed (4)

pypy/jit/metainterp/simple_optimize.py

-
-""" Simplified optimize.py
-"""
-
-from pypy.jit.metainterp.resoperation import rop, ResOperation
-from pypy.jit.metainterp import resume, compile
-
-EMPTY_VALUES = {}
-
-def transform(op):
-    from pypy.jit.metainterp.history import AbstractDescr
-    # Rename CALL_PURE and CALL_LOOPINVARIANT to CALL.
-    # Simplify the VIRTUAL_REF_* so that they don't show up in the backend.
-    if op.getopnum() == rop.CALL_PURE:
-        op = ResOperation(rop.CALL, op.getarglist()[1:], op.result,
-                          op.getdescr())
-    elif op.getopnum() == rop.CALL_LOOPINVARIANT:
-        op = op.copy_and_change(rop.CALL)
-    elif op.getopnum() == rop.VIRTUAL_REF:
-        op = ResOperation(rop.SAME_AS, [op.getarg(0)], op.result)
-    elif op.getopnum() == rop.VIRTUAL_REF_FINISH:
-        return []
-    return [op]
-
-def optimize_loop(metainterp_sd, old_loops, loop):
-    if old_loops:
-        assert len(old_loops) == 1
-        return old_loops[0]
-    else:
-        # copy loop operations here
-        # we need it since the backend can modify those lists, which make
-        # get_guard_op in compile.py invalid
-        # in fact, x86 modifies this list for moving GCs
-        memo = resume.ResumeDataLoopMemo(metainterp_sd)
-        newoperations = []
-        for op in loop.operations:
-            if op.is_guard():
-                descr = op.getdescr()
-                assert isinstance(descr, compile.ResumeGuardDescr)
-                modifier = resume.ResumeDataVirtualAdder(descr, memo)
-                newboxes = modifier.finish(EMPTY_VALUES)
-                descr.store_final_boxes(op, newboxes)
-            newoperations.extend(transform(op))
-        loop.operations = newoperations
-        jumpop = newoperations[-1]
-        if jumpop.getopnum() == rop.JUMP:
-            jumpop.setdescr(loop.token)
-        return None
-
-def optimize_bridge(metainterp_sd, old_loops, loop, inline_short_preamble,
-                    retraced):
-    optimize_loop(metainterp_sd, [], loop)
-    jumpop = loop.operations[-1]
-    if jumpop.getopnum() == rop.JUMP:
-        jumpop.setdescr(old_loops[0])
-    return old_loops[0]

pypy/jit/metainterp/test/test_basic.py

 def _get_jitcodes(testself, CPUClass, func, values, type_system,
                   supports_longlong=False, **kwds):
     from pypy.jit.codewriter import support, codewriter
-    from pypy.jit.metainterp import simple_optimize
 
     class FakeJitCell:
         __compiled_merge_points = []
             return self._cell
         _cell = FakeJitCell()
 
-        # pick the optimizer this way
-        optimize_loop = staticmethod(simple_optimize.optimize_loop)
-        optimize_bridge = staticmethod(simple_optimize.optimize_bridge)
-
         trace_limit = sys.maxint
         enable_opts = ALL_OPTS_DICT
 

pypy/jit/metainterp/test/test_slist.py

         assert res == 2
 
     def test_make_list(self):
-        from pypy.jit.metainterp import simple_optimize
         myjitdriver = JitDriver(greens = [], reds = ['n', 'lst'])
         def f(n):
             lst = None

pypy/jit/metainterp/test/test_tl.py

     def test_tl_call(self, listops=True, policy=None):
         from pypy.jit.tl.tl import interp
         from pypy.jit.tl.tlopcode import compile
-        from pypy.jit.metainterp import simple_optimize
 
         code = compile('''
               PUSHARG
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.