Example #1
0
def optimize_bridge(metainterp_sd, old_loop_tokens, bridge):
    cpu = metainterp_sd.cpu    
    metainterp_sd.logger_noopt.log_loop(bridge.inputargs, bridge.operations)
    finder = BridgeSpecializationFinder(cpu)
    finder.find_nodes_bridge(bridge)
    for old_loop_token in old_loop_tokens:
        if finder.bridge_matches(old_loop_token.specnodes):
            bridge.operations[-1].descr = old_loop_token   # patch jump target
            optimize_bridge_1(metainterp_sd, bridge)
            return old_loop_token
    return None
Example #2
0
def _optimize_bridge(metainterp_sd, old_loop_tokens, bridge):
    cpu = metainterp_sd.cpu    
    metainterp_sd.logger_noopt.log_loop(bridge.inputargs, bridge.operations)
    finder = BridgeSpecializationFinder(cpu)
    finder.find_nodes_bridge(bridge)
    for old_loop_token in old_loop_tokens:
        if finder.bridge_matches(old_loop_token.specnodes):
            bridge.operations[-1].descr = old_loop_token   # patch jump target
            optimize_bridge_1(metainterp_sd, bridge)
            return old_loop_token
    return None
Example #3
0
def _optimize_bridge(metainterp_sd, old_loop_tokens, bridge, enable_opts,
                     inline_short_preamble, retraced=False):
    from pypy.jit.metainterp.optimizeopt import optimize_bridge_1
    bridge.logops = metainterp_sd.logger_noopt.log_loop(bridge.inputargs,
                                                        bridge.operations)
    if old_loop_tokens:
        old_loop_token = old_loop_tokens[0]
        bridge.operations[-1].setdescr(old_loop_token)   # patch jump target
        optimize_bridge_1(metainterp_sd, bridge, enable_opts,
                          inline_short_preamble, retraced)
        return old_loop_tokens[0]
        #return bridge.operations[-1].getdescr()
    return None
Example #4
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)