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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
10 | 10 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 Register scratch = x10; | 85 Register scratch = x10; |
86 { | 86 { |
87 FrameScope scope(masm, StackFrame::INTERNAL); | 87 FrameScope scope(masm, StackFrame::INTERNAL); |
88 | 88 |
89 // Load padding words on stack. | 89 // Load padding words on stack. |
90 __ Mov(scratch, Smi::FromInt(LiveEdit::kFramePaddingValue)); | 90 __ Mov(scratch, Smi::FromInt(LiveEdit::kFramePaddingValue)); |
91 __ PushMultipleTimes(scratch, LiveEdit::kFramePaddingInitialSize); | 91 __ PushMultipleTimes(scratch, LiveEdit::kFramePaddingInitialSize); |
92 __ Mov(scratch, Smi::FromInt(LiveEdit::kFramePaddingInitialSize)); | 92 __ Mov(scratch, Smi::FromInt(LiveEdit::kFramePaddingInitialSize)); |
93 __ Push(scratch); | 93 __ Push(scratch); |
94 | 94 |
95 // Push arguments for DebugBreak call. | 95 if (mode == SAVE_RESULT_REGISTER) __ Push(x0); |
96 if (mode == SAVE_RESULT_REGISTER) { | 96 |
97 // Break on return. | 97 __ Mov(x0, 0); // No arguments. |
98 __ Push(x0); | |
99 } else { | |
100 // Non-return breaks. | |
101 __ Push(masm->isolate()->factory()->the_hole_value()); | |
102 } | |
103 __ Mov(x0, 1); | |
104 __ Mov(x1, ExternalReference(Runtime::FunctionForId(Runtime::kDebugBreak), | 98 __ Mov(x1, ExternalReference(Runtime::FunctionForId(Runtime::kDebugBreak), |
105 masm->isolate())); | 99 masm->isolate())); |
106 | 100 |
107 CEntryStub stub(masm->isolate(), 1); | 101 CEntryStub stub(masm->isolate(), 1); |
108 __ CallStub(&stub); | 102 __ CallStub(&stub); |
109 | 103 |
110 if (FLAG_debug_code) { | 104 if (FLAG_debug_code) { |
111 for (int i = 0; i < kNumJSCallerSaved; i++) { | 105 for (int i = 0; i < kNumJSCallerSaved; i++) { |
112 Register reg = Register::XRegFromCode(JSCallerSavedCode(i)); | 106 Register reg = Register::XRegFromCode(JSCallerSavedCode(i)); |
113 // Do not clobber x0 if SAVE_RESULT_REGISTER is set. It will | 107 __ Mov(reg, Operand(kDebugZapValue)); |
114 // contain return value of the function. | |
115 if (!(reg.is(x0) && SAVE_RESULT_REGISTER)) { | |
116 __ Mov(reg, Operand(kDebugZapValue)); | |
117 } | |
118 } | 108 } |
119 } | 109 } |
120 | 110 |
| 111 // Restore the register values from the expression stack. |
| 112 if (mode == SAVE_RESULT_REGISTER) __ Pop(x0); |
| 113 |
121 // Don't bother removing padding bytes pushed on the stack | 114 // Don't bother removing padding bytes pushed on the stack |
122 // as the frame is going to be restored right away. | 115 // as the frame is going to be restored right away. |
123 | 116 |
124 // Leave the internal frame. | 117 // Leave the internal frame. |
125 } | 118 } |
126 | 119 |
127 // Now that the break point has been handled, resume normal execution by | 120 // Now that the break point has been handled, resume normal execution by |
128 // jumping to the target address intended by the caller and that was | 121 // jumping to the target address intended by the caller and that was |
129 // overwritten by the address of DebugBreakXXX. | 122 // overwritten by the address of DebugBreakXXX. |
130 ExternalReference after_break_target = | 123 ExternalReference after_break_target = |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 __ Br(scratch); | 158 __ Br(scratch); |
166 } | 159 } |
167 | 160 |
168 | 161 |
169 const bool LiveEdit::kFrameDropperSupported = true; | 162 const bool LiveEdit::kFrameDropperSupported = true; |
170 | 163 |
171 } // namespace internal | 164 } // namespace internal |
172 } // namespace v8 | 165 } // namespace v8 |
173 | 166 |
174 #endif // V8_TARGET_ARCH_ARM64 | 167 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |