<s> from pypy . jit . metainterp . optimizefindnode import PerfectSpecializationFinder <EOL> from pypy . jit . metainterp . optimizeopt import optimize_loop_1 <EOL> from pypy . jit . metainterp . specnode import equals_specnodes <EOL> def optimize_loop ( metainterp_sd , old_loop_tokens , loop ) : <EOL> cpu = metainterp_sd . cpu <EOL> metainterp_sd . logger_noopt . log_loop ( loop . inputargs , loop . operations ) <EOL> finder = PerfectSpecializationFinder ( cpu ) <EOL> finder . find_nodes_loop ( loop ) <EOL> for old_loop_token in old_loop_tokens : <EOL> if equals_specnodes ( old_loop_token . specnodes , loop . token . specnodes ) : <EOL> return old_loop_token <EOL> optimize_loop_1 ( metainterp_sd , loop ) <EOL> return None <EOL> from pypy . jit . metainterp . optimizefindnode import BridgeSpecializationFinder <EOL> from pypy . jit . metainterp . optimizeopt import optimize_bridge_1 <EOL> def optimize_bridge ( metainterp_sd , old_loop_tokens , bridge ) : <EOL> cpu = metainterp_sd . cpu <EOL> metainterp_sd . logger_noopt . log_loop ( bridge . inputargs , bridge . operations ) <EOL> finder = BridgeSpecializationFinder ( cpu ) <EOL> finder . find_nodes_bridge ( bridge ) <EOL> for old_loop_token in old_loop_tokens : <EOL> if finder . bridge_matches ( old_loop_token . specnodes ) : <EOL> bridge . operations [ - <NUM_LIT:1> ] . descr = old_loop_token <EOL> optimize_bridge_1 ( metainterp_sd , bridge ) <EOL> return old_loop_token <EOL> return None </s>
