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

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

Issue 871063002: 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: Ports. Created 5 years, 10 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/arm/interface-descriptors-arm.cc ('k') | src/arm64/full-codegen-arm64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64 7 #if V8_TARGET_ARCH_ARM64
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 2965 matching lines...) Expand 10 before | Expand all | Expand 10 after
2976 __ Ldr(vector, FieldMemOperand(vector, 2976 __ Ldr(vector, FieldMemOperand(vector,
2977 JSFunction::kSharedFunctionInfoOffset)); 2977 JSFunction::kSharedFunctionInfoOffset));
2978 __ Ldr(vector, FieldMemOperand(vector, 2978 __ Ldr(vector, FieldMemOperand(vector,
2979 SharedFunctionInfo::kFeedbackVectorOffset)); 2979 SharedFunctionInfo::kFeedbackVectorOffset));
2980 } 2980 }
2981 2981
2982 2982
2983 void CallIC_ArrayStub::Generate(MacroAssembler* masm) { 2983 void CallIC_ArrayStub::Generate(MacroAssembler* masm) {
2984 // x1 - function 2984 // x1 - function
2985 // x3 - slot id 2985 // x3 - slot id
2986 // x2 - vector
2986 Label miss; 2987 Label miss;
2987 Register function = x1; 2988 Register function = x1;
2988 Register feedback_vector = x2; 2989 Register feedback_vector = x2;
2989 Register index = x3; 2990 Register index = x3;
2990 Register scratch = x4; 2991 Register scratch = x4;
2991 2992
2992 EmitLoadTypeFeedbackVector(masm, feedback_vector);
2993
2994 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, scratch); 2993 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, scratch);
2995 __ Cmp(function, scratch); 2994 __ Cmp(function, scratch);
2996 __ B(ne, &miss); 2995 __ B(ne, &miss);
2997 2996
2998 __ Mov(x0, Operand(arg_count())); 2997 __ Mov(x0, Operand(arg_count()));
2999 2998
3000 __ Add(scratch, feedback_vector, 2999 __ Add(scratch, feedback_vector,
3001 Operand::UntagSmiAndScale(index, kPointerSizeLog2)); 3000 Operand::UntagSmiAndScale(index, kPointerSizeLog2));
3002 __ Ldr(scratch, FieldMemOperand(scratch, FixedArray::kHeaderSize)); 3001 __ Ldr(scratch, FieldMemOperand(scratch, FixedArray::kHeaderSize));
3003 3002
(...skipping 18 matching lines...) Expand all
3022 3021
3023 __ Unreachable(); 3022 __ Unreachable();
3024 } 3023 }
3025 3024
3026 3025
3027 void CallICStub::Generate(MacroAssembler* masm) { 3026 void CallICStub::Generate(MacroAssembler* masm) {
3028 ASM_LOCATION("CallICStub"); 3027 ASM_LOCATION("CallICStub");
3029 3028
3030 // x1 - function 3029 // x1 - function
3031 // x3 - slot id (Smi) 3030 // x3 - slot id (Smi)
3031 // x2 - vector
3032 const int with_types_offset = 3032 const int with_types_offset =
3033 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kWithTypesIndex); 3033 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kWithTypesIndex);
3034 const int generic_offset = 3034 const int generic_offset =
3035 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kGenericCountIndex); 3035 FixedArray::OffsetOfElementAt(TypeFeedbackVector::kGenericCountIndex);
3036 Label extra_checks_or_miss, slow_start; 3036 Label extra_checks_or_miss, slow_start;
3037 Label slow, non_function, wrap, cont; 3037 Label slow, non_function, wrap, cont;
3038 Label have_js_function; 3038 Label have_js_function;
3039 int argc = arg_count(); 3039 int argc = arg_count();
3040 ParameterCount actual(argc); 3040 ParameterCount actual(argc);
3041 3041
3042 Register function = x1; 3042 Register function = x1;
3043 Register feedback_vector = x2; 3043 Register feedback_vector = x2;
3044 Register index = x3; 3044 Register index = x3;
3045 Register type = x4; 3045 Register type = x4;
3046 3046
3047 EmitLoadTypeFeedbackVector(masm, feedback_vector);
3048
3049 // The checks. First, does x1 match the recorded monomorphic target? 3047 // The checks. First, does x1 match the recorded monomorphic target?
3050 __ Add(x4, feedback_vector, 3048 __ Add(x4, feedback_vector,
3051 Operand::UntagSmiAndScale(index, kPointerSizeLog2)); 3049 Operand::UntagSmiAndScale(index, kPointerSizeLog2));
3052 __ Ldr(x4, FieldMemOperand(x4, FixedArray::kHeaderSize)); 3050 __ Ldr(x4, FieldMemOperand(x4, FixedArray::kHeaderSize));
3053 3051
3054 __ Cmp(x4, function); 3052 __ Cmp(x4, function);
3055 __ B(ne, &extra_checks_or_miss); 3053 __ B(ne, &extra_checks_or_miss);
3056 3054
3057 __ bind(&have_js_function); 3055 __ bind(&have_js_function);
3058 if (CallAsMethod()) { 3056 if (CallAsMethod()) {
(...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after
4367 } 4365 }
4368 4366
4369 4367
4370 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { 4368 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) {
4371 EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister()); 4369 EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister());
4372 VectorKeyedLoadStub stub(isolate()); 4370 VectorKeyedLoadStub stub(isolate());
4373 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET); 4371 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
4374 } 4372 }
4375 4373
4376 4374
4375 void CallICTrampolineStub::Generate(MacroAssembler* masm) {
4376 EmitLoadTypeFeedbackVector(masm, x2);
4377 CallICStub stub(isolate(), state());
4378 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
4379 }
4380
4381
4382 void CallIC_ArrayTrampolineStub::Generate(MacroAssembler* masm) {
4383 EmitLoadTypeFeedbackVector(masm, x2);
4384 CallIC_ArrayStub stub(isolate(), state());
4385 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
4386 }
4387
4388
4377 // The entry hook is a "BumpSystemStackPointer" instruction (sub), followed by 4389 // The entry hook is a "BumpSystemStackPointer" instruction (sub), followed by
4378 // a "Push lr" instruction, followed by a call. 4390 // a "Push lr" instruction, followed by a call.
4379 static const unsigned int kProfileEntryHookCallSize = 4391 static const unsigned int kProfileEntryHookCallSize =
4380 Assembler::kCallSizeWithRelocation + (2 * kInstructionSize); 4392 Assembler::kCallSizeWithRelocation + (2 * kInstructionSize);
4381 4393
4382 4394
4383 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { 4395 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
4384 if (masm->isolate()->function_entry_hook() != NULL) { 4396 if (masm->isolate()->function_entry_hook() != NULL) {
4385 ProfileEntryHookStub stub(masm->isolate()); 4397 ProfileEntryHookStub stub(masm->isolate());
4386 Assembler::BlockConstPoolScope no_const_pools(masm); 4398 Assembler::BlockConstPoolScope no_const_pools(masm);
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after
5391 kStackUnwindSpace, NULL, spill_offset, 5403 kStackUnwindSpace, NULL, spill_offset,
5392 MemOperand(fp, 6 * kPointerSize), NULL); 5404 MemOperand(fp, 6 * kPointerSize), NULL);
5393 } 5405 }
5394 5406
5395 5407
5396 #undef __ 5408 #undef __
5397 5409
5398 } } // namespace v8::internal 5410 } } // namespace v8::internal
5399 5411
5400 #endif // V8_TARGET_ARCH_ARM64 5412 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm/interface-descriptors-arm.cc ('k') | src/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698