Index: src/mips64/code-stubs-mips64.cc |
diff --git a/src/mips64/code-stubs-mips64.cc b/src/mips64/code-stubs-mips64.cc |
index b358b95c328cca8a1499349ac225da4aa86d6d76..79dc9cb27a5260908be8006408be7a774693d8ea 100644 |
--- a/src/mips64/code-stubs-mips64.cc |
+++ b/src/mips64/code-stubs-mips64.cc |
@@ -2918,6 +2918,13 @@ void CallIC_ArrayStub::Generate(MacroAssembler* masm) { |
__ LoadRoot(at, Heap::kAllocationSiteMapRootIndex); |
__ Branch(&miss, ne, a5, Operand(at)); |
+ // Increment the call count for monomorphic function calls. |
+ __ dsrl(t0, a3, 32 - kPointerSizeLog2); |
+ __ Daddu(a3, a2, Operand(t0)); |
+ __ ld(t0, FieldMemOperand(a3, FixedArray::kHeaderSize + kPointerSize)); |
+ __ Daddu(t0, t0, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement))); |
+ __ sd(t0, FieldMemOperand(a3, FixedArray::kHeaderSize + kPointerSize)); |
+ |
__ mov(a2, a4); |
__ mov(a3, a1); |
ArrayConstructorStub stub(masm->isolate(), arg_count()); |
@@ -2977,6 +2984,13 @@ void CallICStub::Generate(MacroAssembler* masm) { |
// convincing us that we have a monomorphic JSFunction. |
__ JumpIfSmi(a1, &extra_checks_or_miss); |
+ // Increment the call count for monomorphic function calls. |
+ __ dsrl(t0, a3, 32 - kPointerSizeLog2); |
+ __ Daddu(a3, a2, Operand(t0)); |
+ __ ld(t0, FieldMemOperand(a3, FixedArray::kHeaderSize + kPointerSize)); |
+ __ Daddu(t0, t0, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement))); |
+ __ sd(t0, FieldMemOperand(a3, FixedArray::kHeaderSize + kPointerSize)); |
+ |
__ bind(&have_js_function); |
if (CallAsMethod()) { |
EmitContinueIfStrictOrNative(masm, &cont); |
@@ -3052,6 +3066,12 @@ void CallICStub::Generate(MacroAssembler* masm) { |
__ Daddu(a4, a4, Operand(Smi::FromInt(1))); |
__ sd(a4, FieldMemOperand(a2, with_types_offset)); |
+ // Initialize the call counter. |
+ __ dsrl(at, a3, 32 - kPointerSizeLog2); |
+ __ Daddu(at, a2, Operand(at)); |
+ __ li(t0, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement))); |
+ __ sd(t0, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize)); |
+ |
// Store the function. Use a stub since we need a frame for allocation. |
// a2 - vector |
// a3 - slot |