| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
| 6 | 6 |
| 7 #include "src/debug/debug.h" | 7 #include "src/debug/debug.h" |
| 8 | 8 |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/debug/liveedit.h" | 10 #include "src/debug/liveedit.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 DCHECK(code->is_debug_stub()); | 46 DCHECK(code->is_debug_stub()); |
| 47 CodePatcher patcher(isolate, pc, Assembler::kDebugBreakSlotInstructions); | 47 CodePatcher patcher(isolate, pc, Assembler::kDebugBreakSlotInstructions); |
| 48 // Patch the code changing the debug break slot code from: | 48 // Patch the code changing the debug break slot code from: |
| 49 // nop(DEBUG_BREAK_NOP) - nop(1) is sll(zero_reg, zero_reg, 1) | 49 // nop(DEBUG_BREAK_NOP) - nop(1) is sll(zero_reg, zero_reg, 1) |
| 50 // nop(DEBUG_BREAK_NOP) | 50 // nop(DEBUG_BREAK_NOP) |
| 51 // nop(DEBUG_BREAK_NOP) | 51 // nop(DEBUG_BREAK_NOP) |
| 52 // nop(DEBUG_BREAK_NOP) | 52 // nop(DEBUG_BREAK_NOP) |
| 53 // to a call to the debug break slot code. | 53 // to a call to the debug break slot code. |
| 54 // li t9, address (lui t9 / ori t9 instruction pair) | 54 // li t9, address (lui t9 / ori t9 instruction pair) |
| 55 // call t9 (jalr t9 / nop instruction pair) | 55 // call t9 (jalr t9 / nop instruction pair) |
| 56 |
| 57 // Add a label for checking the size of the code used for returning. |
| 58 Label check_codesize; |
| 59 patcher.masm()->bind(&check_codesize); |
| 56 patcher.masm()->li(v8::internal::t9, | 60 patcher.masm()->li(v8::internal::t9, |
| 57 Operand(reinterpret_cast<int32_t>(code->entry()))); | 61 Operand(reinterpret_cast<int32_t>(code->entry()))); |
| 58 patcher.masm()->Call(v8::internal::t9); | 62 patcher.masm()->Call(v8::internal::t9); |
| 63 |
| 64 // Check that the size of the code generated is as expected. |
| 65 DCHECK_EQ(Assembler::kDebugBreakSlotLength, |
| 66 patcher.masm()->SizeOfCodeGeneratedSince(&check_codesize)); |
| 59 } | 67 } |
| 60 | 68 |
| 61 bool DebugCodegen::DebugBreakSlotIsPatched(Address pc) { | 69 bool DebugCodegen::DebugBreakSlotIsPatched(Address pc) { |
| 62 Instr current_instr = Assembler::instr_at(pc); | 70 Instr current_instr = Assembler::instr_at(pc); |
| 63 return !Assembler::IsNop(current_instr, Assembler::DEBUG_BREAK_NOP); | 71 return !Assembler::IsNop(current_instr, Assembler::DEBUG_BREAK_NOP); |
| 64 } | 72 } |
| 65 | 73 |
| 66 void DebugCodegen::GenerateDebugBreakStub(MacroAssembler* masm, | 74 void DebugCodegen::GenerateDebugBreakStub(MacroAssembler* masm, |
| 67 DebugBreakCallHelperMode mode) { | 75 DebugBreakCallHelperMode mode) { |
| 68 __ RecordComment("Debug break"); | 76 __ RecordComment("Debug break"); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 147 |
| 140 | 148 |
| 141 const bool LiveEdit::kFrameDropperSupported = true; | 149 const bool LiveEdit::kFrameDropperSupported = true; |
| 142 | 150 |
| 143 #undef __ | 151 #undef __ |
| 144 | 152 |
| 145 } // namespace internal | 153 } // namespace internal |
| 146 } // namespace v8 | 154 } // namespace v8 |
| 147 | 155 |
| 148 #endif // V8_TARGET_ARCH_MIPS | 156 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |