예제 #1
0
def _optimize_loop(metainterp_sd, old_loop_tokens, loop, enable_opts):
    from pypy.jit.metainterp.optimizeopt import optimize_loop_1
    loop.logops = metainterp_sd.logger_noopt.log_loop(loop.inputargs,
                                                      loop.operations)
    # XXX do we really still need a list?
    if old_loop_tokens:
        return old_loop_tokens[0]
    optimize_loop_1(metainterp_sd, loop, enable_opts)
    return None
예제 #2
0
파일: optimize.py 프로젝트: enyst/plexnet
def optimize_loop(metainterp_sd, old_loop_tokens, loop):
    cpu = metainterp_sd.cpu
    metainterp_sd.logger_noopt.log_loop(loop.inputargs, loop.operations)
    finder = PerfectSpecializationFinder(cpu)
    finder.find_nodes_loop(loop)
    for old_loop_token in old_loop_tokens:
        if equals_specnodes(old_loop_token.specnodes, loop.token.specnodes):
            return old_loop_token
    optimize_loop_1(metainterp_sd, loop)
    return None
예제 #3
0
def _optimize_loop(metainterp_sd, old_loop_tokens, loop):
    cpu = metainterp_sd.cpu
    metainterp_sd.logger_noopt.log_loop(loop.inputargs, loop.operations)
    finder = PerfectSpecializationFinder(cpu)
    finder.find_nodes_loop(loop)
    for old_loop_token in old_loop_tokens:
        if equals_specnodes(old_loop_token.specnodes, loop.token.specnodes):
            return old_loop_token
    optimize_loop_1(metainterp_sd, loop)
    return None
예제 #4
0
    def _do_optimize_loop(self, loop, call_pure_results):
        from pypy.jit.metainterp.optimizeopt import optimize_loop_1
        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_loop_1(metainterp_sd, loop, self.enable_opts)