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

Unified Diff: src/arm64/code-stubs-arm64.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/arm/code-stubs-arm.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm64/code-stubs-arm64.cc
diff --git a/src/arm64/code-stubs-arm64.cc b/src/arm64/code-stubs-arm64.cc
index 622d12ebca5f32e29b981038f59bcaaebe2df9ba..676079153f37ef56ae6b3473905056acb638e4ed 100644
--- a/src/arm64/code-stubs-arm64.cc
+++ b/src/arm64/code-stubs-arm64.cc
@@ -3091,10 +3091,18 @@ void CallIC_ArrayStub::Generate(MacroAssembler* masm) {
__ Ldr(map, FieldMemOperand(scratch, HeapObject::kMapOffset));
__ JumpIfNotRoot(map, Heap::kAllocationSiteMapRootIndex, &miss);
+ // Increment the call count for monomorphic function calls.
+ __ Add(feedback_vector, feedback_vector,
+ Operand::UntagSmiAndScale(index, kPointerSizeLog2));
+ __ Add(feedback_vector, feedback_vector,
+ Operand(FixedArray::kHeaderSize + kPointerSize));
+ __ Ldr(index, FieldMemOperand(feedback_vector, 0));
+ __ Add(index, index, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement)));
+ __ Str(index, FieldMemOperand(feedback_vector, 0));
+
Register allocation_site = feedback_vector;
+ Register original_constructor = index;
__ Mov(allocation_site, scratch);
-
- Register original_constructor = x3;
__ Mov(original_constructor, function);
ArrayConstructorStub stub(masm->isolate(), arg_count());
__ TailCallStub(&stub);
@@ -3160,6 +3168,15 @@ void CallICStub::Generate(MacroAssembler* masm) {
// convincing us that we have a monomorphic JSFunction.
__ JumpIfSmi(function, &extra_checks_or_miss);
+ // Increment the call count for monomorphic function calls.
+ __ Add(feedback_vector, feedback_vector,
+ Operand::UntagSmiAndScale(index, kPointerSizeLog2));
+ __ Add(feedback_vector, feedback_vector,
+ Operand(FixedArray::kHeaderSize + kPointerSize));
+ __ Ldr(index, FieldMemOperand(feedback_vector, 0));
+ __ Add(index, index, Operand(Smi::FromInt(CallICNexus::kCallCountIncrement)));
+ __ Str(index, FieldMemOperand(feedback_vector, 0));
+
__ bind(&have_js_function);
if (CallAsMethod()) {
EmitContinueIfStrictOrNative(masm, &cont);
@@ -3235,6 +3252,12 @@ void CallICStub::Generate(MacroAssembler* masm) {
__ Adds(x4, x4, Operand(Smi::FromInt(1)));
__ Str(x4, FieldMemOperand(feedback_vector, with_types_offset));
+ // Initialize the call counter.
+ __ Mov(x5, Smi::FromInt(CallICNexus::kCallCountIncrement));
+ __ Adds(x4, feedback_vector,
+ Operand::UntagSmiAndScale(index, kPointerSizeLog2));
+ __ Str(x5, FieldMemOperand(x4, FixedArray::kHeaderSize + kPointerSize));
+
// Store the function. Use a stub since we need a frame for allocation.
// x2 - vector
// x3 - slot
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698