Commit ee72c407 authored by mbrandy's avatar mbrandy Committed by Commit bot

PPC: [stubs] Change CallICStub to utilize the ConvertReceiverMode.

Port d80fd48e

Original commit message:
    The CallICStub has call-site specific knowledge about the receiver,
    which we did not utilize; plus the CallICStub does in some case know
    whether it is about to [[Call]] a function or potentially some other
    callable. In the common case we actually know that the target is a
    function and so we can use the CallFunction builtin directly instead
    of redispatching in the Call builtin.

R=bmeurer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=chromium:555127, v8:4413
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#32185}
parent 395884de
...@@ -2619,7 +2619,7 @@ void CallICStub::Generate(MacroAssembler* masm) { ...@@ -2619,7 +2619,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
FixedArray::OffsetOfElementAt(TypeFeedbackVector::kWithTypesIndex); FixedArray::OffsetOfElementAt(TypeFeedbackVector::kWithTypesIndex);
const int generic_offset = const int generic_offset =
FixedArray::OffsetOfElementAt(TypeFeedbackVector::kGenericCountIndex); FixedArray::OffsetOfElementAt(TypeFeedbackVector::kGenericCountIndex);
Label extra_checks_or_miss, call; Label extra_checks_or_miss, call, call_function;
int argc = arg_count(); int argc = arg_count();
ParameterCount actual(argc); ParameterCount actual(argc);
...@@ -2656,9 +2656,10 @@ void CallICStub::Generate(MacroAssembler* masm) { ...@@ -2656,9 +2656,10 @@ void CallICStub::Generate(MacroAssembler* masm) {
__ AddSmiLiteral(r6, r6, Smi::FromInt(CallICNexus::kCallCountIncrement), r0); __ AddSmiLiteral(r6, r6, Smi::FromInt(CallICNexus::kCallCountIncrement), r0);
__ StoreP(r6, FieldMemOperand(r9, count_offset), r0); __ StoreP(r6, FieldMemOperand(r9, count_offset), r0);
__ bind(&call); __ bind(&call_function);
__ mov(r3, Operand(argc)); __ mov(r3, Operand(argc));
__ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); __ Jump(masm->isolate()->builtins()->CallFunction(convert_mode()),
RelocInfo::CODE_TARGET);
__ bind(&extra_checks_or_miss); __ bind(&extra_checks_or_miss);
Label uninitialized, miss, not_allocation_site; Label uninitialized, miss, not_allocation_site;
...@@ -2699,7 +2700,11 @@ void CallICStub::Generate(MacroAssembler* masm) { ...@@ -2699,7 +2700,11 @@ void CallICStub::Generate(MacroAssembler* masm) {
__ LoadP(r7, FieldMemOperand(r5, generic_offset)); __ LoadP(r7, FieldMemOperand(r5, generic_offset));
__ AddSmiLiteral(r7, r7, Smi::FromInt(1), r0); __ AddSmiLiteral(r7, r7, Smi::FromInt(1), r0);
__ StoreP(r7, FieldMemOperand(r5, generic_offset), r0); __ StoreP(r7, FieldMemOperand(r5, generic_offset), r0);
__ b(&call);
__ bind(&call);
__ mov(r3, Operand(argc));
__ Jump(masm->isolate()->builtins()->Call(convert_mode()),
RelocInfo::CODE_TARGET);
__ bind(&uninitialized); __ bind(&uninitialized);
...@@ -2745,7 +2750,7 @@ void CallICStub::Generate(MacroAssembler* masm) { ...@@ -2745,7 +2750,7 @@ void CallICStub::Generate(MacroAssembler* masm) {
__ Pop(r4); __ Pop(r4);
} }
__ b(&call); __ b(&call_function);
// We are here because tracing is on or we encountered a MISS case we can't // We are here because tracing is on or we encountered a MISS case we can't
// handle here. // handle here.
......
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