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_ARM | 5 #if V8_TARGET_ARCH_ARM |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 74 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
75 | 75 |
76 // Load padding words on stack. | 76 // Load padding words on stack. |
77 __ mov(ip, Operand(Smi::FromInt(LiveEdit::kFramePaddingValue))); | 77 __ mov(ip, Operand(Smi::FromInt(LiveEdit::kFramePaddingValue))); |
78 for (int i = 0; i < LiveEdit::kFramePaddingInitialSize; i++) { | 78 for (int i = 0; i < LiveEdit::kFramePaddingInitialSize; i++) { |
79 __ push(ip); | 79 __ push(ip); |
80 } | 80 } |
81 __ mov(ip, Operand(Smi::FromInt(LiveEdit::kFramePaddingInitialSize))); | 81 __ mov(ip, Operand(Smi::FromInt(LiveEdit::kFramePaddingInitialSize))); |
82 __ push(ip); | 82 __ push(ip); |
83 | 83 |
84 // Push arguments for DebugBreak call. | 84 if (mode == SAVE_RESULT_REGISTER) __ push(r0); |
85 if (mode == SAVE_RESULT_REGISTER) { | 85 |
86 // Break on return. | 86 __ mov(r0, Operand::Zero()); // no arguments |
87 __ push(r0); | |
88 } else { | |
89 // Non-return breaks. | |
90 __ Push(masm->isolate()->factory()->the_hole_value()); | |
91 } | |
92 __ mov(r0, Operand(1)); | |
93 __ mov(r1, | 87 __ mov(r1, |
94 Operand(ExternalReference( | 88 Operand(ExternalReference( |
95 Runtime::FunctionForId(Runtime::kDebugBreak), masm->isolate()))); | 89 Runtime::FunctionForId(Runtime::kDebugBreak), masm->isolate()))); |
96 | 90 |
97 CEntryStub ceb(masm->isolate(), 1); | 91 CEntryStub ceb(masm->isolate(), 1); |
98 __ CallStub(&ceb); | 92 __ CallStub(&ceb); |
99 | 93 |
100 if (FLAG_debug_code) { | 94 if (FLAG_debug_code) { |
101 for (int i = 0; i < kNumJSCallerSaved; i++) { | 95 for (int i = 0; i < kNumJSCallerSaved; i++) { |
102 Register reg = {JSCallerSavedCode(i)}; | 96 Register reg = {JSCallerSavedCode(i)}; |
103 // Do not clobber r0 if SAVE_RESULT_REGISTER is set. It will | 97 __ mov(reg, Operand(kDebugZapValue)); |
104 // contain return value of the function. | |
105 if (!(reg.is(r0) && SAVE_RESULT_REGISTER)) { | |
106 __ mov(reg, Operand(kDebugZapValue)); | |
107 } | |
108 } | 98 } |
109 } | 99 } |
110 | 100 |
| 101 if (mode == SAVE_RESULT_REGISTER) __ pop(r0); |
| 102 |
111 // Don't bother removing padding bytes pushed on the stack | 103 // Don't bother removing padding bytes pushed on the stack |
112 // as the frame is going to be restored right away. | 104 // as the frame is going to be restored right away. |
113 | 105 |
114 // Leave the internal frame. | 106 // Leave the internal frame. |
115 } | 107 } |
116 | 108 |
117 // Now that the break point has been handled, resume normal execution by | 109 // Now that the break point has been handled, resume normal execution by |
118 // jumping to the target address intended by the caller and that was | 110 // jumping to the target address intended by the caller and that was |
119 // overwritten by the address of DebugBreakXXX. | 111 // overwritten by the address of DebugBreakXXX. |
120 ExternalReference after_break_target = | 112 ExternalReference after_break_target = |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 147 |
156 | 148 |
157 const bool LiveEdit::kFrameDropperSupported = true; | 149 const bool LiveEdit::kFrameDropperSupported = true; |
158 | 150 |
159 #undef __ | 151 #undef __ |
160 | 152 |
161 } // namespace internal | 153 } // namespace internal |
162 } // namespace v8 | 154 } // namespace v8 |
163 | 155 |
164 #endif // V8_TARGET_ARCH_ARM | 156 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |