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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } | 117 } |
118 | 118 |
119 | 119 |
120 #define __ ACCESS_MASM(masm) | 120 #define __ ACCESS_MASM(masm) |
121 | 121 |
122 | 122 |
123 | 123 |
124 static void Generate_DebugBreakCallHelper(MacroAssembler* masm, | 124 static void Generate_DebugBreakCallHelper(MacroAssembler* masm, |
125 RegList object_regs, | 125 RegList object_regs, |
126 RegList non_object_regs) { | 126 RegList non_object_regs) { |
127 __ EnterInternalFrame(); | 127 { |
| 128 FrameScope scope(masm, StackFrame::INTERNAL); |
128 | 129 |
129 // Store the registers containing live values on the expression stack to | 130 // Store the registers containing live values on the expression stack to |
130 // make sure that these are correctly updated during GC. Non object values | 131 // make sure that these are correctly updated during GC. Non object values |
131 // are stored as a smi causing it to be untouched by GC. | 132 // are stored as a smi causing it to be untouched by GC. |
132 ASSERT((object_regs & ~kJSCallerSaved) == 0); | 133 ASSERT((object_regs & ~kJSCallerSaved) == 0); |
133 ASSERT((non_object_regs & ~kJSCallerSaved) == 0); | 134 ASSERT((non_object_regs & ~kJSCallerSaved) == 0); |
134 ASSERT((object_regs & non_object_regs) == 0); | 135 ASSERT((object_regs & non_object_regs) == 0); |
135 if ((object_regs | non_object_regs) != 0) { | 136 if ((object_regs | non_object_regs) != 0) { |
136 for (int i = 0; i < kNumJSCallerSaved; i++) { | 137 for (int i = 0; i < kNumJSCallerSaved; i++) { |
137 int r = JSCallerSavedCode(i); | 138 int r = JSCallerSavedCode(i); |
138 Register reg = { r }; | 139 Register reg = { r }; |
139 if ((non_object_regs & (1 << r)) != 0) { | 140 if ((non_object_regs & (1 << r)) != 0) { |
140 if (FLAG_debug_code) { | 141 if (FLAG_debug_code) { |
141 __ And(at, reg, 0xc0000000); | 142 __ And(at, reg, 0xc0000000); |
142 __ Assert(eq, "Unable to encode value as smi", at, Operand(zero_reg)); | 143 __ Assert( |
| 144 eq, "Unable to encode value as smi", at, Operand(zero_reg)); |
| 145 } |
| 146 __ sll(reg, reg, kSmiTagSize); |
143 } | 147 } |
144 __ sll(reg, reg, kSmiTagSize); | 148 } |
| 149 __ MultiPush(object_regs | non_object_regs); |
| 150 } |
| 151 |
| 152 #ifdef DEBUG |
| 153 __ RecordComment("// Calling from debug break to runtime - come in - over"); |
| 154 #endif |
| 155 __ mov(a0, zero_reg); // No arguments. |
| 156 __ li(a1, Operand(ExternalReference::debug_break(masm->isolate()))); |
| 157 |
| 158 CEntryStub ceb(1); |
| 159 __ CallStub(&ceb); |
| 160 |
| 161 // Restore the register values from the expression stack. |
| 162 if ((object_regs | non_object_regs) != 0) { |
| 163 __ MultiPop(object_regs | non_object_regs); |
| 164 for (int i = 0; i < kNumJSCallerSaved; i++) { |
| 165 int r = JSCallerSavedCode(i); |
| 166 Register reg = { r }; |
| 167 if ((non_object_regs & (1 << r)) != 0) { |
| 168 __ srl(reg, reg, kSmiTagSize); |
| 169 } |
| 170 if (FLAG_debug_code && |
| 171 (((object_regs |non_object_regs) & (1 << r)) == 0)) { |
| 172 __ li(reg, kDebugZapValue); |
| 173 } |
145 } | 174 } |
146 } | 175 } |
147 __ MultiPush(object_regs | non_object_regs); | 176 |
| 177 // Leave the internal frame. |
148 } | 178 } |
149 | 179 |
150 #ifdef DEBUG | |
151 __ RecordComment("// Calling from debug break to runtime - come in - over"); | |
152 #endif | |
153 __ mov(a0, zero_reg); // No arguments. | |
154 __ li(a1, Operand(ExternalReference::debug_break(masm->isolate()))); | |
155 | |
156 CEntryStub ceb(1); | |
157 __ CallStub(&ceb); | |
158 | |
159 // Restore the register values from the expression stack. | |
160 if ((object_regs | non_object_regs) != 0) { | |
161 __ MultiPop(object_regs | non_object_regs); | |
162 for (int i = 0; i < kNumJSCallerSaved; i++) { | |
163 int r = JSCallerSavedCode(i); | |
164 Register reg = { r }; | |
165 if ((non_object_regs & (1 << r)) != 0) { | |
166 __ srl(reg, reg, kSmiTagSize); | |
167 } | |
168 if (FLAG_debug_code && | |
169 (((object_regs |non_object_regs) & (1 << r)) == 0)) { | |
170 __ li(reg, kDebugZapValue); | |
171 } | |
172 } | |
173 } | |
174 | |
175 __ LeaveInternalFrame(); | |
176 | |
177 // Now that the break point has been handled, resume normal execution by | 180 // Now that the break point has been handled, resume normal execution by |
178 // jumping to the target address intended by the caller and that was | 181 // jumping to the target address intended by the caller and that was |
179 // overwritten by the address of DebugBreakXXX. | 182 // overwritten by the address of DebugBreakXXX. |
180 __ li(t9, Operand( | 183 __ li(t9, Operand( |
181 ExternalReference(Debug_Address::AfterBreakTarget(), masm->isolate()))); | 184 ExternalReference(Debug_Address::AfterBreakTarget(), masm->isolate()))); |
182 __ lw(t9, MemOperand(t9)); | 185 __ lw(t9, MemOperand(t9)); |
183 __ Jump(t9); | 186 __ Jump(t9); |
184 } | 187 } |
185 | 188 |
186 | 189 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 const bool Debug::kFrameDropperSupported = false; | 302 const bool Debug::kFrameDropperSupported = false; |
300 | 303 |
301 #undef __ | 304 #undef __ |
302 | 305 |
303 | 306 |
304 #endif // ENABLE_DEBUGGER_SUPPORT | 307 #endif // ENABLE_DEBUGGER_SUPPORT |
305 | 308 |
306 } } // namespace v8::internal | 309 } } // namespace v8::internal |
307 | 310 |
308 #endif // V8_TARGET_ARCH_MIPS | 311 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |