Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(738)

Unified Diff: src/mips64/code-stubs-mips64.cc

Issue 1201193003: [ic] Record call counts for monomorphic calls made with an IC. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mips/code-stubs-mips.cc ('k') | src/type-feedback-vector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/mips/code-stubs-mips.cc ('k') | src/type-feedback-vector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698