Commit a375166b authored by bjaideep's avatar bjaideep Committed by Commit bot

PPC/s390: CallConstruct also gets call count information if megamorphic.

Port 3ccedd5d

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/2330353005
Cr-Commit-Position: refs/heads/master@{#39425}
parent da1f911c
......@@ -1719,7 +1719,6 @@ 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());
......@@ -1742,7 +1741,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
Register weak_value = r10;
__ LoadP(weak_value, FieldMemOperand(r8, WeakCell::kValueOffset));
__ cmp(r4, weak_value);
__ beq(&done_increment_count);
__ beq(&done);
__ CompareRoot(r8, Heap::kmegamorphic_symbolRootIndex);
__ beq(&done);
__ LoadP(feedback_map, FieldMemOperand(r8, HeapObject::kMapOffset));
......@@ -1765,7 +1764,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
__ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, r8);
__ cmp(r4, r8);
__ bne(&megamorphic);
__ b(&done_increment_count);
__ b(&done);
__ bind(&miss);
......@@ -1795,32 +1794,22 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
// slot.
CreateAllocationSiteStub create_stub(masm->isolate());
CallStubInRecordCallTarget(masm, &create_stub);
__ b(&done_initialize_count);
__ b(&done);
__ 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);
__ bind(&done);
// Increment the call count for monomorphic function calls.
// Increment the call count for all 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);
}
......
......@@ -1726,7 +1726,6 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
// r4 : feedback vector
// r5 : 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());
......@@ -1749,7 +1748,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
Register weak_value = r9;
__ LoadP(weak_value, FieldMemOperand(r7, WeakCell::kValueOffset));
__ CmpP(r3, weak_value);
__ beq(&done_increment_count, Label::kNear);
__ beq(&done, Label::kNear);
__ CompareRoot(r7, Heap::kmegamorphic_symbolRootIndex);
__ beq(&done, Label::kNear);
__ LoadP(feedback_map, FieldMemOperand(r7, HeapObject::kMapOffset));
......@@ -1772,7 +1771,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
__ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, r7);
__ CmpP(r3, r7);
__ bne(&megamorphic);
__ b(&done_increment_count, Label::kNear);
__ b(&done, Label::kNear);
__ bind(&miss);
......@@ -1802,32 +1801,22 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
// slot.
CreateAllocationSiteStub create_stub(masm->isolate());
CallStubInRecordCallTarget(masm, &create_stub);
__ b(&done_initialize_count, Label::kNear);
__ b(&done, Label::kNear);
__ bind(&not_array_function);
CreateWeakCellStub weak_cell_stub(masm->isolate());
CallStubInRecordCallTarget(masm, &weak_cell_stub);
__ bind(&done_initialize_count);
// Initialize the call counter.
__ LoadSmiLiteral(r7, Smi::FromInt(1));
__ SmiToPtrArrayOffset(r6, r5);
__ AddP(r6, r4, r6);
__ StoreP(r7, FieldMemOperand(r6, count_offset), r0);
__ b(&done, Label::kNear);
__ bind(&done_increment_count);
__ bind(&done);
// Increment the call count for monomorphic function calls.
// Increment the call count for all function calls.
__ SmiToPtrArrayOffset(r7, r5);
__ AddP(r7, r4, r7);
__ LoadP(r6, FieldMemOperand(r7, count_offset));
__ AddSmiLiteral(r6, r6, Smi::FromInt(1), r0);
__ StoreP(r6, FieldMemOperand(r7, count_offset), r0);
__ bind(&done);
}
void CallConstructStub::Generate(MacroAssembler* masm) {
......
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