OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 // ip = sp + kPointerSize * #args; | 324 // ip = sp + kPointerSize * #args; |
325 add(ip, sp, Operand(r0, LSL, kPointerSizeLog2)); | 325 add(ip, sp, Operand(r0, LSL, kPointerSizeLog2)); |
326 | 326 |
327 // Align the stack at this point. After this point we have 5 pushes, | 327 // Align the stack at this point. After this point we have 5 pushes, |
328 // so in fact we have to unalign here! See also the assert on the | 328 // so in fact we have to unalign here! See also the assert on the |
329 // alignment in AlignStack. | 329 // alignment in AlignStack. |
330 AlignStack(1); | 330 AlignStack(1); |
331 | 331 |
332 // Push in reverse order: caller_fp, sp_on_exit, and caller_pc. | 332 // Push in reverse order: caller_fp, sp_on_exit, and caller_pc. |
333 stm(db_w, sp, fp.bit() | ip.bit() | lr.bit()); | 333 stm(db_w, sp, fp.bit() | ip.bit() | lr.bit()); |
334 mov(fp, Operand(sp)); // setup new frame pointer | 334 mov(fp, Operand(sp)); // Setup new frame pointer. |
335 | 335 |
336 if (mode == ExitFrame::MODE_DEBUG) { | 336 mov(ip, Operand(CodeObject())); |
337 mov(ip, Operand(Smi::FromInt(0))); | 337 push(ip); // Accessed from ExitFrame::code_slot. |
338 } else { | |
339 mov(ip, Operand(CodeObject())); | |
340 } | |
341 push(ip); | |
342 | 338 |
343 // Save the frame pointer and the context in top. | 339 // Save the frame pointer and the context in top. |
344 mov(ip, Operand(ExternalReference(Top::k_c_entry_fp_address))); | 340 mov(ip, Operand(ExternalReference(Top::k_c_entry_fp_address))); |
345 str(fp, MemOperand(ip)); | 341 str(fp, MemOperand(ip)); |
346 mov(ip, Operand(ExternalReference(Top::k_context_address))); | 342 mov(ip, Operand(ExternalReference(Top::k_context_address))); |
347 str(cp, MemOperand(ip)); | 343 str(cp, MemOperand(ip)); |
348 | 344 |
349 // Setup argc and the builtin function in callee-saved registers. | 345 // Setup argc and the builtin function in callee-saved registers. |
350 mov(r4, Operand(r0)); | 346 mov(r4, Operand(r0)); |
351 mov(r5, Operand(r1)); | 347 mov(r5, Operand(r1)); |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 // Copy the content of the stack to the memory location and adjust base. | 597 // Copy the content of the stack to the memory location and adjust base. |
602 for (int i = 0; i < kNumJSCallerSaved; i++) { | 598 for (int i = 0; i < kNumJSCallerSaved; i++) { |
603 int r = JSCallerSavedCode(i); | 599 int r = JSCallerSavedCode(i); |
604 if ((regs & (1 << r)) != 0) { | 600 if ((regs & (1 << r)) != 0) { |
605 mov(ip, Operand(ExternalReference(Debug_Address::Register(i)))); | 601 mov(ip, Operand(ExternalReference(Debug_Address::Register(i)))); |
606 ldr(scratch, MemOperand(base, 4, PostIndex)); | 602 ldr(scratch, MemOperand(base, 4, PostIndex)); |
607 str(scratch, MemOperand(ip)); | 603 str(scratch, MemOperand(ip)); |
608 } | 604 } |
609 } | 605 } |
610 } | 606 } |
| 607 |
| 608 |
| 609 void MacroAssembler::DebugBreak() { |
| 610 ASSERT(allow_stub_calls()); |
| 611 mov(r0, Operand(0)); |
| 612 mov(r1, Operand(ExternalReference(Runtime::kDebugBreak))); |
| 613 CEntryStub ces(1); |
| 614 Call(ces.GetCode(), RelocInfo::DEBUG_BREAK); |
| 615 } |
611 #endif | 616 #endif |
612 | 617 |
613 | 618 |
614 void MacroAssembler::PushTryHandler(CodeLocation try_location, | 619 void MacroAssembler::PushTryHandler(CodeLocation try_location, |
615 HandlerType type) { | 620 HandlerType type) { |
616 // Adjust this code if not the case. | 621 // Adjust this code if not the case. |
617 ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize); | 622 ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize); |
618 // The pc (return address) is passed in register lr. | 623 // The pc (return address) is passed in register lr. |
619 if (try_location == IN_JAVASCRIPT) { | 624 if (try_location == IN_JAVASCRIPT) { |
620 if (type == TRY_CATCH_HANDLER) { | 625 if (type == TRY_CATCH_HANDLER) { |
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1468 } | 1473 } |
1469 | 1474 |
1470 | 1475 |
1471 void CodePatcher::Emit(Address addr) { | 1476 void CodePatcher::Emit(Address addr) { |
1472 masm()->emit(reinterpret_cast<Instr>(addr)); | 1477 masm()->emit(reinterpret_cast<Instr>(addr)); |
1473 } | 1478 } |
1474 #endif // ENABLE_DEBUGGER_SUPPORT | 1479 #endif // ENABLE_DEBUGGER_SUPPORT |
1475 | 1480 |
1476 | 1481 |
1477 } } // namespace v8::internal | 1482 } } // namespace v8::internal |
OLD | NEW |