Index: src/arm/code-stubs-arm.cc |
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc |
index c31f089961f60165ab5f5904cf1215b4f982e7ae..428874d98584c9cf7cd9c4809f4b635a2b4daa1f 100644 |
--- a/src/arm/code-stubs-arm.cc |
+++ b/src/arm/code-stubs-arm.cc |
@@ -2706,6 +2706,13 @@ void CallIC_ArrayStub::Generate(MacroAssembler* masm) { |
__ CompareRoot(r5, Heap::kAllocationSiteMapRootIndex); |
__ b(ne, &miss); |
+ // Increment the call count for monomorphic function calls. |
+ __ add(r2, r2, Operand::PointerOffsetFromSmiKey(r3)); |
+ __ add(r2, r2, Operand(FixedArray::kHeaderSize + kPointerSize)); |
+ __ ldr(r3, FieldMemOperand(r2, 0)); |
+ __ add(r3, r3, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement))); |
+ __ str(r3, FieldMemOperand(r2, 0)); |
+ |
__ mov(r2, r4); |
__ mov(r3, r1); |
ArrayConstructorStub stub(masm->isolate(), arg_count()); |
@@ -2765,6 +2772,13 @@ void CallICStub::Generate(MacroAssembler* masm) { |
// convincing us that we have a monomorphic JSFunction. |
__ JumpIfSmi(r1, &extra_checks_or_miss); |
+ // Increment the call count for monomorphic function calls. |
+ __ add(r2, r2, Operand::PointerOffsetFromSmiKey(r3)); |
+ __ add(r2, r2, Operand(FixedArray::kHeaderSize + kPointerSize)); |
+ __ ldr(r3, FieldMemOperand(r2, 0)); |
+ __ add(r3, r3, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement))); |
+ __ str(r3, FieldMemOperand(r2, 0)); |
+ |
__ bind(&have_js_function); |
if (CallAsMethod()) { |
EmitContinueIfStrictOrNative(masm, &cont); |
@@ -2840,6 +2854,11 @@ void CallICStub::Generate(MacroAssembler* masm) { |
__ add(r4, r4, Operand(Smi::FromInt(1))); |
__ str(r4, FieldMemOperand(r2, with_types_offset)); |
+ // Initialize the call counter. |
+ __ Move(r5, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement))); |
+ __ add(r4, r2, Operand::PointerOffsetFromSmiKey(r3)); |
+ __ str(r5, FieldMemOperand(r4, FixedArray::kHeaderSize + kPointerSize)); |
+ |
// Store the function. Use a stub since we need a frame for allocation. |
// r2 - vector |
// r3 - slot |