| Index: src/ia32/macro-assembler-ia32.cc
|
| diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc
|
| index 8b1be3cf17262f7c7c5d9de2d8a755af7982b937..f86820cba6469876d73c63c397cb72c1ea0ed448 100644
|
| --- a/src/ia32/macro-assembler-ia32.cc
|
| +++ b/src/ia32/macro-assembler-ia32.cc
|
| @@ -54,6 +54,60 @@ MacroAssembler::MacroAssembler(Isolate* arg_isolate, void* buffer, int size)
|
| }
|
|
|
|
|
| +void MacroAssembler::LoadRoot(Register destination, Heap::RootListIndex index) {
|
| + if (isolate()->heap()->RootCanBeTreatedAsConstant(index)) {
|
| + Handle<Object> value(&isolate()->heap()->roots_array_start()[index]);
|
| + mov(destination, value);
|
| + return;
|
| + }
|
| + ExternalReference roots_array_start =
|
| + ExternalReference::roots_array_start(isolate());
|
| + mov(destination, Immediate(index));
|
| + mov(destination, Operand::StaticArray(destination,
|
| + times_pointer_size,
|
| + roots_array_start));
|
| +}
|
| +
|
| +
|
| +void MacroAssembler::StoreRoot(Register source,
|
| + Register scratch,
|
| + Heap::RootListIndex index) {
|
| + ASSERT(Heap::RootCanBeWrittenAfterInitialization(index));
|
| + ExternalReference roots_array_start =
|
| + ExternalReference::roots_array_start(isolate());
|
| + mov(scratch, Immediate(index));
|
| + mov(Operand::StaticArray(scratch, times_pointer_size, roots_array_start),
|
| + source);
|
| +}
|
| +
|
| +
|
| +void MacroAssembler::CompareRoot(Register with,
|
| + Register scratch,
|
| + Heap::RootListIndex index) {
|
| + ExternalReference roots_array_start =
|
| + ExternalReference::roots_array_start(isolate());
|
| + mov(scratch, Immediate(index));
|
| + cmp(with, Operand::StaticArray(scratch,
|
| + times_pointer_size,
|
| + roots_array_start));
|
| +}
|
| +
|
| +
|
| +void MacroAssembler::CompareRoot(Register with, Heap::RootListIndex index) {
|
| + ASSERT(isolate()->heap()->RootCanBeTreatedAsConstant(index));
|
| + Handle<Object> value(&isolate()->heap()->roots_array_start()[index]);
|
| + cmp(with, value);
|
| +}
|
| +
|
| +
|
| +void MacroAssembler::CompareRoot(const Operand& with,
|
| + Heap::RootListIndex index) {
|
| + ASSERT(isolate()->heap()->RootCanBeTreatedAsConstant(index));
|
| + Handle<Object> value(&isolate()->heap()->roots_array_start()[index]);
|
| + cmp(with, value);
|
| +}
|
| +
|
| +
|
| void MacroAssembler::InNewSpace(
|
| Register object,
|
| Register scratch,
|
| @@ -432,21 +486,6 @@ void MacroAssembler::SafePush(const Immediate& x) {
|
| }
|
|
|
|
|
| -void MacroAssembler::CompareRoot(Register with, Heap::RootListIndex index) {
|
| - // see ROOT_ACCESSOR macro in factory.h
|
| - Handle<Object> value(&isolate()->heap()->roots_array_start()[index]);
|
| - cmp(with, value);
|
| -}
|
| -
|
| -
|
| -void MacroAssembler::CompareRoot(const Operand& with,
|
| - Heap::RootListIndex index) {
|
| - // see ROOT_ACCESSOR macro in factory.h
|
| - Handle<Object> value(&isolate()->heap()->roots_array_start()[index]);
|
| - cmp(with, value);
|
| -}
|
| -
|
| -
|
| void MacroAssembler::CmpObjectType(Register heap_object,
|
| InstanceType type,
|
| Register map) {
|
| @@ -1268,26 +1307,29 @@ void MacroAssembler::Allocate(int object_size,
|
| // Load address of new object into result.
|
| LoadAllocationTopHelper(result, scratch, flags);
|
|
|
| + ExternalReference allocation_limit =
|
| + AllocationUtils::GetAllocationLimitReference(isolate(), flags);
|
| +
|
| // Align the next allocation. Storing the filler map without checking top is
|
| - // always safe because the limit of the heap is always aligned.
|
| + // safe in new-space because the limit of the heap is aligned there.
|
| if ((flags & DOUBLE_ALIGNMENT) != 0) {
|
| ASSERT((flags & PRETENURE_OLD_POINTER_SPACE) == 0);
|
| ASSERT(kPointerAlignment * 2 == kDoubleAlignment);
|
| Label aligned;
|
| test(result, Immediate(kDoubleAlignmentMask));
|
| j(zero, &aligned, Label::kNear);
|
| + if ((flags & PRETENURE_OLD_DATA_SPACE) != 0) {
|
| + cmp(result, Operand::StaticVariable(allocation_limit));
|
| + j(above_equal, gc_required);
|
| + }
|
| mov(Operand(result, 0),
|
| Immediate(isolate()->factory()->one_pointer_filler_map()));
|
| add(result, Immediate(kDoubleSize / 2));
|
| bind(&aligned);
|
| }
|
|
|
| - Register top_reg = result_end.is_valid() ? result_end : result;
|
| -
|
| // Calculate new top and bail out if space is exhausted.
|
| - ExternalReference allocation_limit =
|
| - AllocationUtils::GetAllocationLimitReference(isolate(), flags);
|
| -
|
| + Register top_reg = result_end.is_valid() ? result_end : result;
|
| if (!top_reg.is(result)) {
|
| mov(top_reg, result);
|
| }
|
| @@ -1342,14 +1384,21 @@ void MacroAssembler::Allocate(int header_size,
|
| // Load address of new object into result.
|
| LoadAllocationTopHelper(result, scratch, flags);
|
|
|
| + ExternalReference allocation_limit =
|
| + AllocationUtils::GetAllocationLimitReference(isolate(), flags);
|
| +
|
| // Align the next allocation. Storing the filler map without checking top is
|
| - // always safe because the limit of the heap is always aligned.
|
| + // safe in new-space because the limit of the heap is aligned there.
|
| if ((flags & DOUBLE_ALIGNMENT) != 0) {
|
| ASSERT((flags & PRETENURE_OLD_POINTER_SPACE) == 0);
|
| ASSERT(kPointerAlignment * 2 == kDoubleAlignment);
|
| Label aligned;
|
| test(result, Immediate(kDoubleAlignmentMask));
|
| j(zero, &aligned, Label::kNear);
|
| + if ((flags & PRETENURE_OLD_DATA_SPACE) != 0) {
|
| + cmp(result, Operand::StaticVariable(allocation_limit));
|
| + j(above_equal, gc_required);
|
| + }
|
| mov(Operand(result, 0),
|
| Immediate(isolate()->factory()->one_pointer_filler_map()));
|
| add(result, Immediate(kDoubleSize / 2));
|
| @@ -1357,9 +1406,6 @@ void MacroAssembler::Allocate(int header_size,
|
| }
|
|
|
| // Calculate new top and bail out if space is exhausted.
|
| - ExternalReference allocation_limit =
|
| - AllocationUtils::GetAllocationLimitReference(isolate(), flags);
|
| -
|
| // We assume that element_count*element_size + header_size does not
|
| // overflow.
|
| if (element_count_type == REGISTER_VALUE_IS_SMI) {
|
| @@ -1413,14 +1459,21 @@ void MacroAssembler::Allocate(Register object_size,
|
| // Load address of new object into result.
|
| LoadAllocationTopHelper(result, scratch, flags);
|
|
|
| + ExternalReference allocation_limit =
|
| + AllocationUtils::GetAllocationLimitReference(isolate(), flags);
|
| +
|
| // Align the next allocation. Storing the filler map without checking top is
|
| - // always safe because the limit of the heap is always aligned.
|
| + // safe in new-space because the limit of the heap is aligned there.
|
| if ((flags & DOUBLE_ALIGNMENT) != 0) {
|
| ASSERT((flags & PRETENURE_OLD_POINTER_SPACE) == 0);
|
| ASSERT(kPointerAlignment * 2 == kDoubleAlignment);
|
| Label aligned;
|
| test(result, Immediate(kDoubleAlignmentMask));
|
| j(zero, &aligned, Label::kNear);
|
| + if ((flags & PRETENURE_OLD_DATA_SPACE) != 0) {
|
| + cmp(result, Operand::StaticVariable(allocation_limit));
|
| + j(above_equal, gc_required);
|
| + }
|
| mov(Operand(result, 0),
|
| Immediate(isolate()->factory()->one_pointer_filler_map()));
|
| add(result, Immediate(kDoubleSize / 2));
|
| @@ -1428,9 +1481,6 @@ void MacroAssembler::Allocate(Register object_size,
|
| }
|
|
|
| // Calculate new top and bail out if space is exhausted.
|
| - ExternalReference allocation_limit =
|
| - AllocationUtils::GetAllocationLimitReference(isolate(), flags);
|
| -
|
| if (!object_size.is(result_end)) {
|
| mov(result_end, object_size);
|
| }
|
|
|