Index: src/ia32/code-stubs-ia32.cc |
diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc |
index 029e8cf2367854ff5b93e51a947a4840e24861c6..9d7a66850ece98ef11976ce2771ffe4d0782e542 100644 |
--- a/src/ia32/code-stubs-ia32.cc |
+++ b/src/ia32/code-stubs-ia32.cc |
@@ -2209,28 +2209,19 @@ static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) { |
} |
-void CallIC_ArrayStub::Generate(MacroAssembler* masm) { |
+void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) { |
// edi - function |
// edx - slot id |
// ebx - vector |
- Label miss; |
- int argc = arg_count(); |
- ParameterCount actual(argc); |
- |
__ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); |
__ cmp(edi, ecx); |
- __ j(not_equal, &miss); |
+ __ j(not_equal, miss); |
__ mov(eax, arg_count()); |
+ // Reload ecx. |
__ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size, |
FixedArray::kHeaderSize)); |
- // Verify that ecx contains an AllocationSite |
- Factory* factory = masm->isolate()->factory(); |
- __ cmp(FieldOperand(ecx, HeapObject::kMapOffset), |
- factory->allocation_site_map()); |
- __ j(not_equal, &miss); |
- |
// Increment the call count for monomorphic function calls. |
__ add(FieldOperand(ebx, edx, times_half_pointer_size, |
FixedArray::kHeaderSize + kPointerSize), |
@@ -2241,12 +2232,7 @@ void CallIC_ArrayStub::Generate(MacroAssembler* masm) { |
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. |
- __ Set(eax, arg_count()); |
- __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
+ // Unreachable. |
} |
@@ -2321,11 +2307,21 @@ void CallICStub::Generate(MacroAssembler* masm) { |
} |
__ bind(&extra_checks_or_miss); |
- Label uninitialized, miss; |
+ Label uninitialized, miss, not_allocation_site; |
__ cmp(ecx, Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate))); |
__ j(equal, &slow_start); |
+ // Check if we have an allocation site. |
+ __ CompareRoot(FieldOperand(ecx, HeapObject::kMapOffset), |
+ Heap::kAllocationSiteMapRootIndex); |
+ __ j(not_equal, ¬_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) { |
@@ -2415,10 +2411,7 @@ void CallICStub::GenerateMiss(MacroAssembler* masm) { |
__ push(edx); |
// 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(edi, eax); |
@@ -4892,13 +4885,6 @@ void CallICTrampolineStub::Generate(MacroAssembler* masm) { |
} |
-void CallIC_ArrayTrampolineStub::Generate(MacroAssembler* masm) { |
- EmitLoadTypeFeedbackVector(masm, ebx); |
- CallIC_ArrayStub stub(isolate(), state()); |
- __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); |
-} |
- |
- |
void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { |
if (masm->isolate()->function_entry_hook() != NULL) { |
ProfileEntryHookStub stub(masm->isolate()); |