| Index: src/x64/macro-assembler-x64.cc
|
| diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc
|
| index 075f07cc353e991fd7969a49725599cb5fcfd45b..5dc5c0010144f0c421e17d0bdd6f77a3c89bc9be 100644
|
| --- a/src/x64/macro-assembler-x64.cc
|
| +++ b/src/x64/macro-assembler-x64.cc
|
| @@ -4089,10 +4089,6 @@ void MacroAssembler::Allocate(int object_size,
|
| // Load address of new object into result.
|
| LoadAllocationTopHelper(result, scratch, flags);
|
|
|
| - if (isolate()->heap_profiler()->is_tracking_allocations()) {
|
| - RecordObjectAllocation(isolate(), result, object_size);
|
| - }
|
| -
|
| // Align the next allocation. Storing the filler map without checking top is
|
| // safe in new-space because the limit of the heap is aligned there.
|
| if (((flags & DOUBLE_ALIGNMENT) != 0) && FLAG_debug_code) {
|
| @@ -4115,6 +4111,10 @@ void MacroAssembler::Allocate(int object_size,
|
| cmpq(top_reg, limit_operand);
|
| j(above, gc_required);
|
|
|
| + if (isolate()->heap_profiler()->is_tracking_allocations()) {
|
| + RecordObjectAllocation(result, object_size);
|
| + }
|
| +
|
| // Update allocation top.
|
| UpdateAllocationTopHelper(top_reg, scratch, flags);
|
|
|
| @@ -4172,10 +4172,6 @@ void MacroAssembler::Allocate(Register object_size,
|
| // Load address of new object into result.
|
| LoadAllocationTopHelper(result, scratch, flags);
|
|
|
| - if (isolate()->heap_profiler()->is_tracking_allocations()) {
|
| - RecordObjectAllocation(isolate(), result, object_size);
|
| - }
|
| -
|
| // Align the next allocation. Storing the filler map without checking top is
|
| // safe in new-space because the limit of the heap is aligned there.
|
| if (((flags & DOUBLE_ALIGNMENT) != 0) && FLAG_debug_code) {
|
| @@ -4195,6 +4191,10 @@ void MacroAssembler::Allocate(Register object_size,
|
| cmpq(result_end, limit_operand);
|
| j(above, gc_required);
|
|
|
| + if (isolate()->heap_profiler()->is_tracking_allocations()) {
|
| + RecordObjectAllocation(result, object_size);
|
| + }
|
| +
|
| // Update allocation top.
|
| UpdateAllocationTopHelper(result_end, scratch, flags);
|
|
|
| @@ -4936,34 +4936,29 @@ void MacroAssembler::TestJSArrayForAllocationMemento(
|
| }
|
|
|
|
|
| -void MacroAssembler::RecordObjectAllocation(Isolate* isolate,
|
| - Register object,
|
| +void MacroAssembler::RecordObjectAllocation(Register object,
|
| Register object_size) {
|
| FrameScope frame(this, StackFrame::EXIT);
|
| PushSafepointRegisters();
|
| - PrepareCallCFunction(3);
|
| - // In case object is rdx
|
| - movq(kScratchRegister, object);
|
| - movq(arg_reg_3, object_size);
|
| - movq(arg_reg_2, kScratchRegister);
|
| - movq(arg_reg_1, isolate, RelocInfo::EXTERNAL_REFERENCE);
|
| - CallCFunction(
|
| - ExternalReference::record_object_allocation_function(isolate), 3);
|
| + Push(object);
|
| + shl(object_size, Immediate(kSmiShift));
|
| + push(object_size);
|
| + CallExternalReference(
|
| + ExternalReference::record_object_allocation_function(isolate()),
|
| + 2);
|
| PopSafepointRegisters();
|
| }
|
|
|
|
|
| -void MacroAssembler::RecordObjectAllocation(Isolate* isolate,
|
| - Register object,
|
| +void MacroAssembler::RecordObjectAllocation(Register object,
|
| int object_size) {
|
| FrameScope frame(this, StackFrame::EXIT);
|
| PushSafepointRegisters();
|
| - PrepareCallCFunction(3);
|
| - movq(arg_reg_2, object);
|
| - movq(arg_reg_3, Immediate(object_size));
|
| - movq(arg_reg_1, isolate, RelocInfo::EXTERNAL_REFERENCE);
|
| - CallCFunction(
|
| - ExternalReference::record_object_allocation_function(isolate), 3);
|
| + Push(object);
|
| + Push(Smi::FromInt(object_size));
|
| + CallExternalReference(
|
| + ExternalReference::record_object_allocation_function(isolate()),
|
| + 2);
|
| PopSafepointRegisters();
|
| }
|
|
|
|
|