| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
| 8 | 8 |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/debug.h" | 10 #include "src/debug.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 // The patching code must not overflow the space occupied by the return | 40 // The patching code must not overflow the space occupied by the return |
| 41 // sequence. | 41 // sequence. |
| 42 STATIC_ASSERT(Assembler::kJSRetSequenceInstructions >= 5); | 42 STATIC_ASSERT(Assembler::kJSRetSequenceInstructions >= 5); |
| 43 PatchingAssembler patcher(reinterpret_cast<Instruction*>(rinfo()->pc()), 5); | 43 PatchingAssembler patcher(reinterpret_cast<Instruction*>(rinfo()->pc()), 5); |
| 44 byte* entry = | 44 byte* entry = |
| 45 debug_info_->GetIsolate()->builtins()->Return_DebugBreak()->entry(); | 45 debug_info_->GetIsolate()->builtins()->Return_DebugBreak()->entry(); |
| 46 | 46 |
| 47 // The first instruction of a patched return sequence must be a load literal | 47 // The first instruction of a patched return sequence must be a load literal |
| 48 // loading the address of the debug break return code. | 48 // loading the address of the debug break return code. |
| 49 patcher.LoadLiteral(ip0, 3 * kInstructionSize); | 49 patcher.ldr_pcrel(ip0, (3 * kInstructionSize) >> kLoadLiteralScaleLog2); |
| 50 // TODO(all): check the following is correct. | 50 // TODO(all): check the following is correct. |
| 51 // The debug break return code will push a frame and call statically compiled | 51 // The debug break return code will push a frame and call statically compiled |
| 52 // code. By using blr, even though control will not return after the branch, | 52 // code. By using blr, even though control will not return after the branch, |
| 53 // this call site will be registered in the frame (lr being saved as the pc | 53 // this call site will be registered in the frame (lr being saved as the pc |
| 54 // of the next instruction to execute for this frame). The debugger can now | 54 // of the next instruction to execute for this frame). The debugger can now |
| 55 // iterate on the frames to find call to debug break return code. | 55 // iterate on the frames to find call to debug break return code. |
| 56 patcher.blr(ip0); | 56 patcher.blr(ip0); |
| 57 patcher.hlt(kHltBadCode); | 57 patcher.hlt(kHltBadCode); |
| 58 patcher.dc64(reinterpret_cast<int64_t>(entry)); | 58 patcher.dc64(reinterpret_cast<int64_t>(entry)); |
| 59 } | 59 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 // The patching code must not overflow the space occupied by the return | 99 // The patching code must not overflow the space occupied by the return |
| 100 // sequence. | 100 // sequence. |
| 101 STATIC_ASSERT(Assembler::kDebugBreakSlotInstructions >= 4); | 101 STATIC_ASSERT(Assembler::kDebugBreakSlotInstructions >= 4); |
| 102 PatchingAssembler patcher(reinterpret_cast<Instruction*>(rinfo()->pc()), 4); | 102 PatchingAssembler patcher(reinterpret_cast<Instruction*>(rinfo()->pc()), 4); |
| 103 byte* entry = | 103 byte* entry = |
| 104 debug_info_->GetIsolate()->builtins()->Slot_DebugBreak()->entry(); | 104 debug_info_->GetIsolate()->builtins()->Slot_DebugBreak()->entry(); |
| 105 | 105 |
| 106 // The first instruction of a patched debug break slot must be a load literal | 106 // The first instruction of a patched debug break slot must be a load literal |
| 107 // loading the address of the debug break slot code. | 107 // loading the address of the debug break slot code. |
| 108 patcher.LoadLiteral(ip0, 2 * kInstructionSize); | 108 patcher.ldr_pcrel(ip0, (2 * kInstructionSize) >> kLoadLiteralScaleLog2); |
| 109 // TODO(all): check the following is correct. | 109 // TODO(all): check the following is correct. |
| 110 // The debug break slot code will push a frame and call statically compiled | 110 // The debug break slot code will push a frame and call statically compiled |
| 111 // code. By using blr, event hough control will not return after the branch, | 111 // code. By using blr, event hough control will not return after the branch, |
| 112 // this call site will be registered in the frame (lr being saved as the pc | 112 // this call site will be registered in the frame (lr being saved as the pc |
| 113 // of the next instruction to execute for this frame). The debugger can now | 113 // of the next instruction to execute for this frame). The debugger can now |
| 114 // iterate on the frames to find call to debug break slot code. | 114 // iterate on the frames to find call to debug break slot code. |
| 115 patcher.blr(ip0); | 115 patcher.blr(ip0); |
| 116 patcher.dc64(reinterpret_cast<int64_t>(entry)); | 116 patcher.dc64(reinterpret_cast<int64_t>(entry)); |
| 117 } | 117 } |
| 118 | 118 |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { | 348 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { |
| 349 masm->Abort(kLiveEditFrameDroppingIsNotSupportedOnARM64); | 349 masm->Abort(kLiveEditFrameDroppingIsNotSupportedOnARM64); |
| 350 } | 350 } |
| 351 | 351 |
| 352 | 352 |
| 353 const bool LiveEdit::kFrameDropperSupported = false; | 353 const bool LiveEdit::kFrameDropperSupported = false; |
| 354 | 354 |
| 355 } } // namespace v8::internal | 355 } } // namespace v8::internal |
| 356 | 356 |
| 357 #endif // V8_TARGET_ARCH_ARM64 | 357 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |