Chromium Code Reviews| Index: src/ppc/code-stubs-ppc.cc |
| diff --git a/src/ppc/code-stubs-ppc.cc b/src/ppc/code-stubs-ppc.cc |
| index 8797bce7b4df46fc5b162bc278d65194dfb0f995..847db9b3585a2fd85532b5e2d972107b7831b6c0 100644 |
| --- a/src/ppc/code-stubs-ppc.cc |
| +++ b/src/ppc/code-stubs-ppc.cc |
| @@ -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,32 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { |
| // slot. |
| CreateAllocationSiteStub create_stub(masm->isolate()); |
| CallStubInRecordCallTarget(masm, &create_stub); |
| - __ b(&done); |
| + __ b(&done_initialize_count); |
| __ bind(¬_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); |
| + |
| + __ addi(r8, r8, Operand(count_offset)); |
|
MTBrandyberry
2016/05/24 19:01:01
It seems strange to perform this add separately an
|
| + __ LoadP(r7, FieldMemOperand(r8, 0)); |
| + __ AddSmiLiteral(r7, r7, Smi::FromInt(1), r0); |
| + __ StoreP(r7, FieldMemOperand(r8, 0), r0); |
| + |
| __ bind(&done); |
| } |