Index: src/x64/code-stubs-x64.cc |
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc |
index 93f26fc8d2dcfd7c88ea06385f3d836c0f8c03c7..d6201d5cb93e755ccae762e3ea9a14dda1d1e045 100644 |
--- a/src/x64/code-stubs-x64.cc |
+++ b/src/x64/code-stubs-x64.cc |
@@ -1175,6 +1175,7 @@ static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub) { |
__ Pop(rdx); |
__ Pop(rdi); |
__ Pop(rax); |
+ __ SmiToInteger32(rdx, rdx); |
__ SmiToInteger32(rax, rax); |
} |
@@ -1189,7 +1190,6 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { |
// rdi : the function to call |
Isolate* isolate = masm->isolate(); |
Label initialize, done, miss, megamorphic, not_array_function; |
- Label done_initialize_count, done_increment_count; |
// Load the cache state into r11. |
__ SmiToInteger32(rdx, rdx); |
@@ -1203,7 +1203,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { |
// type-feedback-vector.h). |
Label check_allocation_site; |
__ cmpp(rdi, FieldOperand(r11, WeakCell::kValueOffset)); |
- __ j(equal, &done_increment_count, Label::kFar); |
+ __ j(equal, &done, Label::kFar); |
__ CompareRoot(r11, Heap::kmegamorphic_symbolRootIndex); |
__ j(equal, &done, Label::kFar); |
__ CompareRoot(FieldOperand(r11, HeapObject::kMapOffset), |
@@ -1227,7 +1227,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { |
__ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, r11); |
__ cmpp(rdi, r11); |
__ j(not_equal, &megamorphic); |
- __ jmp(&done_increment_count); |
+ __ jmp(&done); |
__ bind(&miss); |
@@ -1253,29 +1253,17 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { |
CreateAllocationSiteStub create_stub(isolate); |
CallStubInRecordCallTarget(masm, &create_stub); |
- __ jmp(&done_initialize_count); |
+ __ jmp(&done); |
__ bind(¬_array_function); |
CreateWeakCellStub weak_cell_stub(isolate); |
CallStubInRecordCallTarget(masm, &weak_cell_stub); |
- __ bind(&done_initialize_count); |
- // Initialize the call counter. |
- __ SmiToInteger32(rdx, rdx); |
- __ Move(FieldOperand(rbx, rdx, times_pointer_size, |
- FixedArray::kHeaderSize + kPointerSize), |
- Smi::FromInt(1)); |
- __ jmp(&done); |
- |
- __ bind(&done_increment_count); |
- |
- // Increment the call count for monomorphic function calls. |
+ __ bind(&done); |
+ // Increment the call count for all function calls. |
__ SmiAddConstant(FieldOperand(rbx, rdx, times_pointer_size, |
FixedArray::kHeaderSize + kPointerSize), |
Smi::FromInt(1)); |
- |
- __ bind(&done); |
- __ Integer32ToSmi(rdx, rdx); |
} |
@@ -1294,7 +1282,6 @@ void CallConstructStub::Generate(MacroAssembler* masm) { |
GenerateRecordCallTarget(masm); |
- __ SmiToInteger32(rdx, rdx); |
Label feedback_register_initialized; |
// Put the AllocationSite from the feedback vector into rbx, or undefined. |
__ movp(rbx, |