Author: Hakan Ardo <ha...@debian.org> Branch: jit-targets Changeset: r48832:9b87dd5eeb7f Date: 2011-11-06 17:05 +0100 http://bitbucket.org/pypy/pypy/changeset/9b87dd5eeb7f/
Log: bridge support diff --git a/pypy/jit/metainterp/compile.py b/pypy/jit/metainterp/compile.py --- a/pypy/jit/metainterp/compile.py +++ b/pypy/jit/metainterp/compile.py @@ -426,13 +426,13 @@ # We managed to create a bridge. Attach the new operations # to the corresponding guard_op and compile from there assert metainterp.resumekey_original_loop_token is not None - new_loop.token = metainterp.resumekey_original_loop_token + new_loop.original_jitcell_token = metainterp.resumekey_original_loop_token inputargs = metainterp.history.inputargs if not we_are_translated(): self._debug_suboperations = new_loop.operations send_bridge_to_backend(metainterp.jitdriver_sd, metainterp.staticdata, self, inputargs, new_loop.operations, - new_loop.token) + new_loop.original_jitcell_token) def copy_all_attributes_into(self, res): # XXX a bit ugly to have to list them all here diff --git a/pypy/jit/metainterp/optimizeopt/unroll.py b/pypy/jit/metainterp/optimizeopt/unroll.py --- a/pypy/jit/metainterp/optimizeopt/unroll.py +++ b/pypy/jit/metainterp/optimizeopt/unroll.py @@ -442,7 +442,7 @@ debug_start('jit-log-virtualstate') virtual_state.debug_print("Looking for ") - for target in procedure_token.target_tokens: + for target in cell_token.target_tokens: if not target.virtual_state: continue ok = False @@ -481,24 +481,24 @@ descr = target.start_resumedescr.clone_if_mutable() inliner.inline_descr_inplace(descr) guard.setdescr(descr) - self.emit_operation(guard) + self.optimizer.send_extra_operation(guard) try: for shop in target.short_preamble[1:]: newop = inliner.inline_op(shop) - self.emit_operation(newop) + self.optimizer.send_extra_operation(newop) except InvalidLoop: debug_print("Inlining failed unexpectedly", "jumping to preamble instead") assert False, "FIXME: Construct jump op" - self.emit_operation(op) + self.optimizer.send_extra_operation(op) return True debug_stop('jit-log-virtualstate') - retraced_count = procedure_token.retraced_count + retraced_count = cell_token.retraced_count limit = self.optimizer.metainterp_sd.warmrunnerdesc.memory_manager.retrace_limit if not self.retraced and retraced_count<limit: - procedure_token.retraced_count += 1 + cell_token.retraced_count += 1 return False diff --git a/pypy/jit/metainterp/pyjitpl.py b/pypy/jit/metainterp/pyjitpl.py --- a/pypy/jit/metainterp/pyjitpl.py +++ b/pypy/jit/metainterp/pyjitpl.py @@ -2037,20 +2037,20 @@ def compile_trace(self, live_arg_boxes): num_green_args = self.jitdriver_sd.num_green_args greenkey = live_arg_boxes[:num_green_args] - target_procedure = self.get_procedure_token(greenkey) - if not target_procedure: + target_jitcell_token = self.get_procedure_token(greenkey) + if not target_jitcell_token: return - self.history.record(rop.LABEL, live_arg_boxes[num_green_args:], None, - descr=TargetToken(target_procedure)) + self.history.record(rop.JUMP, live_arg_boxes[num_green_args:], None, + descr=target_jitcell_token) try: - target_token = compile.compile_new_bridge(self, self.resumekey) + target_token = compile.compile_trace(self, self.resumekey) finally: self.history.operations.pop() # remove the JUMP if target_token is not None: # raise if it *worked* correctly self.history.inputargs = None self.history.operations = None - raise GenerateMergePoint(live_arg_boxes, target_token.procedure_token) + raise GenerateMergePoint(live_arg_boxes, target_token.cell_token) def compile_bridge_and_loop(self, original_boxes, live_arg_boxes, start, bridge_arg_boxes, start_resumedescr): _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit