OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
6 | 6 |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 Label zero; | 1108 Label zero; |
1109 __ Branch(&zero, eq, cp, Operand(zero_reg)); | 1109 __ Branch(&zero, eq, cp, Operand(zero_reg)); |
1110 __ sw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 1110 __ sw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
1111 __ bind(&zero); | 1111 __ bind(&zero); |
1112 | 1112 |
1113 // Compute the handler entry address and jump to it. | 1113 // Compute the handler entry address and jump to it. |
1114 __ li(a1, Operand(pending_handler_code_address)); | 1114 __ li(a1, Operand(pending_handler_code_address)); |
1115 __ lw(a1, MemOperand(a1)); | 1115 __ lw(a1, MemOperand(a1)); |
1116 __ li(a2, Operand(pending_handler_offset_address)); | 1116 __ li(a2, Operand(pending_handler_offset_address)); |
1117 __ lw(a2, MemOperand(a2)); | 1117 __ lw(a2, MemOperand(a2)); |
1118 __ Addu(a1, a1, Operand(Code::kHeaderSize - kHeapObjectTag)); | |
1119 __ Addu(t9, a1, a2); | 1118 __ Addu(t9, a1, a2); |
1120 __ Jump(t9); | 1119 __ Jump(t9, Code::kHeaderSize - kHeapObjectTag); |
1121 } | 1120 } |
1122 | 1121 |
1123 | 1122 |
1124 void JSEntryStub::Generate(MacroAssembler* masm) { | 1123 void JSEntryStub::Generate(MacroAssembler* masm) { |
1125 Label invoke, handler_entry, exit; | 1124 Label invoke, handler_entry, exit; |
1126 Isolate* isolate = masm->isolate(); | 1125 Isolate* isolate = masm->isolate(); |
1127 | 1126 |
1128 // Registers: | 1127 // Registers: |
1129 // a0: entry address | 1128 // a0: entry address |
1130 // a1: function | 1129 // a1: function |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1243 ExternalReference construct_entry(Builtins::kJSConstructEntryTrampoline, | 1242 ExternalReference construct_entry(Builtins::kJSConstructEntryTrampoline, |
1244 isolate); | 1243 isolate); |
1245 __ li(t0, Operand(construct_entry)); | 1244 __ li(t0, Operand(construct_entry)); |
1246 } else { | 1245 } else { |
1247 ExternalReference entry(Builtins::kJSEntryTrampoline, masm->isolate()); | 1246 ExternalReference entry(Builtins::kJSEntryTrampoline, masm->isolate()); |
1248 __ li(t0, Operand(entry)); | 1247 __ li(t0, Operand(entry)); |
1249 } | 1248 } |
1250 __ lw(t9, MemOperand(t0)); // Deref address. | 1249 __ lw(t9, MemOperand(t0)); // Deref address. |
1251 | 1250 |
1252 // Call JSEntryTrampoline. | 1251 // Call JSEntryTrampoline. |
1253 __ addiu(t9, t9, Code::kHeaderSize - kHeapObjectTag); | 1252 __ Call(t9, Code::kHeaderSize - kHeapObjectTag); |
1254 __ Call(t9); | |
1255 | 1253 |
1256 // Unlink this frame from the handler chain. | 1254 // Unlink this frame from the handler chain. |
1257 __ PopStackHandler(); | 1255 __ PopStackHandler(); |
1258 | 1256 |
1259 __ bind(&exit); // v0 holds result | 1257 __ bind(&exit); // v0 holds result |
1260 // Check if the current stack frame is marked as the outermost JS frame. | 1258 // Check if the current stack frame is marked as the outermost JS frame. |
1261 Label non_outermost_js_2; | 1259 Label non_outermost_js_2; |
1262 __ pop(t1); | 1260 __ pop(t1); |
1263 __ Branch(&non_outermost_js_2, | 1261 __ Branch(&non_outermost_js_2, |
1264 ne, | 1262 ne, |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1880 | 1878 |
1881 __ AssertUndefinedOrAllocationSite(a2, t1); | 1879 __ AssertUndefinedOrAllocationSite(a2, t1); |
1882 | 1880 |
1883 // Pass function as new target. | 1881 // Pass function as new target. |
1884 __ mov(a3, a1); | 1882 __ mov(a3, a1); |
1885 | 1883 |
1886 // Tail call to the function-specific construct stub (still in the caller | 1884 // Tail call to the function-specific construct stub (still in the caller |
1887 // context at this point). | 1885 // context at this point). |
1888 __ lw(t0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | 1886 __ lw(t0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
1889 __ lw(t0, FieldMemOperand(t0, SharedFunctionInfo::kConstructStubOffset)); | 1887 __ lw(t0, FieldMemOperand(t0, SharedFunctionInfo::kConstructStubOffset)); |
1890 __ Addu(at, t0, Operand(Code::kHeaderSize - kHeapObjectTag)); | 1888 __ Jump(at, t0, Code::kHeaderSize - kHeapObjectTag); |
1891 __ Jump(at); | |
1892 | 1889 |
1893 __ bind(&non_function); | 1890 __ bind(&non_function); |
1894 __ mov(a3, a1); | 1891 __ mov(a3, a1); |
1895 __ Jump(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); | 1892 __ Jump(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); |
1896 } | 1893 } |
1897 | 1894 |
1898 // Note: feedback_vector and slot are clobbered after the call. | 1895 // Note: feedback_vector and slot are clobbered after the call. |
1899 static void IncrementCallCount(MacroAssembler* masm, Register feedback_vector, | 1896 static void IncrementCallCount(MacroAssembler* masm, Register feedback_vector, |
1900 Register slot) { | 1897 Register slot) { |
1901 __ Lsa(at, feedback_vector, slot, kPointerSizeLog2 - kSmiTagSize); | 1898 __ Lsa(at, feedback_vector, slot, kPointerSizeLog2 - kSmiTagSize); |
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2763 { | 2760 { |
2764 // Call the runtime system in a fresh internal frame. | 2761 // Call the runtime system in a fresh internal frame. |
2765 FrameScope scope(masm, StackFrame::INTERNAL); | 2762 FrameScope scope(masm, StackFrame::INTERNAL); |
2766 __ Push(a1, a0); | 2763 __ Push(a1, a0); |
2767 __ Push(ra, a1, a0); | 2764 __ Push(ra, a1, a0); |
2768 __ li(t0, Operand(Smi::FromInt(op()))); | 2765 __ li(t0, Operand(Smi::FromInt(op()))); |
2769 __ addiu(sp, sp, -kPointerSize); | 2766 __ addiu(sp, sp, -kPointerSize); |
2770 __ CallRuntime(Runtime::kCompareIC_Miss, 3, kDontSaveFPRegs, | 2767 __ CallRuntime(Runtime::kCompareIC_Miss, 3, kDontSaveFPRegs, |
2771 USE_DELAY_SLOT); | 2768 USE_DELAY_SLOT); |
2772 __ sw(t0, MemOperand(sp)); // In the delay slot. | 2769 __ sw(t0, MemOperand(sp)); // In the delay slot. |
2773 // Compute the entry point of the rewritten stub. | |
2774 __ Addu(a2, v0, Operand(Code::kHeaderSize - kHeapObjectTag)); | |
2775 // Restore registers. | 2770 // Restore registers. |
2776 __ Pop(a1, a0, ra); | 2771 __ Pop(a1, a0, ra); |
2777 } | 2772 } |
2778 __ Jump(a2); | 2773 __ Jump(a2, v0, Code::kHeaderSize - kHeapObjectTag); |
2779 } | 2774 } |
2780 | 2775 |
2781 | 2776 |
2782 void DirectCEntryStub::Generate(MacroAssembler* masm) { | 2777 void DirectCEntryStub::Generate(MacroAssembler* masm) { |
2783 // Make place for arguments to fit C calling convention. Most of the callers | 2778 // Make place for arguments to fit C calling convention. Most of the callers |
2784 // of DirectCEntryStub::GenerateCall are using EnterExitFrame/LeaveExitFrame | 2779 // of DirectCEntryStub::GenerateCall are using EnterExitFrame/LeaveExitFrame |
2785 // so they handle stack restoring and we don't have to do that here. | 2780 // so they handle stack restoring and we don't have to do that here. |
2786 // Any caller of DirectCEntryStub::GenerateCall must take care of dropping | 2781 // Any caller of DirectCEntryStub::GenerateCall must take care of dropping |
2787 // kCArgsSlotsSize stack space after the call. | 2782 // kCArgsSlotsSize stack space after the call. |
2788 __ Subu(sp, sp, Operand(kCArgsSlotsSize)); | 2783 __ Subu(sp, sp, Operand(kCArgsSlotsSize)); |
(...skipping 1977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4766 kStackUnwindSpace, kInvalidStackOffset, | 4761 kStackUnwindSpace, kInvalidStackOffset, |
4767 return_value_operand, NULL); | 4762 return_value_operand, NULL); |
4768 } | 4763 } |
4769 | 4764 |
4770 #undef __ | 4765 #undef __ |
4771 | 4766 |
4772 } // namespace internal | 4767 } // namespace internal |
4773 } // namespace v8 | 4768 } // namespace v8 |
4774 | 4769 |
4775 #endif // V8_TARGET_ARCH_MIPS | 4770 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |