Index: src/ia32/code-stubs-ia32.cc |
diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc |
index 1d53d719a99b0fc1a7eb539ef4d4e16f19e65543..91958652725464678ed0a5b82731a9b162721a4a 100644 |
--- a/src/ia32/code-stubs-ia32.cc |
+++ b/src/ia32/code-stubs-ia32.cc |
@@ -2247,6 +2247,11 @@ void CallIC_ArrayStub::Generate(MacroAssembler* masm) { |
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), |
+ Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement))); |
+ |
__ mov(ebx, ecx); |
__ mov(edx, edi); |
ArrayConstructorStub stub(masm->isolate(), arg_count()); |
@@ -2306,6 +2311,11 @@ void CallICStub::Generate(MacroAssembler* masm) { |
// convincing us that we have a monomorphic JSFunction. |
__ JumpIfSmi(edi, &extra_checks_or_miss); |
+ // Increment the call count for monomorphic function calls. |
+ __ add(FieldOperand(ebx, edx, times_half_pointer_size, |
+ FixedArray::kHeaderSize + kPointerSize), |
+ Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement))); |
+ |
__ bind(&have_js_function); |
if (CallAsMethod()) { |
EmitContinueIfStrictOrNative(masm, &cont); |
@@ -2377,6 +2387,11 @@ void CallICStub::Generate(MacroAssembler* masm) { |
// Update stats. |
__ add(FieldOperand(ebx, with_types_offset), Immediate(Smi::FromInt(1))); |
+ // Initialize the call counter. |
+ __ mov(FieldOperand(ebx, edx, times_half_pointer_size, |
+ FixedArray::kHeaderSize + kPointerSize), |
+ Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement))); |
+ |
// Store the function. Use a stub since we need a frame for allocation. |
// ebx - vector |
// edx - slot |