| 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 #include "v8.h" | 5 #include "v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
| 8 | 8 |
| 9 #include "codegen.h" | 9 #include "codegen.h" |
| 10 #include "debug.h" | 10 #include "debug.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 debug_info_->GetIsolate()->builtins()->Slot_DebugBreak()->entry()); | 76 debug_info_->GetIsolate()->builtins()->Slot_DebugBreak()->entry()); |
| 77 } | 77 } |
| 78 | 78 |
| 79 | 79 |
| 80 void BreakLocationIterator::ClearDebugBreakAtSlot() { | 80 void BreakLocationIterator::ClearDebugBreakAtSlot() { |
| 81 ASSERT(IsDebugBreakSlot()); | 81 ASSERT(IsDebugBreakSlot()); |
| 82 rinfo()->PatchCode(original_rinfo()->pc(), | 82 rinfo()->PatchCode(original_rinfo()->pc(), |
| 83 Assembler::kDebugBreakSlotInstructions); | 83 Assembler::kDebugBreakSlotInstructions); |
| 84 } | 84 } |
| 85 | 85 |
| 86 const bool Debug::FramePaddingLayout::kIsSupported = false; | |
| 87 | |
| 88 | 86 |
| 89 #define __ ACCESS_MASM(masm) | 87 #define __ ACCESS_MASM(masm) |
| 90 | 88 |
| 91 | 89 |
| 92 static void Generate_DebugBreakCallHelper(MacroAssembler* masm, | 90 static void Generate_DebugBreakCallHelper(MacroAssembler* masm, |
| 93 RegList object_regs, | 91 RegList object_regs, |
| 94 RegList non_object_regs) { | 92 RegList non_object_regs) { |
| 95 { | 93 { |
| 96 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 94 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
| 97 | 95 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // jumping to the target address intended by the caller and that was | 146 // jumping to the target address intended by the caller and that was |
| 149 // overwritten by the address of DebugBreakXXX. | 147 // overwritten by the address of DebugBreakXXX. |
| 150 ExternalReference after_break_target = | 148 ExternalReference after_break_target = |
| 151 ExternalReference::debug_after_break_target_address(masm->isolate()); | 149 ExternalReference::debug_after_break_target_address(masm->isolate()); |
| 152 __ mov(ip, Operand(after_break_target)); | 150 __ mov(ip, Operand(after_break_target)); |
| 153 __ ldr(ip, MemOperand(ip)); | 151 __ ldr(ip, MemOperand(ip)); |
| 154 __ Jump(ip); | 152 __ Jump(ip); |
| 155 } | 153 } |
| 156 | 154 |
| 157 | 155 |
| 158 void Debug::GenerateCallICStubDebugBreak(MacroAssembler* masm) { | 156 void DebugCodegen::GenerateCallICStubDebugBreak(MacroAssembler* masm) { |
| 159 // Register state for CallICStub | 157 // Register state for CallICStub |
| 160 // ----------- S t a t e ------------- | 158 // ----------- S t a t e ------------- |
| 161 // -- r1 : function | 159 // -- r1 : function |
| 162 // -- r3 : slot in feedback array (smi) | 160 // -- r3 : slot in feedback array (smi) |
| 163 // ----------------------------------- | 161 // ----------------------------------- |
| 164 Generate_DebugBreakCallHelper(masm, r1.bit() | r3.bit(), 0); | 162 Generate_DebugBreakCallHelper(masm, r1.bit() | r3.bit(), 0); |
| 165 } | 163 } |
| 166 | 164 |
| 167 | 165 |
| 168 void Debug::GenerateLoadICDebugBreak(MacroAssembler* masm) { | 166 void DebugCodegen::GenerateLoadICDebugBreak(MacroAssembler* masm) { |
| 169 // Calling convention for IC load (from ic-arm.cc). | 167 // Calling convention for IC load (from ic-arm.cc). |
| 170 // ----------- S t a t e ------------- | 168 // ----------- S t a t e ------------- |
| 171 // -- r2 : name | 169 // -- r2 : name |
| 172 // -- lr : return address | 170 // -- lr : return address |
| 173 // -- r0 : receiver | 171 // -- r0 : receiver |
| 174 // -- [sp] : receiver | 172 // -- [sp] : receiver |
| 175 // ----------------------------------- | 173 // ----------------------------------- |
| 176 // Registers r0 and r2 contain objects that need to be pushed on the | 174 // Registers r0 and r2 contain objects that need to be pushed on the |
| 177 // expression stack of the fake JS frame. | 175 // expression stack of the fake JS frame. |
| 178 Generate_DebugBreakCallHelper(masm, r0.bit() | r2.bit(), 0); | 176 Generate_DebugBreakCallHelper(masm, r0.bit() | r2.bit(), 0); |
| 179 } | 177 } |
| 180 | 178 |
| 181 | 179 |
| 182 void Debug::GenerateStoreICDebugBreak(MacroAssembler* masm) { | 180 void DebugCodegen::GenerateStoreICDebugBreak(MacroAssembler* masm) { |
| 183 // Calling convention for IC store (from ic-arm.cc). | 181 // Calling convention for IC store (from ic-arm.cc). |
| 184 // ----------- S t a t e ------------- | 182 // ----------- S t a t e ------------- |
| 185 // -- r0 : value | 183 // -- r0 : value |
| 186 // -- r1 : receiver | 184 // -- r1 : receiver |
| 187 // -- r2 : name | 185 // -- r2 : name |
| 188 // -- lr : return address | 186 // -- lr : return address |
| 189 // ----------------------------------- | 187 // ----------------------------------- |
| 190 // Registers r0, r1, and r2 contain objects that need to be pushed on the | 188 // Registers r0, r1, and r2 contain objects that need to be pushed on the |
| 191 // expression stack of the fake JS frame. | 189 // expression stack of the fake JS frame. |
| 192 Generate_DebugBreakCallHelper(masm, r0.bit() | r1.bit() | r2.bit(), 0); | 190 Generate_DebugBreakCallHelper(masm, r0.bit() | r1.bit() | r2.bit(), 0); |
| 193 } | 191 } |
| 194 | 192 |
| 195 | 193 |
| 196 void Debug::GenerateKeyedLoadICDebugBreak(MacroAssembler* masm) { | 194 void DebugCodegen::GenerateKeyedLoadICDebugBreak(MacroAssembler* masm) { |
| 197 // ---------- S t a t e -------------- | 195 // ---------- S t a t e -------------- |
| 198 // -- lr : return address | 196 // -- lr : return address |
| 199 // -- r0 : key | 197 // -- r0 : key |
| 200 // -- r1 : receiver | 198 // -- r1 : receiver |
| 201 Generate_DebugBreakCallHelper(masm, r0.bit() | r1.bit(), 0); | 199 Generate_DebugBreakCallHelper(masm, r0.bit() | r1.bit(), 0); |
| 202 } | 200 } |
| 203 | 201 |
| 204 | 202 |
| 205 void Debug::GenerateKeyedStoreICDebugBreak(MacroAssembler* masm) { | 203 void DebugCodegen::GenerateKeyedStoreICDebugBreak(MacroAssembler* masm) { |
| 206 // ---------- S t a t e -------------- | 204 // ---------- S t a t e -------------- |
| 207 // -- r0 : value | 205 // -- r0 : value |
| 208 // -- r1 : key | 206 // -- r1 : key |
| 209 // -- r2 : receiver | 207 // -- r2 : receiver |
| 210 // -- lr : return address | 208 // -- lr : return address |
| 211 Generate_DebugBreakCallHelper(masm, r0.bit() | r1.bit() | r2.bit(), 0); | 209 Generate_DebugBreakCallHelper(masm, r0.bit() | r1.bit() | r2.bit(), 0); |
| 212 } | 210 } |
| 213 | 211 |
| 214 | 212 |
| 215 void Debug::GenerateCompareNilICDebugBreak(MacroAssembler* masm) { | 213 void DebugCodegen::GenerateCompareNilICDebugBreak(MacroAssembler* masm) { |
| 216 // Register state for CompareNil IC | 214 // Register state for CompareNil IC |
| 217 // ----------- S t a t e ------------- | 215 // ----------- S t a t e ------------- |
| 218 // -- r0 : value | 216 // -- r0 : value |
| 219 // ----------------------------------- | 217 // ----------------------------------- |
| 220 Generate_DebugBreakCallHelper(masm, r0.bit(), 0); | 218 Generate_DebugBreakCallHelper(masm, r0.bit(), 0); |
| 221 } | 219 } |
| 222 | 220 |
| 223 | 221 |
| 224 void Debug::GenerateReturnDebugBreak(MacroAssembler* masm) { | 222 void DebugCodegen::GenerateReturnDebugBreak(MacroAssembler* masm) { |
| 225 // In places other than IC call sites it is expected that r0 is TOS which | 223 // In places other than IC call sites it is expected that r0 is TOS which |
| 226 // is an object - this is not generally the case so this should be used with | 224 // is an object - this is not generally the case so this should be used with |
| 227 // care. | 225 // care. |
| 228 Generate_DebugBreakCallHelper(masm, r0.bit(), 0); | 226 Generate_DebugBreakCallHelper(masm, r0.bit(), 0); |
| 229 } | 227 } |
| 230 | 228 |
| 231 | 229 |
| 232 void Debug::GenerateCallFunctionStubDebugBreak(MacroAssembler* masm) { | 230 void DebugCodegen::GenerateCallFunctionStubDebugBreak(MacroAssembler* masm) { |
| 233 // Register state for CallFunctionStub (from code-stubs-arm.cc). | 231 // Register state for CallFunctionStub (from code-stubs-arm.cc). |
| 234 // ----------- S t a t e ------------- | 232 // ----------- S t a t e ------------- |
| 235 // -- r1 : function | 233 // -- r1 : function |
| 236 // ----------------------------------- | 234 // ----------------------------------- |
| 237 Generate_DebugBreakCallHelper(masm, r1.bit(), 0); | 235 Generate_DebugBreakCallHelper(masm, r1.bit(), 0); |
| 238 } | 236 } |
| 239 | 237 |
| 240 | 238 |
| 241 void Debug::GenerateCallConstructStubDebugBreak(MacroAssembler* masm) { | 239 void DebugCodegen::GenerateCallConstructStubDebugBreak(MacroAssembler* masm) { |
| 242 // Calling convention for CallConstructStub (from code-stubs-arm.cc) | 240 // Calling convention for CallConstructStub (from code-stubs-arm.cc) |
| 243 // ----------- S t a t e ------------- | 241 // ----------- S t a t e ------------- |
| 244 // -- r0 : number of arguments (not smi) | 242 // -- r0 : number of arguments (not smi) |
| 245 // -- r1 : constructor function | 243 // -- r1 : constructor function |
| 246 // ----------------------------------- | 244 // ----------------------------------- |
| 247 Generate_DebugBreakCallHelper(masm, r1.bit(), r0.bit()); | 245 Generate_DebugBreakCallHelper(masm, r1.bit(), r0.bit()); |
| 248 } | 246 } |
| 249 | 247 |
| 250 | 248 |
| 251 void Debug::GenerateCallConstructStubRecordDebugBreak(MacroAssembler* masm) { | 249 void DebugCodegen::GenerateCallConstructStubRecordDebugBreak( |
| 250 MacroAssembler* masm) { |
| 252 // Calling convention for CallConstructStub (from code-stubs-arm.cc) | 251 // Calling convention for CallConstructStub (from code-stubs-arm.cc) |
| 253 // ----------- S t a t e ------------- | 252 // ----------- S t a t e ------------- |
| 254 // -- r0 : number of arguments (not smi) | 253 // -- r0 : number of arguments (not smi) |
| 255 // -- r1 : constructor function | 254 // -- r1 : constructor function |
| 256 // -- r2 : feedback array | 255 // -- r2 : feedback array |
| 257 // -- r3 : feedback slot (smi) | 256 // -- r3 : feedback slot (smi) |
| 258 // ----------------------------------- | 257 // ----------------------------------- |
| 259 Generate_DebugBreakCallHelper(masm, r1.bit() | r2.bit() | r3.bit(), r0.bit()); | 258 Generate_DebugBreakCallHelper(masm, r1.bit() | r2.bit() | r3.bit(), r0.bit()); |
| 260 } | 259 } |
| 261 | 260 |
| 262 | 261 |
| 263 void Debug::GenerateSlot(MacroAssembler* masm) { | 262 void DebugCodegen::GenerateSlot(MacroAssembler* masm) { |
| 264 // Generate enough nop's to make space for a call instruction. Avoid emitting | 263 // Generate enough nop's to make space for a call instruction. Avoid emitting |
| 265 // the constant pool in the debug break slot code. | 264 // the constant pool in the debug break slot code. |
| 266 Assembler::BlockConstPoolScope block_const_pool(masm); | 265 Assembler::BlockConstPoolScope block_const_pool(masm); |
| 267 Label check_codesize; | 266 Label check_codesize; |
| 268 __ bind(&check_codesize); | 267 __ bind(&check_codesize); |
| 269 __ RecordDebugBreakSlot(); | 268 __ RecordDebugBreakSlot(); |
| 270 for (int i = 0; i < Assembler::kDebugBreakSlotInstructions; i++) { | 269 for (int i = 0; i < Assembler::kDebugBreakSlotInstructions; i++) { |
| 271 __ nop(MacroAssembler::DEBUG_BREAK_NOP); | 270 __ nop(MacroAssembler::DEBUG_BREAK_NOP); |
| 272 } | 271 } |
| 273 ASSERT_EQ(Assembler::kDebugBreakSlotInstructions, | 272 ASSERT_EQ(Assembler::kDebugBreakSlotInstructions, |
| 274 masm->InstructionsGeneratedSince(&check_codesize)); | 273 masm->InstructionsGeneratedSince(&check_codesize)); |
| 275 } | 274 } |
| 276 | 275 |
| 277 | 276 |
| 278 void Debug::GenerateSlotDebugBreak(MacroAssembler* masm) { | 277 void DebugCodegen::GenerateSlotDebugBreak(MacroAssembler* masm) { |
| 279 // In the places where a debug break slot is inserted no registers can contain | 278 // In the places where a debug break slot is inserted no registers can contain |
| 280 // object pointers. | 279 // object pointers. |
| 281 Generate_DebugBreakCallHelper(masm, 0, 0); | 280 Generate_DebugBreakCallHelper(masm, 0, 0); |
| 282 } | 281 } |
| 283 | 282 |
| 284 | 283 |
| 285 void Debug::GeneratePlainReturnLiveEdit(MacroAssembler* masm) { | 284 void DebugCodegen::GeneratePlainReturnLiveEdit(MacroAssembler* masm) { |
| 286 masm->Abort(kLiveEditFrameDroppingIsNotSupportedOnArm); | 285 masm->Abort(kLiveEditFrameDroppingIsNotSupportedOnArm); |
| 287 } | 286 } |
| 288 | 287 |
| 289 | 288 |
| 290 void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { | 289 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { |
| 291 masm->Abort(kLiveEditFrameDroppingIsNotSupportedOnArm); | 290 masm->Abort(kLiveEditFrameDroppingIsNotSupportedOnArm); |
| 292 } | 291 } |
| 293 | 292 |
| 294 const bool Debug::kFrameDropperSupported = false; | 293 |
| 294 const bool LiveEdit::kFrameDropperSupported = false; |
| 295 | 295 |
| 296 #undef __ | 296 #undef __ |
| 297 | 297 |
| 298 } } // namespace v8::internal | 298 } } // namespace v8::internal |
| 299 | 299 |
| 300 #endif // V8_TARGET_ARCH_ARM | 300 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |