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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 2728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2739 __ lw(vector, FieldMemOperand(vector, | 2739 __ lw(vector, FieldMemOperand(vector, |
2740 JSFunction::kSharedFunctionInfoOffset)); | 2740 JSFunction::kSharedFunctionInfoOffset)); |
2741 __ lw(vector, FieldMemOperand(vector, | 2741 __ lw(vector, FieldMemOperand(vector, |
2742 SharedFunctionInfo::kFeedbackVectorOffset)); | 2742 SharedFunctionInfo::kFeedbackVectorOffset)); |
2743 } | 2743 } |
2744 | 2744 |
2745 | 2745 |
2746 void CallIC_ArrayStub::Generate(MacroAssembler* masm) { | 2746 void CallIC_ArrayStub::Generate(MacroAssembler* masm) { |
2747 // a1 - function | 2747 // a1 - function |
2748 // a3 - slot id | 2748 // a3 - slot id |
| 2749 // a2 - vector |
2749 Label miss; | 2750 Label miss; |
2750 | 2751 |
2751 EmitLoadTypeFeedbackVector(masm, a2); | |
2752 | |
2753 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, at); | 2752 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, at); |
2754 __ Branch(&miss, ne, a1, Operand(at)); | 2753 __ Branch(&miss, ne, a1, Operand(at)); |
2755 | 2754 |
2756 __ li(a0, Operand(arg_count())); | 2755 __ li(a0, Operand(arg_count())); |
2757 __ sll(at, a3, kPointerSizeLog2 - kSmiTagSize); | 2756 __ sll(at, a3, kPointerSizeLog2 - kSmiTagSize); |
2758 __ Addu(at, a2, Operand(at)); | 2757 __ Addu(at, a2, Operand(at)); |
2759 __ lw(t0, FieldMemOperand(at, FixedArray::kHeaderSize)); | 2758 __ lw(t0, FieldMemOperand(at, FixedArray::kHeaderSize)); |
2760 | 2759 |
2761 // Verify that t0 contains an AllocationSite | 2760 // Verify that t0 contains an AllocationSite |
2762 __ lw(t1, FieldMemOperand(t0, HeapObject::kMapOffset)); | 2761 __ lw(t1, FieldMemOperand(t0, HeapObject::kMapOffset)); |
(...skipping 14 matching lines...) Expand all Loading... |
2777 CallAsMethod()); | 2776 CallAsMethod()); |
2778 | 2777 |
2779 // Unreachable. | 2778 // Unreachable. |
2780 __ stop("Unexpected code address"); | 2779 __ stop("Unexpected code address"); |
2781 } | 2780 } |
2782 | 2781 |
2783 | 2782 |
2784 void CallICStub::Generate(MacroAssembler* masm) { | 2783 void CallICStub::Generate(MacroAssembler* masm) { |
2785 // a1 - function | 2784 // a1 - function |
2786 // a3 - slot id (Smi) | 2785 // a3 - slot id (Smi) |
| 2786 // a2 - vector |
2787 const int with_types_offset = | 2787 const int with_types_offset = |
2788 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kWithTypesIndex); | 2788 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kWithTypesIndex); |
2789 const int generic_offset = | 2789 const int generic_offset = |
2790 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kGenericCountIndex); | 2790 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kGenericCountIndex); |
2791 Label extra_checks_or_miss, slow_start; | 2791 Label extra_checks_or_miss, slow_start; |
2792 Label slow, non_function, wrap, cont; | 2792 Label slow, non_function, wrap, cont; |
2793 Label have_js_function; | 2793 Label have_js_function; |
2794 int argc = arg_count(); | 2794 int argc = arg_count(); |
2795 ParameterCount actual(argc); | 2795 ParameterCount actual(argc); |
2796 | 2796 |
2797 EmitLoadTypeFeedbackVector(masm, a2); | |
2798 | |
2799 // The checks. First, does r1 match the recorded monomorphic target? | 2797 // The checks. First, does r1 match the recorded monomorphic target? |
2800 __ sll(t0, a3, kPointerSizeLog2 - kSmiTagSize); | 2798 __ sll(t0, a3, kPointerSizeLog2 - kSmiTagSize); |
2801 __ Addu(t0, a2, Operand(t0)); | 2799 __ Addu(t0, a2, Operand(t0)); |
2802 __ lw(t0, FieldMemOperand(t0, FixedArray::kHeaderSize)); | 2800 __ lw(t0, FieldMemOperand(t0, FixedArray::kHeaderSize)); |
2803 __ Branch(&extra_checks_or_miss, ne, a1, Operand(t0)); | 2801 __ Branch(&extra_checks_or_miss, ne, a1, Operand(t0)); |
2804 | 2802 |
2805 __ bind(&have_js_function); | 2803 __ bind(&have_js_function); |
2806 if (CallAsMethod()) { | 2804 if (CallAsMethod()) { |
2807 EmitContinueIfStrictOrNative(masm, &cont); | 2805 EmitContinueIfStrictOrNative(masm, &cont); |
2808 // Compute the receiver in sloppy mode. | 2806 // Compute the receiver in sloppy mode. |
(...skipping 1663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4472 } | 4470 } |
4473 | 4471 |
4474 | 4472 |
4475 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { | 4473 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { |
4476 EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister()); | 4474 EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister()); |
4477 VectorKeyedLoadStub stub(isolate()); | 4475 VectorKeyedLoadStub stub(isolate()); |
4478 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET); | 4476 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET); |
4479 } | 4477 } |
4480 | 4478 |
4481 | 4479 |
| 4480 void CallICTrampolineStub::Generate(MacroAssembler* masm) { |
| 4481 EmitLoadTypeFeedbackVector(masm, a2); |
| 4482 CallICStub stub(isolate(), state()); |
| 4483 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET); |
| 4484 } |
| 4485 |
| 4486 |
| 4487 void CallIC_ArrayTrampolineStub::Generate(MacroAssembler* masm) { |
| 4488 EmitLoadTypeFeedbackVector(masm, a2); |
| 4489 CallIC_ArrayStub stub(isolate(), state()); |
| 4490 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET); |
| 4491 } |
| 4492 |
| 4493 |
4482 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { | 4494 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { |
4483 if (masm->isolate()->function_entry_hook() != NULL) { | 4495 if (masm->isolate()->function_entry_hook() != NULL) { |
4484 ProfileEntryHookStub stub(masm->isolate()); | 4496 ProfileEntryHookStub stub(masm->isolate()); |
4485 __ push(ra); | 4497 __ push(ra); |
4486 __ CallStub(&stub); | 4498 __ CallStub(&stub); |
4487 __ pop(ra); | 4499 __ pop(ra); |
4488 } | 4500 } |
4489 } | 4501 } |
4490 | 4502 |
4491 | 4503 |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5139 kStackUnwindSpace, kInvalidStackOffset, | 5151 kStackUnwindSpace, kInvalidStackOffset, |
5140 MemOperand(fp, 6 * kPointerSize), NULL); | 5152 MemOperand(fp, 6 * kPointerSize), NULL); |
5141 } | 5153 } |
5142 | 5154 |
5143 | 5155 |
5144 #undef __ | 5156 #undef __ |
5145 | 5157 |
5146 } } // namespace v8::internal | 5158 } } // namespace v8::internal |
5147 | 5159 |
5148 #endif // V8_TARGET_ARCH_MIPS | 5160 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |