Commit 2a3b0575 authored by mvstanton's avatar mvstanton Committed by Commit bot

Built-in apply() performance benefits from an uninitialized IC.

BUG=

Review URL: https://codereview.chromium.org/1180713007

Cr-Commit-Position: refs/heads/master@{#29175}
parent 94a0bc8e
...@@ -1385,6 +1385,8 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm, ...@@ -1385,6 +1385,8 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm,
Label entry, loop; Label entry, loop;
Register receiver = LoadDescriptor::ReceiverRegister(); Register receiver = LoadDescriptor::ReceiverRegister();
Register key = LoadDescriptor::NameRegister(); Register key = LoadDescriptor::NameRegister();
Register slot = LoadDescriptor::SlotRegister();
Register vector = LoadWithVectorDescriptor::VectorRegister();
__ ldr(key, MemOperand(fp, indexOffset)); __ ldr(key, MemOperand(fp, indexOffset));
__ b(&entry); __ b(&entry);
...@@ -1394,7 +1396,13 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm, ...@@ -1394,7 +1396,13 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm,
__ ldr(receiver, MemOperand(fp, argumentsOffset)); __ ldr(receiver, MemOperand(fp, argumentsOffset));
// Use inline caching to speed up access to arguments. // Use inline caching to speed up access to arguments.
Handle<Code> ic = masm->isolate()->builtins()->KeyedLoadIC_Megamorphic(); FeedbackVectorSpec spec(0, Code::KEYED_LOAD_IC);
Handle<TypeFeedbackVector> feedback_vector =
masm->isolate()->factory()->NewTypeFeedbackVector(&spec);
int index = feedback_vector->GetIndex(FeedbackVectorICSlot(0));
__ mov(slot, Operand(Smi::FromInt(index)));
__ Move(vector, feedback_vector);
Handle<Code> ic = KeyedLoadICStub(masm->isolate()).GetCode();
__ Call(ic, RelocInfo::CODE_TARGET); __ Call(ic, RelocInfo::CODE_TARGET);
// Push the nth argument. // Push the nth argument.
......
...@@ -1388,6 +1388,8 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm, ...@@ -1388,6 +1388,8 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm,
Label entry, loop; Label entry, loop;
Register receiver = LoadDescriptor::ReceiverRegister(); Register receiver = LoadDescriptor::ReceiverRegister();
Register key = LoadDescriptor::NameRegister(); Register key = LoadDescriptor::NameRegister();
Register slot = LoadDescriptor::SlotRegister();
Register vector = LoadWithVectorDescriptor::VectorRegister();
__ Ldr(key, MemOperand(fp, indexOffset)); __ Ldr(key, MemOperand(fp, indexOffset));
__ B(&entry); __ B(&entry);
...@@ -1397,7 +1399,13 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm, ...@@ -1397,7 +1399,13 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm,
__ Ldr(receiver, MemOperand(fp, argumentsOffset)); __ Ldr(receiver, MemOperand(fp, argumentsOffset));
// Use inline caching to speed up access to arguments. // Use inline caching to speed up access to arguments.
Handle<Code> ic = masm->isolate()->builtins()->KeyedLoadIC_Megamorphic(); FeedbackVectorSpec spec(0, Code::KEYED_LOAD_IC);
Handle<TypeFeedbackVector> feedback_vector =
masm->isolate()->factory()->NewTypeFeedbackVector(&spec);
int index = feedback_vector->GetIndex(FeedbackVectorICSlot(0));
__ Mov(slot, Smi::FromInt(index));
__ Mov(vector, feedback_vector);
Handle<Code> ic = KeyedLoadICStub(masm->isolate()).GetCode();
__ Call(ic, RelocInfo::CODE_TARGET); __ Call(ic, RelocInfo::CODE_TARGET);
// Push the nth argument. // Push the nth argument.
......
...@@ -1044,13 +1044,21 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm, ...@@ -1044,13 +1044,21 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm,
Label entry, loop; Label entry, loop;
Register receiver = LoadDescriptor::ReceiverRegister(); Register receiver = LoadDescriptor::ReceiverRegister();
Register key = LoadDescriptor::NameRegister(); Register key = LoadDescriptor::NameRegister();
Register slot = LoadDescriptor::SlotRegister();
Register vector = LoadWithVectorDescriptor::VectorRegister();
__ mov(key, Operand(ebp, indexOffset)); __ mov(key, Operand(ebp, indexOffset));
__ jmp(&entry); __ jmp(&entry);
__ bind(&loop); __ bind(&loop);
__ mov(receiver, Operand(ebp, argumentsOffset)); // load arguments __ mov(receiver, Operand(ebp, argumentsOffset)); // load arguments
// Use inline caching to speed up access to arguments. // Use inline caching to speed up access to arguments.
Handle<Code> ic = masm->isolate()->builtins()->KeyedLoadIC_Megamorphic(); FeedbackVectorSpec spec(0, Code::KEYED_LOAD_IC);
Handle<TypeFeedbackVector> feedback_vector =
masm->isolate()->factory()->NewTypeFeedbackVector(&spec);
int index = feedback_vector->GetIndex(FeedbackVectorICSlot(0));
__ mov(slot, Immediate(Smi::FromInt(index)));
__ mov(vector, Immediate(feedback_vector));
Handle<Code> ic = KeyedLoadICStub(masm->isolate()).GetCode();
__ call(ic, RelocInfo::CODE_TARGET); __ call(ic, RelocInfo::CODE_TARGET);
// It is important that we do not have a test instruction after the // It is important that we do not have a test instruction after the
// call. A test instruction after the call is used to indicate that // call. A test instruction after the call is used to indicate that
......
...@@ -1399,6 +1399,8 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm, ...@@ -1399,6 +1399,8 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm,
Label entry, loop; Label entry, loop;
Register receiver = LoadDescriptor::ReceiverRegister(); Register receiver = LoadDescriptor::ReceiverRegister();
Register key = LoadDescriptor::NameRegister(); Register key = LoadDescriptor::NameRegister();
Register slot = LoadDescriptor::SlotRegister();
Register vector = LoadWithVectorDescriptor::VectorRegister();
__ lw(key, MemOperand(fp, indexOffset)); __ lw(key, MemOperand(fp, indexOffset));
__ Branch(&entry); __ Branch(&entry);
...@@ -1408,7 +1410,13 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm, ...@@ -1408,7 +1410,13 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm,
__ lw(receiver, MemOperand(fp, argumentsOffset)); __ lw(receiver, MemOperand(fp, argumentsOffset));
// Use inline caching to speed up access to arguments. // Use inline caching to speed up access to arguments.
Handle<Code> ic = masm->isolate()->builtins()->KeyedLoadIC_Megamorphic(); FeedbackVectorSpec spec(0, Code::KEYED_LOAD_IC);
Handle<TypeFeedbackVector> feedback_vector =
masm->isolate()->factory()->NewTypeFeedbackVector(&spec);
int index = feedback_vector->GetIndex(FeedbackVectorICSlot(0));
__ li(slot, Operand(Smi::FromInt(index)));
__ li(vector, feedback_vector);
Handle<Code> ic = KeyedLoadICStub(masm->isolate()).GetCode();
__ Call(ic, RelocInfo::CODE_TARGET); __ Call(ic, RelocInfo::CODE_TARGET);
__ push(v0); __ push(v0);
......
...@@ -1406,6 +1406,8 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm, ...@@ -1406,6 +1406,8 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm,
Label entry, loop; Label entry, loop;
Register receiver = LoadDescriptor::ReceiverRegister(); Register receiver = LoadDescriptor::ReceiverRegister();
Register key = LoadDescriptor::NameRegister(); Register key = LoadDescriptor::NameRegister();
Register slot = LoadDescriptor::SlotRegister();
Register vector = LoadWithVectorDescriptor::VectorRegister();
__ ld(key, MemOperand(fp, indexOffset)); __ ld(key, MemOperand(fp, indexOffset));
__ Branch(&entry); __ Branch(&entry);
...@@ -1415,7 +1417,13 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm, ...@@ -1415,7 +1417,13 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm,
__ ld(receiver, MemOperand(fp, argumentsOffset)); __ ld(receiver, MemOperand(fp, argumentsOffset));
// Use inline caching to speed up access to arguments. // Use inline caching to speed up access to arguments.
Handle<Code> ic = masm->isolate()->builtins()->KeyedLoadIC_Megamorphic(); FeedbackVectorSpec spec(0, Code::KEYED_LOAD_IC);
Handle<TypeFeedbackVector> feedback_vector =
masm->isolate()->factory()->NewTypeFeedbackVector(&spec);
int index = feedback_vector->GetIndex(FeedbackVectorICSlot(0));
__ li(slot, Operand(Smi::FromInt(index)));
__ li(vector, feedback_vector);
Handle<Code> ic = KeyedLoadICStub(masm->isolate()).GetCode();
__ Call(ic, RelocInfo::CODE_TARGET); __ Call(ic, RelocInfo::CODE_TARGET);
__ push(v0); __ push(v0);
......
...@@ -1105,6 +1105,8 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm, ...@@ -1105,6 +1105,8 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm,
const int limitOffset) { const int limitOffset) {
Register receiver = LoadDescriptor::ReceiverRegister(); Register receiver = LoadDescriptor::ReceiverRegister();
Register key = LoadDescriptor::NameRegister(); Register key = LoadDescriptor::NameRegister();
Register slot = LoadDescriptor::SlotRegister();
Register vector = LoadWithVectorDescriptor::VectorRegister();
// Copy all arguments from the array to the stack. // Copy all arguments from the array to the stack.
Label entry, loop; Label entry, loop;
...@@ -1114,7 +1116,13 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm, ...@@ -1114,7 +1116,13 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm,
__ movp(receiver, Operand(rbp, argumentsOffset)); // load arguments __ movp(receiver, Operand(rbp, argumentsOffset)); // load arguments
// Use inline caching to speed up access to arguments. // Use inline caching to speed up access to arguments.
Handle<Code> ic = masm->isolate()->builtins()->KeyedLoadIC_Megamorphic(); FeedbackVectorSpec spec(0, Code::KEYED_LOAD_IC);
Handle<TypeFeedbackVector> feedback_vector =
masm->isolate()->factory()->NewTypeFeedbackVector(&spec);
int index = feedback_vector->GetIndex(FeedbackVectorICSlot(0));
__ Move(slot, Smi::FromInt(index));
__ Move(vector, feedback_vector);
Handle<Code> ic = KeyedLoadICStub(masm->isolate()).GetCode();
__ Call(ic, RelocInfo::CODE_TARGET); __ Call(ic, RelocInfo::CODE_TARGET);
// It is important that we do not have a test instruction after the // It is important that we do not have a test instruction after the
// call. A test instruction after the call is used to indicate that // call. A test instruction after the call is used to indicate that
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment