Commit 541a8380 authored by bjaideep's avatar bjaideep Committed by Commit bot

PPC: Collect call counts for constructor calls, too.

Port a6ddbef0

Original commit message:

    The TurboFan inliner makes use of these counts.

R=mvstanton@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com, mbrandy@us.ibm.com

BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2011573002
Cr-Commit-Position: refs/heads/master@{#36490}
parent 38c6fb82
......@@ -1849,12 +1849,15 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
// r5 : feedback vector
// r6 : 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());
DCHECK_EQ(*TypeFeedbackVector::UninitializedSentinel(masm->isolate()),
masm->isolate()->heap()->uninitialized_symbol());
const int count_offset = FixedArray::kHeaderSize + kPointerSize;
// Load the cache state into r8.
__ SmiToPtrArrayOffset(r8, r6);
__ add(r8, r5, r8);
......@@ -1869,7 +1872,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
Register weak_value = r10;
__ LoadP(weak_value, FieldMemOperand(r8, WeakCell::kValueOffset));
__ cmp(r4, weak_value);
__ beq(&done);
__ beq(&done_increment_count);
__ CompareRoot(r8, Heap::kmegamorphic_symbolRootIndex);
__ beq(&done);
__ LoadP(feedback_map, FieldMemOperand(r8, HeapObject::kMapOffset));
......@@ -1892,7 +1895,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
__ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, r8);
__ cmp(r4, r8);
__ bne(&megamorphic);
__ b(&done);
__ b(&done_increment_count);
__ bind(&miss);
......@@ -1922,12 +1925,31 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
// slot.
CreateAllocationSiteStub create_stub(masm->isolate());
CallStubInRecordCallTarget(masm, &create_stub);
__ b(&done);
__ b(&done_initialize_count);
__ bind(&not_array_function);
CreateWeakCellStub weak_cell_stub(masm->isolate());
CallStubInRecordCallTarget(masm, &weak_cell_stub);
__ bind(&done_initialize_count);
// Initialize the call counter.
__ LoadSmiLiteral(r8, Smi::FromInt(1));
__ SmiToPtrArrayOffset(r7, r6);
__ add(r7, r5, r7);
__ StoreP(r8, FieldMemOperand(r7, count_offset), r0);
__ b(&done);
__ bind(&done_increment_count);
// Increment the call count for monomorphic function calls.
__ SmiToPtrArrayOffset(r8, r6);
__ add(r8, r5, r8);
__ LoadP(r7, FieldMemOperand(r8, count_offset));
__ AddSmiLiteral(r7, r7, Smi::FromInt(1), r0);
__ StoreP(r7, FieldMemOperand(r8, count_offset), r0);
__ bind(&done);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment