| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // ldr ip0, [pc, #(3 * kInstructionSize)] | 59 // ldr ip0, [pc, #(3 * kInstructionSize)] |
| 60 // blr ip0 | 60 // blr ip0 |
| 61 // hlt kHltBadCode @ code should not return, catch if it does. | 61 // hlt kHltBadCode @ code should not return, catch if it does. |
| 62 // <debug break return code ... | 62 // <debug break return code ... |
| 63 // ... entry point address (64 bits)> | 63 // ... entry point address (64 bits)> |
| 64 | 64 |
| 65 // The patching code must not overflow the space occupied by the return | 65 // The patching code must not overflow the space occupied by the return |
| 66 // sequence. | 66 // sequence. |
| 67 STATIC_ASSERT(Assembler::kJSRetSequenceInstructions >= 5); | 67 STATIC_ASSERT(Assembler::kJSRetSequenceInstructions >= 5); |
| 68 PatchingAssembler patcher(reinterpret_cast<Instruction*>(rinfo()->pc()), 5); | 68 PatchingAssembler patcher(reinterpret_cast<Instruction*>(rinfo()->pc()), 5); |
| 69 byte* entry = Isolate::Current()->debug()->debug_break_return()->entry(); | 69 byte* entry = |
| 70 debug_info_->GetIsolate()->debug()->debug_break_return()->entry(); |
| 70 | 71 |
| 71 // The first instruction of a patched return sequence must be a load literal | 72 // The first instruction of a patched return sequence must be a load literal |
| 72 // loading the address of the debug break return code. | 73 // loading the address of the debug break return code. |
| 73 patcher.LoadLiteral(ip0, 3 * kInstructionSize); | 74 patcher.LoadLiteral(ip0, 3 * kInstructionSize); |
| 74 // TODO(all): check the following is correct. | 75 // TODO(all): check the following is correct. |
| 75 // The debug break return code will push a frame and call statically compiled | 76 // The debug break return code will push a frame and call statically compiled |
| 76 // code. By using blr, even though control will not return after the branch, | 77 // code. By using blr, even though control will not return after the branch, |
| 77 // this call site will be registered in the frame (lr being saved as the pc | 78 // this call site will be registered in the frame (lr being saved as the pc |
| 78 // of the next instruction to execute for this frame). The debugger can now | 79 // of the next instruction to execute for this frame). The debugger can now |
| 79 // iterate on the frames to find call to debug break return code. | 80 // iterate on the frames to find call to debug break return code. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // ... entry point address (64 bits)> | 118 // ... entry point address (64 bits)> |
| 118 | 119 |
| 119 // TODO(all): consider adding a hlt instruction after the blr as we don't | 120 // TODO(all): consider adding a hlt instruction after the blr as we don't |
| 120 // expect control to return here. This implies increasing | 121 // expect control to return here. This implies increasing |
| 121 // kDebugBreakSlotInstructions to 5 instructions. | 122 // kDebugBreakSlotInstructions to 5 instructions. |
| 122 | 123 |
| 123 // The patching code must not overflow the space occupied by the return | 124 // The patching code must not overflow the space occupied by the return |
| 124 // sequence. | 125 // sequence. |
| 125 STATIC_ASSERT(Assembler::kDebugBreakSlotInstructions >= 4); | 126 STATIC_ASSERT(Assembler::kDebugBreakSlotInstructions >= 4); |
| 126 PatchingAssembler patcher(reinterpret_cast<Instruction*>(rinfo()->pc()), 4); | 127 PatchingAssembler patcher(reinterpret_cast<Instruction*>(rinfo()->pc()), 4); |
| 127 byte* entry = Isolate::Current()->debug()->debug_break_slot()->entry(); | 128 byte* entry = |
| 129 debug_info_->GetIsolate()->debug()->debug_break_slot()->entry(); |
| 128 | 130 |
| 129 // The first instruction of a patched debug break slot must be a load literal | 131 // The first instruction of a patched debug break slot must be a load literal |
| 130 // loading the address of the debug break slot code. | 132 // loading the address of the debug break slot code. |
| 131 patcher.LoadLiteral(ip0, 2 * kInstructionSize); | 133 patcher.LoadLiteral(ip0, 2 * kInstructionSize); |
| 132 // TODO(all): check the following is correct. | 134 // TODO(all): check the following is correct. |
| 133 // The debug break slot code will push a frame and call statically compiled | 135 // The debug break slot code will push a frame and call statically compiled |
| 134 // code. By using blr, event hough control will not return after the branch, | 136 // code. By using blr, event hough control will not return after the branch, |
| 135 // this call site will be registered in the frame (lr being saved as the pc | 137 // this call site will be registered in the frame (lr being saved as the pc |
| 136 // of the next instruction to execute for this frame). The debugger can now | 138 // of the next instruction to execute for this frame). The debugger can now |
| 137 // iterate on the frames to find call to debug break slot code. | 139 // iterate on the frames to find call to debug break slot code. |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 masm->Abort(kLiveEditFrameDroppingIsNotSupportedOnA64); | 382 masm->Abort(kLiveEditFrameDroppingIsNotSupportedOnA64); |
| 381 } | 383 } |
| 382 | 384 |
| 383 const bool Debug::kFrameDropperSupported = false; | 385 const bool Debug::kFrameDropperSupported = false; |
| 384 | 386 |
| 385 #endif // ENABLE_DEBUGGER_SUPPORT | 387 #endif // ENABLE_DEBUGGER_SUPPORT |
| 386 | 388 |
| 387 } } // namespace v8::internal | 389 } } // namespace v8::internal |
| 388 | 390 |
| 389 #endif // V8_TARGET_ARCH_A64 | 391 #endif // V8_TARGET_ARCH_A64 |
| OLD | NEW |