| Index: src/x64/macro-assembler-x64.cc
|
| ===================================================================
|
| --- src/x64/macro-assembler-x64.cc (revision 2828)
|
| +++ src/x64/macro-assembler-x64.cc (working copy)
|
| @@ -1231,16 +1231,15 @@
|
| }
|
|
|
|
|
| -void MacroAssembler::LoadAllocationTopHelper(
|
| - Register result,
|
| - Register result_end,
|
| - Register scratch,
|
| - bool result_contains_top_on_entry) {
|
| +void MacroAssembler::LoadAllocationTopHelper(Register result,
|
| + Register result_end,
|
| + Register scratch,
|
| + AllocationFlags flags) {
|
| ExternalReference new_space_allocation_top =
|
| ExternalReference::new_space_allocation_top_address();
|
|
|
| // Just return if allocation top is already known.
|
| - if (result_contains_top_on_entry) {
|
| + if ((flags & RESULT_CONTAINS_TOP) != 0) {
|
| // No use of scratch if allocation top is provided.
|
| ASSERT(scratch.is(no_reg));
|
| return;
|
| @@ -1279,20 +1278,16 @@
|
| }
|
|
|
|
|
| -void MacroAssembler::AllocateObjectInNewSpace(
|
| - int object_size,
|
| - Register result,
|
| - Register result_end,
|
| - Register scratch,
|
| - Label* gc_required,
|
| - bool result_contains_top_on_entry) {
|
| +void MacroAssembler::AllocateObjectInNewSpace(int object_size,
|
| + Register result,
|
| + Register result_end,
|
| + Register scratch,
|
| + Label* gc_required,
|
| + AllocationFlags flags) {
|
| ASSERT(!result.is(result_end));
|
|
|
| // Load address of new object into result.
|
| - LoadAllocationTopHelper(result,
|
| - result_end,
|
| - scratch,
|
| - result_contains_top_on_entry);
|
| + LoadAllocationTopHelper(result, result_end, scratch, flags);
|
|
|
| // Calculate new top and bail out if new space is exhausted.
|
| ExternalReference new_space_allocation_limit =
|
| @@ -1304,25 +1299,26 @@
|
|
|
| // Update allocation top.
|
| UpdateAllocationTopHelper(result_end, scratch);
|
| +
|
| + // Tag the result if requested.
|
| + if ((flags & TAG_OBJECT) != 0) {
|
| + addq(result, Immediate(kHeapObjectTag));
|
| + }
|
| }
|
|
|
|
|
| -void MacroAssembler::AllocateObjectInNewSpace(
|
| - int header_size,
|
| - ScaleFactor element_size,
|
| - Register element_count,
|
| - Register result,
|
| - Register result_end,
|
| - Register scratch,
|
| - Label* gc_required,
|
| - bool result_contains_top_on_entry) {
|
| +void MacroAssembler::AllocateObjectInNewSpace(int header_size,
|
| + ScaleFactor element_size,
|
| + Register element_count,
|
| + Register result,
|
| + Register result_end,
|
| + Register scratch,
|
| + Label* gc_required,
|
| + AllocationFlags flags) {
|
| ASSERT(!result.is(result_end));
|
|
|
| // Load address of new object into result.
|
| - LoadAllocationTopHelper(result,
|
| - result_end,
|
| - scratch,
|
| - result_contains_top_on_entry);
|
| + LoadAllocationTopHelper(result, result_end, scratch, flags);
|
|
|
| // Calculate new top and bail out if new space is exhausted.
|
| ExternalReference new_space_allocation_limit =
|
| @@ -1334,24 +1330,24 @@
|
|
|
| // Update allocation top.
|
| UpdateAllocationTopHelper(result_end, scratch);
|
| +
|
| + // Tag the result if requested.
|
| + if ((flags & TAG_OBJECT) != 0) {
|
| + addq(result, Immediate(kHeapObjectTag));
|
| + }
|
| }
|
|
|
|
|
| -void MacroAssembler::AllocateObjectInNewSpace(
|
| - Register object_size,
|
| - Register result,
|
| - Register result_end,
|
| - Register scratch,
|
| - Label* gc_required,
|
| - bool result_contains_top_on_entry) {
|
| +void MacroAssembler::AllocateObjectInNewSpace(Register object_size,
|
| + Register result,
|
| + Register result_end,
|
| + Register scratch,
|
| + Label* gc_required,
|
| + AllocationFlags flags) {
|
|
|
| // Load address of new object into result.
|
| - LoadAllocationTopHelper(result,
|
| - result_end,
|
| - scratch,
|
| - result_contains_top_on_entry);
|
| + LoadAllocationTopHelper(result, result_end, scratch, flags);
|
|
|
| -
|
| // Calculate new top and bail out if new space is exhausted.
|
| ExternalReference new_space_allocation_limit =
|
| ExternalReference::new_space_allocation_limit_address();
|
| @@ -1365,6 +1361,11 @@
|
|
|
| // Update allocation top.
|
| UpdateAllocationTopHelper(result_end, scratch);
|
| +
|
| + // Tag the result if requested.
|
| + if ((flags & TAG_OBJECT) != 0) {
|
| + addq(result, Immediate(kHeapObjectTag));
|
| + }
|
| }
|
|
|
|
|
|
|