Index: src/x87/code-stubs-x87.cc |
diff --git a/src/x87/code-stubs-x87.cc b/src/x87/code-stubs-x87.cc |
index 11744ff623e921b3fad1778be2a7e8d7a362133e..ce572ae86c42ce20e72bee3ca6781801f98d9b91 100644 |
--- a/src/x87/code-stubs-x87.cc |
+++ b/src/x87/code-stubs-x87.cc |
@@ -1644,6 +1644,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { |
// edi : the function to call |
Isolate* isolate = masm->isolate(); |
Label initialize, done, miss, megamorphic, not_array_function; |
+ Label done_increment_count; |
// Load the cache state into ecx. |
__ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size, |
@@ -1656,7 +1657,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { |
// type-feedback-vector.h). |
Label check_allocation_site; |
__ cmp(edi, FieldOperand(ecx, WeakCell::kValueOffset)); |
- __ j(equal, &done, Label::kFar); |
+ __ j(equal, &done_increment_count, Label::kFar); |
__ CompareRoot(ecx, Heap::kmegamorphic_symbolRootIndex); |
__ j(equal, &done, Label::kFar); |
__ CompareRoot(FieldOperand(ecx, HeapObject::kMapOffset), |
@@ -1679,7 +1680,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { |
__ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); |
__ cmp(edi, ecx); |
__ j(not_equal, &megamorphic); |
- __ jmp(&done, Label::kFar); |
+ __ jmp(&done_increment_count, Label::kFar); |
__ bind(&miss); |
@@ -1698,6 +1699,12 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { |
// An uninitialized cache is patched with the function or sentinel to |
// indicate the ElementsKind if function is the Array constructor. |
__ bind(&initialize); |
+ |
+ // Initialize the call counter. |
+ __ mov(FieldOperand(ebx, edx, times_half_pointer_size, |
+ FixedArray::kHeaderSize + kPointerSize), |
+ Immediate(Smi::FromInt(ConstructICNexus::kCallCountIncrement))); |
+ |
// Make sure the function is the Array() function |
__ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); |
__ cmp(edi, ecx); |
@@ -1713,11 +1720,18 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { |
__ bind(¬_array_function); |
CreateWeakCellStub weak_cell_stub(isolate); |
CallStubInRecordCallTarget(masm, &weak_cell_stub); |
+ __ jmp(&done); |
+ |
+ __ bind(&done_increment_count); |
+ __ add(FieldOperand(ebx, edx, times_half_pointer_size, |
+ FixedArray::kHeaderSize + kPointerSize), |
+ Immediate(Smi::FromInt(ConstructICNexus::kCallCountIncrement))); |
+ |
__ bind(&done); |
} |
-void CallConstructStub::Generate(MacroAssembler* masm) { |
+void ConstructICStub::Generate(MacroAssembler* masm) { |
// eax : number of arguments |
// ebx : feedback vector |
// edx : slot in feedback vector (Smi, for RecordCallTarget) |