OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 mov(ip, Operand(ExternalReference(Top::k_context_address))); | 299 mov(ip, Operand(ExternalReference(Top::k_context_address))); |
300 str(cp, MemOperand(ip)); | 300 str(cp, MemOperand(ip)); |
301 | 301 |
302 // Setup argc and the builtin function in callee-saved registers. | 302 // Setup argc and the builtin function in callee-saved registers. |
303 mov(r4, Operand(r0)); | 303 mov(r4, Operand(r0)); |
304 mov(r5, Operand(r1)); | 304 mov(r5, Operand(r1)); |
305 | 305 |
306 // Compute the argv pointer and keep it in a callee-saved register. | 306 // Compute the argv pointer and keep it in a callee-saved register. |
307 add(r6, fp, Operand(r4, LSL, kPointerSizeLog2)); | 307 add(r6, fp, Operand(r4, LSL, kPointerSizeLog2)); |
308 add(r6, r6, Operand(ExitFrameConstants::kPPDisplacement - kPointerSize)); | 308 add(r6, r6, Operand(ExitFrameConstants::kPPDisplacement - kPointerSize)); |
| 309 |
| 310 // Save the state of all registers to the stack from the memory |
| 311 // location. This is needed to allow nested break points. |
| 312 if (type == StackFrame::EXIT_DEBUG) { |
| 313 // Use sp as base to push. |
| 314 CopyRegistersFromMemoryToStack(sp, kJSCallerSaved); |
| 315 } |
309 } | 316 } |
310 | 317 |
311 | 318 |
312 void MacroAssembler::LeaveExitFrame() { | 319 void MacroAssembler::LeaveExitFrame(StackFrame::Type type) { |
| 320 // Restore the memory copy of the registers by digging them out from |
| 321 // the stack. This is needed to allow nested break points. |
| 322 if (type == StackFrame::EXIT_DEBUG) { |
| 323 // This code intentionally clobbers r2 and r3. |
| 324 const int kCallerSavedSize = kNumJSCallerSaved * kPointerSize; |
| 325 const int kOffset = ExitFrameConstants::kDebugMarkOffset - kCallerSavedSize; |
| 326 add(r3, fp, Operand(kOffset)); |
| 327 CopyRegistersFromStackToMemory(r3, r2, kJSCallerSaved); |
| 328 } |
| 329 |
313 // Clear top frame. | 330 // Clear top frame. |
314 mov(r3, Operand(0)); | 331 mov(r3, Operand(0)); |
315 mov(ip, Operand(ExternalReference(Top::k_c_entry_fp_address))); | 332 mov(ip, Operand(ExternalReference(Top::k_c_entry_fp_address))); |
316 str(r3, MemOperand(ip)); | 333 str(r3, MemOperand(ip)); |
317 | 334 |
318 // Restore current context from top and clear it in debug mode. | 335 // Restore current context from top and clear it in debug mode. |
319 mov(ip, Operand(ExternalReference(Top::k_context_address))); | 336 mov(ip, Operand(ExternalReference(Top::k_context_address))); |
320 ldr(cp, MemOperand(ip)); | 337 ldr(cp, MemOperand(ip)); |
321 if (kDebug) { | 338 if (kDebug) { |
322 str(r3, MemOperand(ip)); | 339 str(r3, MemOperand(ip)); |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 #endif | 817 #endif |
801 mov(r0, Operand(p0)); | 818 mov(r0, Operand(p0)); |
802 push(r0); | 819 push(r0); |
803 mov(r0, Operand(Smi::FromInt(p1 - p0))); | 820 mov(r0, Operand(Smi::FromInt(p1 - p0))); |
804 push(r0); | 821 push(r0); |
805 CallRuntime(Runtime::kAbort, 2); | 822 CallRuntime(Runtime::kAbort, 2); |
806 // will not return here | 823 // will not return here |
807 } | 824 } |
808 | 825 |
809 } } // namespace v8::internal | 826 } } // namespace v8::internal |
OLD | NEW |