Index: src/x64/code-stubs-x64.cc |
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc |
index a4c772f5ba6c47c6e2b91b9ba454944755729676..25c9336e108fce9e108aed50607d318c5cad5cb6 100644 |
--- a/src/x64/code-stubs-x64.cc |
+++ b/src/x64/code-stubs-x64.cc |
@@ -1786,6 +1786,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { |
Isolate* isolate = masm->isolate(); |
Label initialize, done, miss, megamorphic, not_array_function, |
done_no_smi_convert; |
+ Label done_increment_count; |
// Load the cache state into r11. |
__ SmiToInteger32(rdx, rdx); |
@@ -1799,7 +1800,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { |
// type-feedback-vector.h). |
Label check_allocation_site; |
__ cmpp(rdi, FieldOperand(r11, WeakCell::kValueOffset)); |
- __ j(equal, &done, Label::kFar); |
+ __ j(equal, &done_increment_count, Label::kFar); |
__ CompareRoot(r11, Heap::kmegamorphic_symbolRootIndex); |
__ j(equal, &done, Label::kFar); |
__ CompareRoot(FieldOperand(r11, HeapObject::kMapOffset), |
@@ -1823,7 +1824,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { |
__ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, r11); |
__ cmpp(rdi, r11); |
__ j(not_equal, &megamorphic); |
- __ jmp(&done); |
+ __ jmp(&done_increment_count); |
__ bind(&miss); |
@@ -1842,6 +1843,11 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { |
// indicate the ElementsKind if function is the Array constructor. |
__ bind(&initialize); |
+ // Initialize the call counter. |
+ __ Move(FieldOperand(rbx, rdx, times_pointer_size, |
+ FixedArray::kHeaderSize + kPointerSize), |
+ Smi::FromInt(ConstructICNexus::kCallCountIncrement)); |
+ |
// Make sure the function is the Array() function |
__ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, r11); |
__ cmpp(rdi, r11); |
@@ -1856,6 +1862,11 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { |
CallStubInRecordCallTarget(masm, &weak_cell_stub); |
__ jmp(&done_no_smi_convert); |
+ __ bind(&done_increment_count); |
+ __ SmiAddConstant(FieldOperand(rbx, rdx, times_pointer_size, |
+ FixedArray::kHeaderSize + kPointerSize), |
+ Smi::FromInt(ConstructICNexus::kCallCountIncrement)); |
+ |
__ bind(&done); |
__ Integer32ToSmi(rdx, rdx); |
@@ -1863,7 +1874,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { |
} |
-void CallConstructStub::Generate(MacroAssembler* masm) { |
+void ConstructICStub::Generate(MacroAssembler* masm) { |
// rax : number of arguments |
// rbx : feedback vector |
// rdx : slot in feedback vector (Smi) |