Index: src/mips64/code-stubs-mips64.cc |
diff --git a/src/mips64/code-stubs-mips64.cc b/src/mips64/code-stubs-mips64.cc |
index 5702c788b3ff5d78e782f480b217bf904cf0e361..18feaf156ea3eabc1182b852484337582e93d63c 100644 |
--- a/src/mips64/code-stubs-mips64.cc |
+++ b/src/mips64/code-stubs-mips64.cc |
@@ -1923,6 +1923,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { |
// a2 : feedback vector |
// a3 : 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()); |
@@ -1942,7 +1943,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { |
Register feedback_map = a6; |
Register weak_value = t0; |
__ ld(weak_value, FieldMemOperand(a5, WeakCell::kValueOffset)); |
- __ Branch(&done, eq, a1, Operand(weak_value)); |
+ __ Branch(&done_increment_count, eq, a1, Operand(weak_value)); |
__ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); |
__ Branch(&done, eq, a5, Operand(at)); |
__ ld(feedback_map, FieldMemOperand(a5, HeapObject::kMapOffset)); |
@@ -1964,7 +1965,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { |
// Make sure the function is the Array() function |
__ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, a5); |
__ Branch(&megamorphic, ne, a1, Operand(a5)); |
- __ jmp(&done); |
+ __ jmp(&done_increment_count); |
__ bind(&miss); |
@@ -1992,12 +1993,31 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { |
// slot. |
CreateAllocationSiteStub create_stub(masm->isolate()); |
CallStubInRecordCallTarget(masm, &create_stub); |
- __ Branch(&done); |
+ __ Branch(&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. |
+ |
balazs.kilvady
2016/05/24 10:16:02
On MIPS64 we use a4, a5 registers instead of t0, t
mvstanton
2016/05/24 11:20:22
Right on, done.
|
+ __ dsrl(at, a3, 32 - kPointerSizeLog2); |
+ __ Daddu(at, a2, Operand(at)); |
+ __ li(t0, Operand(Smi::FromInt(1))); |
+ __ sd(t0, FieldMemOperand(at, FixedArray::kHeaderSize + kPointerSize)); |
+ __ bind(&done); |
+ |
+ __ bind(&done_increment_count); |
+ |
+ // Increment the call count for monomorphic function calls. |
+ __ dsrl(t0, a3, 32 - kPointerSizeLog2); |
+ __ Daddu(t1, a2, Operand(t0)); |
+ __ ld(t0, FieldMemOperand(t1, FixedArray::kHeaderSize + kPointerSize)); |
+ __ Daddu(t0, t0, Operand(Smi::FromInt(1))); |
+ __ sd(t0, FieldMemOperand(t1, FixedArray::kHeaderSize + kPointerSize)); |
+ |
__ bind(&done); |
} |