Пример #1
0
    def _do_optimize_loop(self, loop, call_pure_results):
        from pypy.jit.metainterp.optimizeopt.unroll import optimize_unroll
        from pypy.jit.metainterp.optimizeopt.util import args_dict
        from pypy.jit.metainterp.optimizeopt.pure import OptPure

        self.loop = loop
        loop.call_pure_results = args_dict()
        metainterp_sd = FakeMetaInterpStaticData(self.cpu)
        optimize_unroll(metainterp_sd, loop, [OptRenameStrlen(), OptPure()], True)
Пример #2
0
    def _do_optimize_loop(self, loop, call_pure_results):
        from pypy.jit.metainterp.optimizeopt import optimize_trace
        from pypy.jit.metainterp.optimizeopt.util import args_dict

        self.loop = loop
        loop.call_pure_results = args_dict()
        if call_pure_results is not None:
            for k, v in call_pure_results.items():
                loop.call_pure_results[list(k)] = v
        metainterp_sd = FakeMetaInterpStaticData(self.cpu)
        if hasattr(self, 'vrefinfo'):
            metainterp_sd.virtualref_info = self.vrefinfo
        if hasattr(self, 'callinfocollection'):
            metainterp_sd.callinfocollection = self.callinfocollection
        #
        optimize_trace(metainterp_sd, loop, self.enable_opts)
Пример #3
0
    def _do_optimize_loop(self, loop, call_pure_results):
        from pypy.jit.metainterp.optimizeopt import optimize_trace
        from pypy.jit.metainterp.optimizeopt.util import args_dict

        self.loop = loop
        loop.call_pure_results = args_dict()
        if call_pure_results is not None:
            for k, v in call_pure_results.items():
                loop.call_pure_results[list(k)] = v
        metainterp_sd = FakeMetaInterpStaticData(self.cpu)
        if hasattr(self, 'vrefinfo'):
            metainterp_sd.virtualref_info = self.vrefinfo
        if hasattr(self, 'callinfocollection'):
            metainterp_sd.callinfocollection = self.callinfocollection
        #
        optimize_trace(metainterp_sd, loop, self.enable_opts)
Пример #4
0
    def _do_optimize_bridge(self, bridge, call_pure_results):
        from pypy.jit.metainterp.optimizeopt import optimize_trace
        from pypy.jit.metainterp.optimizeopt.util import args_dict

        self.bridge = bridge
        bridge.call_pure_results = args_dict()
        if call_pure_results is not None:
            for k, v in call_pure_results.items():
                bridge.call_pure_results[list(k)] = v
        metainterp_sd = FakeMetaInterpStaticData(self.cpu)
        if hasattr(self, 'vrefinfo'):
            metainterp_sd.virtualref_info = self.vrefinfo
        if hasattr(self, 'callinfocollection'):
            metainterp_sd.callinfocollection = self.callinfocollection
        #
        bridge.resume_at_jump_descr = FakeDescrWithSnapshot()
        optimize_trace(metainterp_sd, bridge, self.enable_opts)
Пример #5
0
    def _do_optimize_bridge(self, bridge, call_pure_results):
        from pypy.jit.metainterp.optimizeopt import optimize_bridge_1, build_opt_chain
        from pypy.jit.metainterp.optimizeopt.util import args_dict

        self.bridge = bridge
        bridge.call_pure_results = args_dict()
        if call_pure_results is not None:
            for k, v in call_pure_results.items():
                bridge.call_pure_results[list(k)] = v
        metainterp_sd = FakeMetaInterpStaticData(self.cpu)
        if hasattr(self, 'vrefinfo'):
            metainterp_sd.virtualref_info = self.vrefinfo
        if hasattr(self, 'callinfocollection'):
            metainterp_sd.callinfocollection = self.callinfocollection
        #
        d = {}
        for name in self.enable_opts.split(":"):
            d[name] = None
        optimize_bridge_1(metainterp_sd, bridge,  d)
Пример #6
0
    def __init__(self, metainterp_sd, loop, optimizations=None):
        self.metainterp_sd = metainterp_sd
        self.cpu = metainterp_sd.cpu
        self.loop = loop
        self.values = {}
        self.interned_refs = self.cpu.ts.new_ref_dict()
        self.resumedata_memo = resume.ResumeDataLoopMemo(metainterp_sd)
        self.bool_boxes = {}
        self.loop_invariant_results = {}
        self.pure_operations = args_dict()
        self.producer = {}
        self.pendingfields = []
        self.posponedop = None
        self.exception_might_have_happened = False
        self.quasi_immutable_deps = None
        self.newoperations = []
        if loop is not None:
            self.call_pure_results = loop.call_pure_results

        self.set_optimizations(optimizations)
Пример #7
0
Файл: pure.py Проект: njues/Sypy
 def __init__(self):
     self.posponedop = None
     self.pure_operations = args_dict()
     self.emitted_pure_operations = {}
Пример #8
0
 def __init__(self):
     self.posponedop = None
     self.pure_operations = args_dict()
     self.emitted_pure_operations = {}