| 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 "v8.h" | 5 #include "v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
| 8 | 8 |
| 9 #include "codegen.h" | 9 #include "codegen.h" |
| 10 #include "debug.h" | 10 #include "debug.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // blr ip0 | 35 // blr ip0 |
| 36 // hlt kHltBadCode @ code should not return, catch if it does. | 36 // hlt kHltBadCode @ code should not return, catch if it does. |
| 37 // <debug break return code ... | 37 // <debug break return code ... |
| 38 // ... entry point address (64 bits)> | 38 // ... entry point address (64 bits)> |
| 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()->debug()->debug_break_return()->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.LoadLiteral(ip0, 3 * kInstructionSize); |
| 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. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 // TODO(all): consider adding a hlt instruction after the blr as we don't | 95 // TODO(all): consider adding a hlt instruction after the blr as we don't |
| 96 // expect control to return here. This implies increasing | 96 // expect control to return here. This implies increasing |
| 97 // kDebugBreakSlotInstructions to 5 instructions. | 97 // kDebugBreakSlotInstructions to 5 instructions. |
| 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()->debug()->debug_break_slot()->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.LoadLiteral(ip0, 2 * kInstructionSize); |
| 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. |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 | 347 |
| 348 void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { | 348 void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { |
| 349 masm->Abort(kLiveEditFrameDroppingIsNotSupportedOnARM64); | 349 masm->Abort(kLiveEditFrameDroppingIsNotSupportedOnARM64); |
| 350 } | 350 } |
| 351 | 351 |
| 352 const bool Debug::kFrameDropperSupported = false; | 352 const bool Debug::kFrameDropperSupported = false; |
| 353 | 353 |
| 354 } } // namespace v8::internal | 354 } } // namespace v8::internal |
| 355 | 355 |
| 356 #endif // V8_TARGET_ARCH_ARM64 | 356 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |