| 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 3725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3736 // | 3736 // |
| 3737 // Stack: | 3737 // Stack: |
| 3738 // caller fp | | 3738 // caller fp | |
| 3739 // function slot | entry frame | 3739 // function slot | entry frame |
| 3740 // context slot | | 3740 // context slot | |
| 3741 // bad fp (0xff...f) | | 3741 // bad fp (0xff...f) | |
| 3742 // callee saved registers + ra | 3742 // callee saved registers + ra |
| 3743 // 4 args slots | 3743 // 4 args slots |
| 3744 // args | 3744 // args |
| 3745 | 3745 |
| 3746 #ifdef ENABLE_LOGGING_AND_PROFILING | 3746 // If this is the outermost JS call, set js_entry_sp value. |
| 3747 // If this is the outermost JS call, set js_entry_sp value. | 3747 Label non_outermost_js; |
| 3748 Label non_outermost_js; | 3748 ExternalReference js_entry_sp(Isolate::k_js_entry_sp_address, |
| 3749 ExternalReference js_entry_sp(Isolate::k_js_entry_sp_address, | 3749 masm->isolate()); |
| 3750 masm->isolate()); | 3750 __ li(t1, Operand(ExternalReference(js_entry_sp))); |
| 3751 __ li(t1, Operand(ExternalReference(js_entry_sp))); | 3751 __ lw(t2, MemOperand(t1)); |
| 3752 __ lw(t2, MemOperand(t1)); | 3752 __ Branch(&non_outermost_js, ne, t2, Operand(zero_reg)); |
| 3753 __ Branch(&non_outermost_js, ne, t2, Operand(zero_reg)); | 3753 __ sw(fp, MemOperand(t1)); |
| 3754 __ sw(fp, MemOperand(t1)); | 3754 __ li(t0, Operand(Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME))); |
| 3755 __ li(t0, Operand(Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME))); | 3755 Label cont; |
| 3756 Label cont; | 3756 __ b(&cont); |
| 3757 __ b(&cont); | 3757 __ nop(); // Branch delay slot nop. |
| 3758 __ nop(); // Branch delay slot nop. | 3758 __ bind(&non_outermost_js); |
| 3759 __ bind(&non_outermost_js); | 3759 __ li(t0, Operand(Smi::FromInt(StackFrame::INNER_JSENTRY_FRAME))); |
| 3760 __ li(t0, Operand(Smi::FromInt(StackFrame::INNER_JSENTRY_FRAME))); | 3760 __ bind(&cont); |
| 3761 __ bind(&cont); | 3761 __ push(t0); |
| 3762 __ push(t0); | |
| 3763 #endif | |
| 3764 | 3762 |
| 3765 // Call a faked try-block that does the invoke. | 3763 // Call a faked try-block that does the invoke. |
| 3766 __ bal(&invoke); // bal exposes branch delay slot. | 3764 __ bal(&invoke); // bal exposes branch delay slot. |
| 3767 __ nop(); // Branch delay slot nop. | 3765 __ nop(); // Branch delay slot nop. |
| 3768 | 3766 |
| 3769 // Caught exception: Store result (exception) in the pending | 3767 // Caught exception: Store result (exception) in the pending |
| 3770 // exception field in the JSEnv and return a failure sentinel. | 3768 // exception field in the JSEnv and return a failure sentinel. |
| 3771 // Coming in here the fp will be invalid because the PushTryHandler below | 3769 // Coming in here the fp will be invalid because the PushTryHandler below |
| 3772 // sets it to 0 to signal the existence of the JSEntry frame. | 3770 // sets it to 0 to signal the existence of the JSEntry frame. |
| 3773 __ li(t0, Operand(ExternalReference(Isolate::k_pending_exception_address, | 3771 __ li(t0, Operand(ExternalReference(Isolate::k_pending_exception_address, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3822 __ lw(t9, MemOperand(t0)); // Deref address. | 3820 __ lw(t9, MemOperand(t0)); // Deref address. |
| 3823 | 3821 |
| 3824 // Call JSEntryTrampoline. | 3822 // Call JSEntryTrampoline. |
| 3825 __ addiu(t9, t9, Code::kHeaderSize - kHeapObjectTag); | 3823 __ addiu(t9, t9, Code::kHeaderSize - kHeapObjectTag); |
| 3826 __ Call(t9); | 3824 __ Call(t9); |
| 3827 | 3825 |
| 3828 // Unlink this frame from the handler chain. | 3826 // Unlink this frame from the handler chain. |
| 3829 __ PopTryHandler(); | 3827 __ PopTryHandler(); |
| 3830 | 3828 |
| 3831 __ bind(&exit); // v0 holds result | 3829 __ bind(&exit); // v0 holds result |
| 3832 #ifdef ENABLE_LOGGING_AND_PROFILING | 3830 // Check if the current stack frame is marked as the outermost JS frame. |
| 3833 // Check if the current stack frame is marked as the outermost JS frame. | 3831 Label non_outermost_js_2; |
| 3834 Label non_outermost_js_2; | 3832 __ pop(t1); |
| 3835 __ pop(t1); | 3833 __ Branch(&non_outermost_js_2, ne, t1, |
| 3836 __ Branch(&non_outermost_js_2, ne, t1, | 3834 Operand(Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME))); |
| 3837 Operand(Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME))); | 3835 __ li(t1, Operand(ExternalReference(js_entry_sp))); |
| 3838 __ li(t1, Operand(ExternalReference(js_entry_sp))); | 3836 __ sw(zero_reg, MemOperand(t1)); |
| 3839 __ sw(zero_reg, MemOperand(t1)); | 3837 __ bind(&non_outermost_js_2); |
| 3840 __ bind(&non_outermost_js_2); | |
| 3841 #endif | |
| 3842 | 3838 |
| 3843 // Restore the top frame descriptors from the stack. | 3839 // Restore the top frame descriptors from the stack. |
| 3844 __ pop(t1); | 3840 __ pop(t1); |
| 3845 __ li(t0, Operand(ExternalReference(Isolate::k_c_entry_fp_address, | 3841 __ li(t0, Operand(ExternalReference(Isolate::k_c_entry_fp_address, |
| 3846 masm->isolate()))); | 3842 masm->isolate()))); |
| 3847 __ sw(t1, MemOperand(t0)); | 3843 __ sw(t1, MemOperand(t0)); |
| 3848 | 3844 |
| 3849 // Reset the stack to the callee saved registers. | 3845 // Reset the stack to the callee saved registers. |
| 3850 __ addiu(sp, sp, -EntryFrameConstants::kCallerFPOffset); | 3846 __ addiu(sp, sp, -EntryFrameConstants::kCallerFPOffset); |
| 3851 | 3847 |
| (...skipping 3021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6873 __ mov(result, zero_reg); | 6869 __ mov(result, zero_reg); |
| 6874 __ Ret(); | 6870 __ Ret(); |
| 6875 } | 6871 } |
| 6876 | 6872 |
| 6877 | 6873 |
| 6878 #undef __ | 6874 #undef __ |
| 6879 | 6875 |
| 6880 } } // namespace v8::internal | 6876 } } // namespace v8::internal |
| 6881 | 6877 |
| 6882 #endif // V8_TARGET_ARCH_MIPS | 6878 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |