Index: src/x64/code-stubs-x64.cc |
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc |
index a63288f2cb59ee4df39109fff6e69e3384ebbfb2..181e9f89644d873c06ea53796bf31f1d46da563e 100644 |
--- a/src/x64/code-stubs-x64.cc |
+++ b/src/x64/code-stubs-x64.cc |
@@ -2364,13 +2364,19 @@ static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) { |
} |
-void CallICStub::Generate_MonomorphicArray(MacroAssembler* masm, Label* miss) { |
+void CallIC_ArrayStub::Generate(MacroAssembler* masm) { |
// rdi - function |
- // rbx - feedback vector |
// rdx - slot id (as integer) |
+ Label miss; |
+ int argc = state_.arg_count(); |
+ ParameterCount actual(argc); |
+ |
+ EmitLoadTypeFeedbackVector(masm, rbx); |
+ __ SmiToInteger32(rdx, rdx); |
+ |
__ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, rcx); |
__ cmpq(rdi, rcx); |
- __ j(not_equal, miss); |
+ __ j(not_equal, &miss); |
__ movq(rax, Immediate(arg_count())); |
__ movp(rbx, FieldOperand(rbx, rdx, times_pointer_size, |
@@ -2380,26 +2386,9 @@ void CallICStub::Generate_MonomorphicArray(MacroAssembler* masm, Label* miss) { |
__ AssertUndefinedOrAllocationSite(rbx); |
ArrayConstructorStub stub(masm->isolate(), arg_count()); |
__ TailCallStub(&stub); |
-} |
- |
- |
-void CallICStub::Generate_CustomFeedbackCall(MacroAssembler* masm) { |
- // rdi - function |
- // rbx - feedback vector |
- // rdx - slot id |
- Label miss; |
- |
- __ SmiToInteger32(rdx, rdx); |
- |
- if (state_.stub_type() == CallIC::MONOMORPHIC_ARRAY) { |
- Generate_MonomorphicArray(masm, &miss); |
- } else { |
- // So far there is only one customer for our custom feedback scheme. |
- UNREACHABLE(); |
- } |
__ bind(&miss); |
- GenerateMiss(masm); |
+ GenerateMiss(masm, IC::kCallIC_Customization_Miss); |
// The slow case, we need this no matter what to complete a call after a miss. |
CallFunctionNoFeedback(masm, |
@@ -2426,11 +2415,6 @@ void CallICStub::Generate(MacroAssembler* masm) { |
EmitLoadTypeFeedbackVector(masm, rbx); |
- if (state_.stub_type() != CallIC::DEFAULT) { |
- Generate_CustomFeedbackCall(masm); |
- return; |
- } |
- |
// The checks. First, does rdi match the recorded monomorphic target? |
__ SmiToInteger32(rdx, rdx); |
__ cmpq(rdi, FieldOperand(rbx, rdx, times_pointer_size, |
@@ -2482,7 +2466,7 @@ void CallICStub::Generate(MacroAssembler* masm) { |
// We are here because tracing is on or we are going monomorphic. |
__ bind(&miss); |
- GenerateMiss(masm); |
+ GenerateMiss(masm, IC::kCallIC_Miss); |
// the slow case |
__ bind(&slow_start); |
@@ -2498,7 +2482,7 @@ void CallICStub::Generate(MacroAssembler* masm) { |
} |
-void CallICStub::GenerateMiss(MacroAssembler* masm) { |
+void CallICStub::GenerateMiss(MacroAssembler* masm, IC::UtilityId id) { |
// Get the receiver of the function from the stack; 1 ~ return address. |
__ movp(rcx, Operand(rsp, (state_.arg_count() + 1) * kPointerSize)); |
@@ -2513,7 +2497,7 @@ void CallICStub::GenerateMiss(MacroAssembler* masm) { |
__ Push(rdx); |
// Call the entry. |
- ExternalReference miss = ExternalReference(IC_Utility(IC::kCallIC_Miss), |
+ ExternalReference miss = ExternalReference(IC_Utility(id), |
masm->isolate()); |
__ CallExternalReference(miss, 4); |