Chromium Code Reviews| 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 3677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3688 // a2: reveiver | 3688 // a2: reveiver |
| 3689 // a3: argc | 3689 // a3: argc |
| 3690 // | 3690 // |
| 3691 // Stack: | 3691 // Stack: |
| 3692 // 4 args slots | 3692 // 4 args slots |
| 3693 // args | 3693 // args |
| 3694 | 3694 |
| 3695 // Save callee saved registers on the stack. | 3695 // Save callee saved registers on the stack. |
| 3696 __ MultiPush(kCalleeSaved | ra.bit()); | 3696 __ MultiPush(kCalleeSaved | ra.bit()); |
| 3697 | 3697 |
| 3698 if (CpuFeatures::IsSupported(FPU)) { | |
| 3699 CpuFeatures::Scope scope(FPU); | |
| 3700 // Save callee-saved FPU registers. | |
| 3701 __ MultiPushFPU(kCalleeSavedFPU); | |
| 3702 } | |
| 3703 | |
| 3698 // Load argv in s0 register. | 3704 // Load argv in s0 register. |
| 3699 __ lw(s0, MemOperand(sp, (kNumCalleeSaved + 1) * kPointerSize + | 3705 int offset_to_argv = (kNumCalleeSaved + 1) * kPointerSize; |
| 3700 StandardFrameConstants::kCArgsSlotsSize)); | 3706 if (CpuFeatures::IsSupported(FPU)) { |
| 3707 offset_to_argv += kNumCalleeSavedFPU * kDoubleSize; | |
| 3708 } | |
| 3709 | |
| 3710 __ lw(s0, MemOperand(sp, offset_to_argv + | |
| 3711 StandardFrameConstants::kCArgsSlotsSize)); | |
| 3701 | 3712 |
| 3702 // We build an EntryFrame. | 3713 // We build an EntryFrame. |
| 3703 __ li(t3, Operand(-1)); // Push a bad frame pointer to fail if it is used. | 3714 __ li(t3, Operand(-1)); // Push a bad frame pointer to fail if it is used. |
| 3704 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY; | 3715 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY; |
| 3705 __ li(t2, Operand(Smi::FromInt(marker))); | 3716 __ li(t2, Operand(Smi::FromInt(marker))); |
| 3706 __ li(t1, Operand(Smi::FromInt(marker))); | 3717 __ li(t1, Operand(Smi::FromInt(marker))); |
| 3707 __ li(t0, Operand(ExternalReference(Isolate::k_c_entry_fp_address, | 3718 __ li(t0, Operand(ExternalReference(Isolate::k_c_entry_fp_address, |
| 3708 masm->isolate()))); | 3719 masm->isolate()))); |
| 3709 __ lw(t0, MemOperand(t0)); | 3720 __ lw(t0, MemOperand(t0)); |
| 3710 __ Push(t3, t2, t1, t0); | 3721 __ Push(t3, t2, t1, t0); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3822 | 3833 |
| 3823 // Restore the top frame descriptors from the stack. | 3834 // Restore the top frame descriptors from the stack. |
| 3824 __ pop(t1); | 3835 __ pop(t1); |
| 3825 __ li(t0, Operand(ExternalReference(Isolate::k_c_entry_fp_address, | 3836 __ li(t0, Operand(ExternalReference(Isolate::k_c_entry_fp_address, |
| 3826 masm->isolate()))); | 3837 masm->isolate()))); |
| 3827 __ sw(t1, MemOperand(t0)); | 3838 __ sw(t1, MemOperand(t0)); |
| 3828 | 3839 |
| 3829 // Reset the stack to the callee saved registers. | 3840 // Reset the stack to the callee saved registers. |
| 3830 __ addiu(sp, sp, -EntryFrameConstants::kCallerFPOffset); | 3841 __ addiu(sp, sp, -EntryFrameConstants::kCallerFPOffset); |
| 3831 | 3842 |
| 3843 __ MultiPopFPU(kCalleeSavedFPU); | |
|
Yang
2011/08/31 12:38:44
Shouldn't this be surrounded by the conditional "i
Paul Lind
2011/09/01 06:50:27
Done.
| |
| 3844 | |
| 3832 // Restore callee saved registers from the stack. | 3845 // Restore callee saved registers from the stack. |
| 3833 __ MultiPop(kCalleeSaved | ra.bit()); | 3846 __ MultiPop(kCalleeSaved | ra.bit()); |
| 3834 // Return. | 3847 // Return. |
| 3835 __ Jump(ra); | 3848 __ Jump(ra); |
| 3836 } | 3849 } |
| 3837 | 3850 |
| 3838 | 3851 |
| 3839 // Uses registers a0 to t0. | 3852 // Uses registers a0 to t0. |
| 3840 // Expected input (depending on whether args are in registers or on the stack): | 3853 // Expected input (depending on whether args are in registers or on the stack): |
| 3841 // * object: a0 or at sp + 1 * kPointerSize. | 3854 // * object: a0 or at sp + 1 * kPointerSize. |
| (...skipping 3026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6868 __ mov(result, zero_reg); | 6881 __ mov(result, zero_reg); |
| 6869 __ Ret(); | 6882 __ Ret(); |
| 6870 } | 6883 } |
| 6871 | 6884 |
| 6872 | 6885 |
| 6873 #undef __ | 6886 #undef __ |
| 6874 | 6887 |
| 6875 } } // namespace v8::internal | 6888 } } // namespace v8::internal |
| 6876 | 6889 |
| 6877 #endif // V8_TARGET_ARCH_MIPS | 6890 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |