OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 Assembler::kDebugBreakSlotInstructions); | 125 Assembler::kDebugBreakSlotInstructions); |
126 } | 126 } |
127 | 127 |
128 | 128 |
129 #define __ ACCESS_MASM(masm) | 129 #define __ ACCESS_MASM(masm) |
130 | 130 |
131 | 131 |
132 static void Generate_DebugBreakCallHelper(MacroAssembler* masm, | 132 static void Generate_DebugBreakCallHelper(MacroAssembler* masm, |
133 RegList object_regs, | 133 RegList object_regs, |
134 RegList non_object_regs) { | 134 RegList non_object_regs) { |
135 { | 135 __ EnterInternalFrame(); |
136 FrameScope scope(masm, StackFrame::INTERNAL); | |
137 | 136 |
138 // Store the registers containing live values on the expression stack to | 137 // Store the registers containing live values on the expression stack to |
139 // make sure that these are correctly updated during GC. Non object values | 138 // make sure that these are correctly updated during GC. Non object values |
140 // are stored as a smi causing it to be untouched by GC. | 139 // are stored as a smi causing it to be untouched by GC. |
141 ASSERT((object_regs & ~kJSCallerSaved) == 0); | 140 ASSERT((object_regs & ~kJSCallerSaved) == 0); |
142 ASSERT((non_object_regs & ~kJSCallerSaved) == 0); | 141 ASSERT((non_object_regs & ~kJSCallerSaved) == 0); |
143 ASSERT((object_regs & non_object_regs) == 0); | 142 ASSERT((object_regs & non_object_regs) == 0); |
144 if ((object_regs | non_object_regs) != 0) { | 143 if ((object_regs | non_object_regs) != 0) { |
145 for (int i = 0; i < kNumJSCallerSaved; i++) { | 144 for (int i = 0; i < kNumJSCallerSaved; i++) { |
146 int r = JSCallerSavedCode(i); | 145 int r = JSCallerSavedCode(i); |
147 Register reg = { r }; | 146 Register reg = { r }; |
148 if ((non_object_regs & (1 << r)) != 0) { | 147 if ((non_object_regs & (1 << r)) != 0) { |
149 if (FLAG_debug_code) { | 148 if (FLAG_debug_code) { |
150 __ tst(reg, Operand(0xc0000000)); | 149 __ tst(reg, Operand(0xc0000000)); |
151 __ Assert(eq, "Unable to encode value as smi"); | 150 __ Assert(eq, "Unable to encode value as smi"); |
152 } | |
153 __ mov(reg, Operand(reg, LSL, kSmiTagSize)); | |
154 } | 151 } |
| 152 __ mov(reg, Operand(reg, LSL, kSmiTagSize)); |
155 } | 153 } |
156 __ stm(db_w, sp, object_regs | non_object_regs); | |
157 } | 154 } |
| 155 __ stm(db_w, sp, object_regs | non_object_regs); |
| 156 } |
158 | 157 |
159 #ifdef DEBUG | 158 #ifdef DEBUG |
160 __ RecordComment("// Calling from debug break to runtime - come in - over"); | 159 __ RecordComment("// Calling from debug break to runtime - come in - over"); |
161 #endif | 160 #endif |
162 __ mov(r0, Operand(0, RelocInfo::NONE)); // no arguments | 161 __ mov(r0, Operand(0, RelocInfo::NONE)); // no arguments |
163 __ mov(r1, Operand(ExternalReference::debug_break(masm->isolate()))); | 162 __ mov(r1, Operand(ExternalReference::debug_break(masm->isolate()))); |
164 | 163 |
165 CEntryStub ceb(1); | 164 CEntryStub ceb(1); |
166 __ CallStub(&ceb); | 165 __ CallStub(&ceb); |
167 | 166 |
168 // Restore the register values from the expression stack. | 167 // Restore the register values from the expression stack. |
169 if ((object_regs | non_object_regs) != 0) { | 168 if ((object_regs | non_object_regs) != 0) { |
170 __ ldm(ia_w, sp, object_regs | non_object_regs); | 169 __ ldm(ia_w, sp, object_regs | non_object_regs); |
171 for (int i = 0; i < kNumJSCallerSaved; i++) { | 170 for (int i = 0; i < kNumJSCallerSaved; i++) { |
172 int r = JSCallerSavedCode(i); | 171 int r = JSCallerSavedCode(i); |
173 Register reg = { r }; | 172 Register reg = { r }; |
174 if ((non_object_regs & (1 << r)) != 0) { | 173 if ((non_object_regs & (1 << r)) != 0) { |
175 __ mov(reg, Operand(reg, LSR, kSmiTagSize)); | 174 __ mov(reg, Operand(reg, LSR, kSmiTagSize)); |
176 } | 175 } |
177 if (FLAG_debug_code && | 176 if (FLAG_debug_code && |
178 (((object_regs |non_object_regs) & (1 << r)) == 0)) { | 177 (((object_regs |non_object_regs) & (1 << r)) == 0)) { |
179 __ mov(reg, Operand(kDebugZapValue)); | 178 __ mov(reg, Operand(kDebugZapValue)); |
180 } | |
181 } | 179 } |
182 } | 180 } |
| 181 } |
183 | 182 |
184 // Leave the internal frame. | 183 __ LeaveInternalFrame(); |
185 } | |
186 | 184 |
187 // Now that the break point has been handled, resume normal execution by | 185 // Now that the break point has been handled, resume normal execution by |
188 // jumping to the target address intended by the caller and that was | 186 // jumping to the target address intended by the caller and that was |
189 // overwritten by the address of DebugBreakXXX. | 187 // overwritten by the address of DebugBreakXXX. |
190 ExternalReference after_break_target = | 188 ExternalReference after_break_target = |
191 ExternalReference(Debug_Address::AfterBreakTarget(), masm->isolate()); | 189 ExternalReference(Debug_Address::AfterBreakTarget(), masm->isolate()); |
192 __ mov(ip, Operand(after_break_target)); | 190 __ mov(ip, Operand(after_break_target)); |
193 __ ldr(ip, MemOperand(ip)); | 191 __ ldr(ip, MemOperand(ip)); |
194 __ Jump(ip); | 192 __ Jump(ip); |
195 } | 193 } |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 | 308 |
311 #undef __ | 309 #undef __ |
312 | 310 |
313 | 311 |
314 | 312 |
315 #endif // ENABLE_DEBUGGER_SUPPORT | 313 #endif // ENABLE_DEBUGGER_SUPPORT |
316 | 314 |
317 } } // namespace v8::internal | 315 } } // namespace v8::internal |
318 | 316 |
319 #endif // V8_TARGET_ARCH_ARM | 317 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |