Index: src/x64/code-stubs-x64.cc |
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc |
index 7f4560ead08534a389feac20fd8ebd57bd0b2858..cfcae0bd94e597a677b202900790c367530e9a19 100644 |
--- a/src/x64/code-stubs-x64.cc |
+++ b/src/x64/code-stubs-x64.cc |
@@ -2130,6 +2130,11 @@ void CallIC_ArrayStub::Generate(MacroAssembler* masm) { |
factory->allocation_site_map()); |
__ j(not_equal, &miss); |
+ // Increment the call count for monomorphic function calls. |
+ __ SmiAddConstant(FieldOperand(rbx, rdx, times_pointer_size, |
+ FixedArray::kHeaderSize + kPointerSize), |
+ Smi::FromInt(CallICNexus::kCallCountIncrement)); |
+ |
__ movp(rbx, rcx); |
__ movp(rdx, rdi); |
ArrayConstructorStub stub(masm->isolate(), arg_count()); |
@@ -2191,6 +2196,11 @@ void CallICStub::Generate(MacroAssembler* masm) { |
// convincing us that we have a monomorphic JSFunction. |
__ JumpIfSmi(rdi, &extra_checks_or_miss); |
+ // Increment the call count for monomorphic function calls. |
+ __ SmiAddConstant(FieldOperand(rbx, rdx, times_pointer_size, |
+ FixedArray::kHeaderSize + kPointerSize), |
+ Smi::FromInt(CallICNexus::kCallCountIncrement)); |
+ |
__ bind(&have_js_function); |
if (CallAsMethod()) { |
EmitContinueIfStrictOrNative(masm, &cont); |
@@ -2261,6 +2271,11 @@ void CallICStub::Generate(MacroAssembler* masm) { |
// Update stats. |
__ SmiAddConstant(FieldOperand(rbx, with_types_offset), Smi::FromInt(1)); |
+ // Initialize the call counter. |
+ __ Move(FieldOperand(rbx, rdx, times_pointer_size, |
+ FixedArray::kHeaderSize + kPointerSize), |
+ Smi::FromInt(CallICNexus::kCallCountIncrement)); |
+ |
// Store the function. Use a stub since we need a frame for allocation. |
// rbx - vector |
// rdx - slot (needs to be in smi form) |