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

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

Issue 1969783002: Collect call counts for constructor calls, too. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed cctest.status, and addressed mips64 comment. Created 4 years, 7 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/ast/ast.h » ('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 a076f79fae79ddbbcfa808eca0f39ac3710e2c6f..d55d2c1a524c5ee223907d90ccbd2127061d1941 100644
--- a/src/arm64/code-stubs-arm64.cc
+++ b/src/arm64/code-stubs-arm64.cc
@@ -2010,6 +2010,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm, Register argc,
// feedback_vector : the feedback vector
// index : slot in feedback vector (smi)
Label initialize, done, miss, megamorphic, not_array_function;
+ Label done_initialize_count, done_increment_count;
DCHECK_EQ(*TypeFeedbackVector::MegamorphicSentinel(masm->isolate()),
masm->isolate()->heap()->megamorphic_symbol());
@@ -2032,7 +2033,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm, Register argc,
Label check_allocation_site;
__ Ldr(feedback_value, FieldMemOperand(feedback, WeakCell::kValueOffset));
__ Cmp(function, feedback_value);
- __ B(eq, &done);
+ __ B(eq, &done_increment_count);
__ CompareRoot(feedback, Heap::kmegamorphic_symbolRootIndex);
__ B(eq, &done);
__ Ldr(feedback_map, FieldMemOperand(feedback, HeapObject::kMapOffset));
@@ -2054,7 +2055,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm, Register argc,
__ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, scratch1);
__ Cmp(function, scratch1);
__ B(ne, &megamorphic);
- __ B(&done);
+ __ B(&done_increment_count);
__ Bind(&miss);
@@ -2085,12 +2086,32 @@ static void GenerateRecordCallTarget(MacroAssembler* masm, Register argc,
CreateAllocationSiteStub create_stub(masm->isolate());
CallStubInRecordCallTarget(masm, &create_stub, argc, function,
feedback_vector, index, new_target);
- __ B(&done);
+ __ B(&done_initialize_count);
__ Bind(&not_array_function);
CreateWeakCellStub weak_cell_stub(masm->isolate());
CallStubInRecordCallTarget(masm, &weak_cell_stub, argc, function,
feedback_vector, index, new_target);
+
+ __ bind(&done_initialize_count);
+ // Initialize the call counter.
+ __ Mov(scratch1, Operand(Smi::FromInt(1)));
+ __ Adds(scratch2, feedback_vector,
+ Operand::UntagSmiAndScale(index, kPointerSizeLog2));
+ __ Str(scratch1,
+ FieldMemOperand(scratch2, FixedArray::kHeaderSize + kPointerSize));
+ __ b(&done);
+
+ __ bind(&done_increment_count);
+
+ // Increment the call count for monomorphic function calls.
+ __ Add(scratch1, feedback_vector,
+ Operand::UntagSmiAndScale(index, kPointerSizeLog2));
+ __ Add(scratch1, scratch1, Operand(FixedArray::kHeaderSize + kPointerSize));
+ __ Ldr(scratch2, FieldMemOperand(scratch1, 0));
+ __ Add(scratch2, scratch2, Operand(Smi::FromInt(1)));
+ __ Str(scratch2, FieldMemOperand(scratch1, 0));
+
__ Bind(&done);
}
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/ast/ast.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698