Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: src/mips64/code-stubs-mips64.cc

Issue 882683002: MIPS: Use a trampoline stub to load the type feedback vector for CallICs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/mips/interface-descriptors-mips.cc ('k') | src/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 2803 matching lines...) Expand 10 before | Expand all | Expand 10 after
2814 __ ld(vector, FieldMemOperand(vector, 2814 __ ld(vector, FieldMemOperand(vector,
2815 JSFunction::kSharedFunctionInfoOffset)); 2815 JSFunction::kSharedFunctionInfoOffset));
2816 __ ld(vector, FieldMemOperand(vector, 2816 __ ld(vector, FieldMemOperand(vector,
2817 SharedFunctionInfo::kFeedbackVectorOffset)); 2817 SharedFunctionInfo::kFeedbackVectorOffset));
2818 } 2818 }
2819 2819
2820 2820
2821 void CallIC_ArrayStub::Generate(MacroAssembler* masm) { 2821 void CallIC_ArrayStub::Generate(MacroAssembler* masm) {
2822 // a1 - function 2822 // a1 - function
2823 // a3 - slot id 2823 // a3 - slot id
2824 // a2 - vector
2824 Label miss; 2825 Label miss;
2825 2826
2826 EmitLoadTypeFeedbackVector(masm, a2);
2827
2828 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, at); 2827 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, at);
2829 __ Branch(&miss, ne, a1, Operand(at)); 2828 __ Branch(&miss, ne, a1, Operand(at));
2830 2829
2831 __ li(a0, Operand(arg_count())); 2830 __ li(a0, Operand(arg_count()));
2832 __ dsrl(at, a3, 32 - kPointerSizeLog2); 2831 __ dsrl(at, a3, 32 - kPointerSizeLog2);
2833 __ Daddu(at, a2, Operand(at)); 2832 __ Daddu(at, a2, Operand(at));
2834 __ ld(a4, FieldMemOperand(at, FixedArray::kHeaderSize)); 2833 __ ld(a4, FieldMemOperand(at, FixedArray::kHeaderSize));
2835 2834
2836 // Verify that a4 contains an AllocationSite 2835 // Verify that a4 contains an AllocationSite
2837 __ ld(a5, FieldMemOperand(a4, HeapObject::kMapOffset)); 2836 __ ld(a5, FieldMemOperand(a4, HeapObject::kMapOffset));
(...skipping 14 matching lines...) Expand all
2852 CallAsMethod()); 2851 CallAsMethod());
2853 2852
2854 // Unreachable. 2853 // Unreachable.
2855 __ stop("Unexpected code address"); 2854 __ stop("Unexpected code address");
2856 } 2855 }
2857 2856
2858 2857
2859 void CallICStub::Generate(MacroAssembler* masm) { 2858 void CallICStub::Generate(MacroAssembler* masm) {
2860 // a1 - function 2859 // a1 - function
2861 // a3 - slot id (Smi) 2860 // a3 - slot id (Smi)
2861 // a2 - vector
2862 const int with_types_offset = 2862 const int with_types_offset =
2863 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kWithTypesIndex); 2863 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kWithTypesIndex);
2864 const int generic_offset = 2864 const int generic_offset =
2865 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kGenericCountIndex); 2865 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kGenericCountIndex);
2866 Label extra_checks_or_miss, slow_start; 2866 Label extra_checks_or_miss, slow_start;
2867 Label slow, non_function, wrap, cont; 2867 Label slow, non_function, wrap, cont;
2868 Label have_js_function; 2868 Label have_js_function;
2869 int argc = arg_count(); 2869 int argc = arg_count();
2870 ParameterCount actual(argc); 2870 ParameterCount actual(argc);
2871 2871
2872 EmitLoadTypeFeedbackVector(masm, a2);
2873
2874 // The checks. First, does r1 match the recorded monomorphic target? 2872 // The checks. First, does r1 match the recorded monomorphic target?
2875 __ dsrl(a4, a3, 32 - kPointerSizeLog2); 2873 __ dsrl(a4, a3, 32 - kPointerSizeLog2);
2876 __ Daddu(a4, a2, Operand(a4)); 2874 __ Daddu(a4, a2, Operand(a4));
2877 __ ld(a4, FieldMemOperand(a4, FixedArray::kHeaderSize)); 2875 __ ld(a4, FieldMemOperand(a4, FixedArray::kHeaderSize));
2878 __ Branch(&extra_checks_or_miss, ne, a1, Operand(a4)); 2876 __ Branch(&extra_checks_or_miss, ne, a1, Operand(a4));
2879 2877
2880 __ bind(&have_js_function); 2878 __ bind(&have_js_function);
2881 if (CallAsMethod()) { 2879 if (CallAsMethod()) {
2882 EmitContinueIfStrictOrNative(masm, &cont); 2880 EmitContinueIfStrictOrNative(masm, &cont);
2883 // Compute the receiver in sloppy mode. 2881 // Compute the receiver in sloppy mode.
(...skipping 1628 matching lines...) Expand 10 before | Expand all | Expand 10 after
4512 } 4510 }
4513 4511
4514 4512
4515 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { 4513 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) {
4516 EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister()); 4514 EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister());
4517 VectorKeyedLoadStub stub(isolate()); 4515 VectorKeyedLoadStub stub(isolate());
4518 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET); 4516 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
4519 } 4517 }
4520 4518
4521 4519
4520 void CallICTrampolineStub::Generate(MacroAssembler* masm) {
4521 EmitLoadTypeFeedbackVector(masm, a2);
4522 CallICStub stub(isolate(), state());
4523 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
4524 }
4525
4526
4527 void CallIC_ArrayTrampolineStub::Generate(MacroAssembler* masm) {
4528 EmitLoadTypeFeedbackVector(masm, a2);
4529 CallIC_ArrayStub stub(isolate(), state());
4530 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
4531 }
4532
4533
4522 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { 4534 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
4523 if (masm->isolate()->function_entry_hook() != NULL) { 4535 if (masm->isolate()->function_entry_hook() != NULL) {
4524 ProfileEntryHookStub stub(masm->isolate()); 4536 ProfileEntryHookStub stub(masm->isolate());
4525 __ push(ra); 4537 __ push(ra);
4526 __ CallStub(&stub); 4538 __ CallStub(&stub);
4527 __ pop(ra); 4539 __ pop(ra);
4528 } 4540 }
4529 } 4541 }
4530 4542
4531 4543
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
5179 kStackUnwindSpace, kInvalidStackOffset, 5191 kStackUnwindSpace, kInvalidStackOffset,
5180 MemOperand(fp, 6 * kPointerSize), NULL); 5192 MemOperand(fp, 6 * kPointerSize), NULL);
5181 } 5193 }
5182 5194
5183 5195
5184 #undef __ 5196 #undef __
5185 5197
5186 } } // namespace v8::internal 5198 } } // namespace v8::internal
5187 5199
5188 #endif // V8_TARGET_ARCH_MIPS64 5200 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/interface-descriptors-mips.cc ('k') | src/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698