Commit 0e8d97c1 authored by mvstanton's avatar mvstanton Committed by Commit bot

CallIC MISS handler doesn't need receiver.

Looking up and passing this argument is unnecessary.

R=ulan@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#26464}
parent 2491a639
......@@ -2789,26 +2789,20 @@ void CallICStub::Generate(MacroAssembler* masm) {
void CallICStub::GenerateMiss(MacroAssembler* masm) {
// Get the receiver of the function from the stack.
__ ldr(r4, MemOperand(sp, arg_count() * kPointerSize));
FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
{
FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
// Push the receiver and the function and feedback info.
__ Push(r1, r2, r3);
// Push the receiver and the function and feedback info.
__ Push(r4, r1, r2, r3);
// Call the entry.
IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss
: IC::kCallIC_Customization_Miss;
// Call the entry.
IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss
: IC::kCallIC_Customization_Miss;
ExternalReference miss = ExternalReference(IC_Utility(id), masm->isolate());
__ CallExternalReference(miss, 3);
ExternalReference miss = ExternalReference(IC_Utility(id),
masm->isolate());
__ CallExternalReference(miss, 4);
// Move result to edi and exit the internal frame.
__ mov(r1, r0);
}
// Move result to edi and exit the internal frame.
__ mov(r1, r0);
}
......
......@@ -3181,26 +3181,20 @@ void CallICStub::Generate(MacroAssembler* masm) {
void CallICStub::GenerateMiss(MacroAssembler* masm) {
ASM_LOCATION("CallICStub[Miss]");
// Get the receiver of the function from the stack.
__ Peek(x4, arg_count() * kPointerSize);
FrameScope scope(masm, StackFrame::INTERNAL);
{
FrameScope scope(masm, StackFrame::INTERNAL);
// Push the receiver and the function and feedback info.
__ Push(x1, x2, x3);
// Push the receiver and the function and feedback info.
__ Push(x4, x1, x2, x3);
// Call the entry.
IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss
: IC::kCallIC_Customization_Miss;
// Call the entry.
IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss
: IC::kCallIC_Customization_Miss;
ExternalReference miss = ExternalReference(IC_Utility(id), masm->isolate());
__ CallExternalReference(miss, 3);
ExternalReference miss = ExternalReference(IC_Utility(id),
masm->isolate());
__ CallExternalReference(miss, 4);
// Move result to edi and exit the internal frame.
__ Mov(x1, x0);
}
// Move result to edi and exit the internal frame.
__ Mov(x1, x0);
}
......
......@@ -2376,29 +2376,22 @@ void CallICStub::Generate(MacroAssembler* masm) {
void CallICStub::GenerateMiss(MacroAssembler* masm) {
// Get the receiver of the function from the stack; 1 ~ return address.
__ mov(ecx, Operand(esp, (arg_count() + 1) * kPointerSize));
FrameScope scope(masm, StackFrame::INTERNAL);
{
FrameScope scope(masm, StackFrame::INTERNAL);
// Push the receiver and the function and feedback info.
__ push(ecx);
__ push(edi);
__ push(ebx);
__ push(edx);
// Push the function and feedback info.
__ push(edi);
__ push(ebx);
__ push(edx);
// Call the entry.
IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss
: IC::kCallIC_Customization_Miss;
// Call the entry.
IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss
: IC::kCallIC_Customization_Miss;
ExternalReference miss = ExternalReference(IC_Utility(id),
masm->isolate());
__ CallExternalReference(miss, 4);
ExternalReference miss = ExternalReference(IC_Utility(id), masm->isolate());
__ CallExternalReference(miss, 3);
// Move result to edi and exit the internal frame.
__ mov(edi, eax);
}
// Move result to edi and exit the internal frame.
__ mov(edi, eax);
}
......
......@@ -2138,7 +2138,7 @@ MaybeHandle<Object> KeyedStoreIC::Store(Handle<Object> object,
}
bool CallIC::DoCustomHandler(Handle<Object> receiver, Handle<Object> function,
bool CallIC::DoCustomHandler(Handle<Object> function,
const CallICState& callic_state) {
DCHECK(FLAG_use_ic && function->IsJSFunction());
......@@ -2203,7 +2203,7 @@ void CallIC::PatchMegamorphic(Handle<Object> function) {
}
void CallIC::HandleMiss(Handle<Object> receiver, Handle<Object> function) {
void CallIC::HandleMiss(Handle<Object> function) {
CallICState callic_state(target()->extra_ic_state());
Handle<Object> name = isolate()->factory()->empty_string();
CallICNexus* nexus = casted_nexus<CallICNexus>();
......@@ -2226,7 +2226,7 @@ void CallIC::HandleMiss(Handle<Object> receiver, Handle<Object> function) {
feedback->IsAllocationSite());
// Do we want to install a custom handler?
if (FLAG_use_ic && DoCustomHandler(receiver, function, callic_state)) {
if (FLAG_use_ic && DoCustomHandler(function, callic_state)) {
return;
}
......@@ -2255,15 +2255,14 @@ void CallIC::HandleMiss(Handle<Object> receiver, Handle<Object> function) {
RUNTIME_FUNCTION(CallIC_Miss) {
TimerEventScope<TimerEventIcMiss> timer(isolate);
HandleScope scope(isolate);
DCHECK(args.length() == 4);
Handle<Object> receiver = args.at<Object>(0);
Handle<Object> function = args.at<Object>(1);
Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(2);
Handle<Smi> slot = args.at<Smi>(3);
DCHECK(args.length() == 3);
Handle<Object> function = args.at<Object>(0);
Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(1);
Handle<Smi> slot = args.at<Smi>(2);
FeedbackVectorICSlot vector_slot = vector->ToICSlot(slot->value());
CallICNexus nexus(vector, vector_slot);
CallIC ic(isolate, &nexus);
ic.HandleMiss(receiver, function);
ic.HandleMiss(function);
return *function;
}
......@@ -2271,10 +2270,10 @@ RUNTIME_FUNCTION(CallIC_Miss) {
RUNTIME_FUNCTION(CallIC_Customization_Miss) {
TimerEventScope<TimerEventIcMiss> timer(isolate);
HandleScope scope(isolate);
DCHECK(args.length() == 4);
Handle<Object> function = args.at<Object>(1);
Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(2);
Handle<Smi> slot = args.at<Smi>(3);
DCHECK(args.length() == 3);
Handle<Object> function = args.at<Object>(0);
Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(1);
Handle<Smi> slot = args.at<Smi>(2);
FeedbackVectorICSlot vector_slot = vector->ToICSlot(slot->value());
CallICNexus nexus(vector, vector_slot);
// A miss on a custom call ic always results in going megamorphic.
......
......@@ -348,10 +348,10 @@ class CallIC : public IC {
void PatchMegamorphic(Handle<Object> function);
void HandleMiss(Handle<Object> receiver, Handle<Object> function);
void HandleMiss(Handle<Object> function);
// Returns true if a custom handler was installed.
bool DoCustomHandler(Handle<Object> receiver, Handle<Object> function,
bool DoCustomHandler(Handle<Object> function,
const CallICState& callic_state);
// Code generator routines.
......
......@@ -2928,26 +2928,20 @@ void CallICStub::Generate(MacroAssembler* masm) {
void CallICStub::GenerateMiss(MacroAssembler* masm) {
// Get the receiver of the function from the stack.
__ lw(t0, MemOperand(sp, arg_count() * kPointerSize));
FrameScope scope(masm, StackFrame::INTERNAL);
{
FrameScope scope(masm, StackFrame::INTERNAL);
// Push the receiver and the function and feedback info.
__ Push(a1, a2, a3);
// Push the receiver and the function and feedback info.
__ Push(t0, a1, a2, a3);
// Call the entry.
IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss
: IC::kCallIC_Customization_Miss;
// Call the entry.
IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss
: IC::kCallIC_Customization_Miss;
ExternalReference miss = ExternalReference(IC_Utility(id), masm->isolate());
__ CallExternalReference(miss, 3);
ExternalReference miss = ExternalReference(IC_Utility(id),
masm->isolate());
__ CallExternalReference(miss, 4);
// Move result to a1 and exit the internal frame.
__ mov(a1, v0);
}
// Move result to a1 and exit the internal frame.
__ mov(a1, v0);
}
......
......@@ -3003,26 +3003,20 @@ void CallICStub::Generate(MacroAssembler* masm) {
void CallICStub::GenerateMiss(MacroAssembler* masm) {
// Get the receiver of the function from the stack.
__ ld(a4, MemOperand(sp, arg_count() * kPointerSize));
FrameScope scope(masm, StackFrame::INTERNAL);
{
FrameScope scope(masm, StackFrame::INTERNAL);
// Push the receiver and the function and feedback info.
__ Push(a1, a2, a3);
// Push the receiver and the function and feedback info.
__ Push(a4, a1, a2, a3);
// Call the entry.
IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss
: IC::kCallIC_Customization_Miss;
// Call the entry.
IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss
: IC::kCallIC_Customization_Miss;
ExternalReference miss = ExternalReference(IC_Utility(id), masm->isolate());
__ CallExternalReference(miss, 3);
ExternalReference miss = ExternalReference(IC_Utility(id),
masm->isolate());
__ CallExternalReference(miss, 4);
// Move result to a1 and exit the internal frame.
__ mov(a1, v0);
}
// Move result to a1 and exit the internal frame.
__ mov(a1, v0);
}
......
......@@ -2245,30 +2245,23 @@ void CallICStub::Generate(MacroAssembler* masm) {
void CallICStub::GenerateMiss(MacroAssembler* masm) {
// Get the receiver of the function from the stack; 1 ~ return address.
__ movp(rcx, Operand(rsp, (arg_count() + 1) * kPointerSize));
FrameScope scope(masm, StackFrame::INTERNAL);
{
FrameScope scope(masm, StackFrame::INTERNAL);
// Push the receiver and the function and feedback info.
__ Push(rcx);
__ Push(rdi);
__ Push(rbx);
__ Integer32ToSmi(rdx, rdx);
__ Push(rdx);
// Push the receiver and the function and feedback info.
__ Push(rdi);
__ Push(rbx);
__ Integer32ToSmi(rdx, rdx);
__ Push(rdx);
// Call the entry.
IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss
: IC::kCallIC_Customization_Miss;
// Call the entry.
IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss
: IC::kCallIC_Customization_Miss;
ExternalReference miss = ExternalReference(IC_Utility(id),
masm->isolate());
__ CallExternalReference(miss, 4);
ExternalReference miss = ExternalReference(IC_Utility(id), masm->isolate());
__ CallExternalReference(miss, 3);
// Move result to edi and exit the internal frame.
__ movp(rdi, rax);
}
// Move result to edi and exit the internal frame.
__ movp(rdi, rax);
}
......
......@@ -2041,29 +2041,22 @@ void CallICStub::Generate(MacroAssembler* masm) {
void CallICStub::GenerateMiss(MacroAssembler* masm) {
// Get the receiver of the function from the stack; 1 ~ return address.
__ mov(ecx, Operand(esp, (arg_count() + 1) * kPointerSize));
FrameScope scope(masm, StackFrame::INTERNAL);
{
FrameScope scope(masm, StackFrame::INTERNAL);
// Push the receiver and the function and feedback info.
__ push(ecx);
__ push(edi);
__ push(ebx);
__ push(edx);
// Push the receiver and the function and feedback info.
__ push(edi);
__ push(ebx);
__ push(edx);
// Call the entry.
IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss
: IC::kCallIC_Customization_Miss;
// Call the entry.
IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss
: IC::kCallIC_Customization_Miss;
ExternalReference miss = ExternalReference(IC_Utility(id),
masm->isolate());
__ CallExternalReference(miss, 4);
ExternalReference miss = ExternalReference(IC_Utility(id), masm->isolate());
__ CallExternalReference(miss, 3);
// Move result to edi and exit the internal frame.
__ mov(edi, eax);
}
// Move result to edi and exit the internal frame.
__ mov(edi, eax);
}
......
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