Author: Richard Plangger <planri...@gmail.com> Branch: new-jit-log Changeset: r85843:d74d50b47077 Date: 2016-07-24 15:57 +0200 http://bitbucket.org/pypy/pypy/changeset/d74d50b47077/
Log: arm & ppc changes to assembler to emit rewritten loop diff --git a/rpython/jit/backend/arm/assembler.py b/rpython/jit/backend/arm/assembler.py --- a/rpython/jit/backend/arm/assembler.py +++ b/rpython/jit/backend/arm/assembler.py @@ -633,9 +633,17 @@ 'loop.asm') ops_offset = self.mc.ops_offset - if logger is not None: - logger.log_loop(inputargs, operations, 0, "rewritten", - name=loopname, ops_offset=ops_offset) + + if logger: + log = logger.log_trace(jl.MARK_TRACE_ASM, None, self.mc) + log.write(inputargs, operations, ops_offset=ops_offset) + + # legacy + if logger.logger_ops: + logger.logger_ops.log_loop(inputargs, operations, 0, + "rewritten", name=loopname, + ops_offset=ops_offset) + self.teardown() debug_start("jit-backend-addr") @@ -735,9 +743,18 @@ frame_depth_no_fixed_size + JITFRAME_FIXED_SIZE) self.fixup_target_tokens(rawstart) self.update_frame_depth(frame_depth) + if logger: - logger.log_bridge(inputargs, operations, "rewritten", faildescr, - ops_offset=ops_offset) + log = logger.log_trace(jl.MARK_TRACE_ASM, None, self.mc) + log.write(inputargs, operations, ops_offset) + # log that the already written bridge is stitched to a descr! + logger.log_patch_guard(descr_number, rawstart) + + # legacy + if logger.logger_ops: + logger.logger_ops.log_bridge(inputargs, operations, "rewritten", + faildescr, ops_offset=ops_offset) + self.teardown() return AsmInfo(ops_offset, startpos + rawstart, codeendpos - startpos) diff --git a/rpython/jit/backend/ppc/ppc_assembler.py b/rpython/jit/backend/ppc/ppc_assembler.py --- a/rpython/jit/backend/ppc/ppc_assembler.py +++ b/rpython/jit/backend/ppc/ppc_assembler.py @@ -36,6 +36,7 @@ from rpython.rlib.jit import AsmInfo from rpython.rlib.objectmodel import compute_unique_id from rpython.rlib.rarithmetic import r_uint +from rpython.rlib.rjitlog import rjitlog as jl memcpy_fn = rffi.llexternal('memcpy', [llmemory.Address, llmemory.Address, rffi.SIZE_T], lltype.Void, @@ -794,9 +795,16 @@ looptoken._ppc_fullsize = full_size looptoken._ppc_ops_offset = ops_offset looptoken._ll_function_addr = rawstart + if logger: - logger.log_loop(inputargs, operations, 0, "rewritten", - name=loopname, ops_offset=ops_offset) + log = logger.log_trace(jl.MARK_TRACE_ASM, None, self.mc) + log.write(inputargs, operations, ops_offset=ops_offset) + + # legacy + if logger.logger_ops: + logger.logger_ops.log_loop(inputargs, operations, 0, + "rewritten", name=loopname, + ops_offset=ops_offset) self.fixup_target_tokens(rawstart) self.teardown() @@ -863,9 +871,18 @@ ops_offset = self.mc.ops_offset frame_depth = max(self.current_clt.frame_info.jfi_frame_depth, frame_depth_no_fixed_size + JITFRAME_FIXED_SIZE) + if logger: - logger.log_bridge(inputargs, operations, "rewritten", - ops_offset=ops_offset) + log = logger.log_trace(jl.MARK_TRACE_ASM, None, self.mc) + log.write(inputargs, operations, ops_offset) + # log that the already written bridge is stitched to a descr! + logger.log_patch_guard(descr_number, rawstart) + + # legacy + if logger.logger_ops: + logger.logger_ops.log_bridge(inputargs, operations, "rewritten", + faildescr, ops_offset=ops_offset) + self.fixup_target_tokens(rawstart) self.update_frame_depth(frame_depth) self.teardown() diff --git a/rpython/jit/backend/x86/assembler.py b/rpython/jit/backend/x86/assembler.py --- a/rpython/jit/backend/x86/assembler.py +++ b/rpython/jit/backend/x86/assembler.py @@ -613,6 +613,7 @@ ops_offset = self.mc.ops_offset frame_depth = max(self.current_clt.frame_info.jfi_frame_depth, frame_depth_no_fixed_size + JITFRAME_FIXED_SIZE) + if logger: log = logger.log_trace(jl.MARK_TRACE_ASM, None, self.mc) log.write(inputargs, operations, ops_offset) @@ -623,6 +624,7 @@ if logger.logger_ops: logger.logger_ops.log_bridge(inputargs, operations, "rewritten", faildescr, ops_offset=ops_offset) + self.fixup_target_tokens(rawstart) self.update_frame_depth(frame_depth) self.teardown() _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit