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 3532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3543 // r3: argc | 3543 // r3: argc |
3544 // [sp+0]: argv | 3544 // [sp+0]: argv |
3545 | 3545 |
3546 Label invoke, exit; | 3546 Label invoke, exit; |
3547 | 3547 |
3548 // Called from C, so do not pop argc and args on exit (preserve sp) | 3548 // Called from C, so do not pop argc and args on exit (preserve sp) |
3549 // No need to save register-passed args | 3549 // No need to save register-passed args |
3550 // Save callee-saved registers (incl. cp and fp), sp, and lr | 3550 // Save callee-saved registers (incl. cp and fp), sp, and lr |
3551 __ stm(db_w, sp, kCalleeSaved | lr.bit()); | 3551 __ stm(db_w, sp, kCalleeSaved | lr.bit()); |
3552 | 3552 |
| 3553 if (CpuFeatures::IsSupported(VFP3)) { |
| 3554 CpuFeatures::Scope scope(VFP3); |
| 3555 // Save callee-saved vfp registers. |
| 3556 __ vstm(db_w, sp, kFirstCalleeSavedDoubleReg, kLastCalleeSavedDoubleReg); |
| 3557 } |
| 3558 |
3553 // Get address of argv, see stm above. | 3559 // Get address of argv, see stm above. |
3554 // r0: code entry | 3560 // r0: code entry |
3555 // r1: function | 3561 // r1: function |
3556 // r2: receiver | 3562 // r2: receiver |
3557 // r3: argc | 3563 // r3: argc |
3558 __ ldr(r4, MemOperand(sp, (kNumCalleeSaved + 1) * kPointerSize)); // argv | 3564 |
| 3565 // Setup argv in r4. |
| 3566 int offset_to_argv = (kNumCalleeSaved + 1) * kPointerSize; |
| 3567 if (CpuFeatures::IsSupported(VFP3)) { |
| 3568 offset_to_argv += kNumDoubleCalleeSaved * kDoubleSize; |
| 3569 } |
| 3570 __ ldr(r4, MemOperand(sp, offset_to_argv)); |
3559 | 3571 |
3560 // Push a frame with special values setup to mark it as an entry frame. | 3572 // Push a frame with special values setup to mark it as an entry frame. |
3561 // r0: code entry | 3573 // r0: code entry |
3562 // r1: function | 3574 // r1: function |
3563 // r2: receiver | 3575 // r2: receiver |
3564 // r3: argc | 3576 // r3: argc |
3565 // r4: argv | 3577 // r4: argv |
3566 Isolate* isolate = masm->isolate(); | 3578 Isolate* isolate = masm->isolate(); |
3567 __ mov(r8, Operand(-1)); // Push a bad frame pointer to fail if it is used. | 3579 __ mov(r8, Operand(-1)); // Push a bad frame pointer to fail if it is used. |
3568 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY; | 3580 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3673 | 3685 |
3674 // Reset the stack to the callee saved registers. | 3686 // Reset the stack to the callee saved registers. |
3675 __ add(sp, sp, Operand(-EntryFrameConstants::kCallerFPOffset)); | 3687 __ add(sp, sp, Operand(-EntryFrameConstants::kCallerFPOffset)); |
3676 | 3688 |
3677 // Restore callee-saved registers and return. | 3689 // Restore callee-saved registers and return. |
3678 #ifdef DEBUG | 3690 #ifdef DEBUG |
3679 if (FLAG_debug_code) { | 3691 if (FLAG_debug_code) { |
3680 __ mov(lr, Operand(pc)); | 3692 __ mov(lr, Operand(pc)); |
3681 } | 3693 } |
3682 #endif | 3694 #endif |
| 3695 |
| 3696 if (CpuFeatures::IsSupported(VFP3)) { |
| 3697 CpuFeatures::Scope scope(VFP3); |
| 3698 // Restore callee-saved vfp registers. |
| 3699 __ vldm(ia_w, sp, kFirstCalleeSavedDoubleReg, kLastCalleeSavedDoubleReg); |
| 3700 } |
| 3701 |
3683 __ ldm(ia_w, sp, kCalleeSaved | pc.bit()); | 3702 __ ldm(ia_w, sp, kCalleeSaved | pc.bit()); |
3684 } | 3703 } |
3685 | 3704 |
3686 | 3705 |
3687 // Uses registers r0 to r4. | 3706 // Uses registers r0 to r4. |
3688 // Expected input (depending on whether args are in registers or on the stack): | 3707 // Expected input (depending on whether args are in registers or on the stack): |
3689 // * object: r0 or at sp + 1 * kPointerSize. | 3708 // * object: r0 or at sp + 1 * kPointerSize. |
3690 // * function: r1 or at sp. | 3709 // * function: r1 or at sp. |
3691 // | 3710 // |
3692 // An inlined call site may have been generated before calling this stub. | 3711 // An inlined call site may have been generated before calling this stub. |
(...skipping 2902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6595 __ mov(result, Operand(0)); | 6614 __ mov(result, Operand(0)); |
6596 __ Ret(); | 6615 __ Ret(); |
6597 } | 6616 } |
6598 | 6617 |
6599 | 6618 |
6600 #undef __ | 6619 #undef __ |
6601 | 6620 |
6602 } } // namespace v8::internal | 6621 } } // namespace v8::internal |
6603 | 6622 |
6604 #endif // V8_TARGET_ARCH_ARM | 6623 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |