Index: src/arm/code-stubs-arm.cc |
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc |
index af86e47a35f44bbca7559429624caa40e2af2242..ced550b59ad6fb2c718a96257781758e084efdb5 100644 |
--- a/src/arm/code-stubs-arm.cc |
+++ b/src/arm/code-stubs-arm.cc |
@@ -2556,26 +2556,16 @@ static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) { |
} |
-void CallIC_ArrayStub::Generate(MacroAssembler* masm) { |
+void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) { |
// r1 - function |
// r3 - slot id |
// r2 - vector |
- Label miss; |
- int argc = arg_count(); |
- ParameterCount actual(argc); |
- |
- __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, r4); |
- __ cmp(r1, r4); |
- __ b(ne, &miss); |
+ // r4 - allocation site (loaded from vector[slot]) |
+ __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, r5); |
+ __ cmp(r1, r5); |
+ __ b(ne, miss); |
__ mov(r0, Operand(arg_count())); |
- __ add(r4, r2, Operand::PointerOffsetFromSmiKey(r3)); |
- __ ldr(r4, FieldMemOperand(r4, FixedArray::kHeaderSize)); |
- |
- // Verify that r4 contains an AllocationSite |
- __ ldr(r5, FieldMemOperand(r4, HeapObject::kMapOffset)); |
- __ CompareRoot(r5, Heap::kAllocationSiteMapRootIndex); |
- __ b(ne, &miss); |
// Increment the call count for monomorphic function calls. |
__ add(r2, r2, Operand::PointerOffsetFromSmiKey(r3)); |
@@ -2588,13 +2578,6 @@ void CallIC_ArrayStub::Generate(MacroAssembler* masm) { |
__ mov(r3, r1); |
ArrayConstructorStub stub(masm->isolate(), arg_count()); |
__ TailCallStub(&stub); |
- |
- __ bind(&miss); |
- GenerateMiss(masm); |
- |
- // The slow case, we need this no matter what to complete a call after a miss. |
- __ mov(r0, Operand(arg_count())); |
- __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
} |
@@ -2669,11 +2652,21 @@ void CallICStub::Generate(MacroAssembler* masm) { |
} |
__ bind(&extra_checks_or_miss); |
- Label uninitialized, miss; |
+ Label uninitialized, miss, not_allocation_site; |
__ CompareRoot(r4, Heap::kmegamorphic_symbolRootIndex); |
__ b(eq, &slow_start); |
+ // Verify that r4 contains an AllocationSite |
+ __ ldr(r5, FieldMemOperand(r4, HeapObject::kMapOffset)); |
+ __ CompareRoot(r5, Heap::kAllocationSiteMapRootIndex); |
+ __ b(ne, ¬_allocation_site); |
+ |
+ // We have an allocation site. |
+ HandleArrayCase(masm, &miss); |
+ |
+ __ bind(¬_allocation_site); |
+ |
// The following cases attempt to handle MISS cases without going to the |
// runtime. |
if (FLAG_trace_ic) { |
@@ -2764,10 +2757,7 @@ void CallICStub::GenerateMiss(MacroAssembler* masm) { |
__ Push(r1, r2, r3); |
// Call the entry. |
- Runtime::FunctionId id = GetICState() == DEFAULT |
- ? Runtime::kCallIC_Miss |
- : Runtime::kCallIC_Customization_Miss; |
- __ CallRuntime(id, 3); |
+ __ CallRuntime(Runtime::kCallIC_Miss, 3); |
// Move result to edi and exit the internal frame. |
__ mov(r1, r0); |
@@ -4276,13 +4266,6 @@ void CallICTrampolineStub::Generate(MacroAssembler* masm) { |
} |
-void CallIC_ArrayTrampolineStub::Generate(MacroAssembler* masm) { |
- EmitLoadTypeFeedbackVector(masm, r2); |
- CallIC_ArrayStub stub(isolate(), state()); |
- __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET); |
-} |
- |
- |
void LoadICStub::Generate(MacroAssembler* masm) { GenerateImpl(masm, false); } |