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

Unified Diff: src/arm/code-stubs-arm.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 | « no previous file | src/arm64/code-stubs-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | src/arm64/code-stubs-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698