}
+ExternalReference ExternalReference::old_data_space_allocation_top_address(
+ Isolate* isolate) {
+ return ExternalReference(
+ isolate->heap()->OldDataSpaceAllocationTopAddress());
+}
+
+
+ExternalReference ExternalReference::old_data_space_allocation_limit_address(
+ Isolate* isolate) {
+ return ExternalReference(
+ isolate->heap()->OldDataSpaceAllocationLimitAddress());
+}
+
+
ExternalReference ExternalReference::handle_scope_level_address(
Isolate* isolate) {
return ExternalReference(HandleScope::current_level_address(isolate));
Isolate* isolate);
static ExternalReference old_pointer_space_allocation_limit_address(
Isolate* isolate);
+ static ExternalReference old_data_space_allocation_top_address(
+ Isolate* isolate);
+ static ExternalReference old_data_space_allocation_limit_address(
+ Isolate* isolate);
static ExternalReference double_fp_operation(Token::Value operation,
Isolate* isolate);
}
+bool Heap::InOldDataSpace(Address address) {
+ return old_data_space_->Contains(address);
+}
+
+
+bool Heap::InOldDataSpace(Object* object) {
+ return InOldDataSpace(reinterpret_cast<Address>(object));
+}
+
+
bool Heap::OldGenerationAllocationLimitReached() {
if (!incremental_marking()->IsStopped()) return false;
return OldGenerationSpaceAvailable() < 0;
return old_pointer_space_->allocation_limit_address();
}
+ Address* OldDataSpaceAllocationTopAddress() {
+ return old_data_space_->allocation_top_address();
+ }
+ Address* OldDataSpaceAllocationLimitAddress() {
+ return old_data_space_->allocation_limit_address();
+ }
+
// Uncommit unused semi space.
bool UncommitFromSpace() { return new_space_.UncommitFromSpace(); }
inline bool InOldPointerSpace(Address address);
inline bool InOldPointerSpace(Object* object);
+ // Returns whether the object resides in old data space.
+ inline bool InOldDataSpace(Address address);
+ inline bool InOldDataSpace(Object* object);
+
// Checks whether an address/object in the heap (including auxiliary
// area and unused area).
bool Contains(Address addr);
HAllocate(HValue* context, HValue* size, HType type, Flags flags)
: type_(type),
flags_(flags) {
- ASSERT((flags & CAN_ALLOCATE_IN_OLD_DATA_SPACE) == 0); // unimplemented
SetOperandAt(0, context);
SetOperandAt(1, size);
set_representation(Representation::Tagged());
total_size->ClearFlag(HValue::kCanOverflow);
HAllocate::Flags flags = HAllocate::CAN_ALLOCATE_IN_NEW_SPACE;
- // TODO(hpayer): add support for old data space
- if (FLAG_pretenure_literals && !IsFastDoubleElementsKind(kind)) {
- flags = static_cast<HAllocate::Flags>(
- flags | HAllocate::CAN_ALLOCATE_IN_OLD_POINTER_SPACE);
+ if (FLAG_pretenure_literals) {
+ if (IsFastDoubleElementsKind(kind)) {
+ flags = static_cast<HAllocate::Flags>(
+ flags | HAllocate::CAN_ALLOCATE_IN_OLD_DATA_SPACE);
+ } else {
+ flags = static_cast<HAllocate::Flags>(
+ flags | HAllocate::CAN_ALLOCATE_IN_OLD_POINTER_SPACE);
+ }
}
if (IsFastDoubleElementsKind(kind)) {
flags = static_cast<HAllocate::Flags>(
// Align the allocation to a multiple of kDoubleSize
DOUBLE_ALIGNMENT = 1 << 3,
// Directly allocate in old pointer space
- PRETENURE_OLD_POINTER_SPACE = 1 << 4
+ PRETENURE_OLD_POINTER_SPACE = 1 << 4,
+ // Directly allocate in old data space
+ PRETENURE_OLD_DATA_SPACE = 1 << 5
};
public:
static ExternalReference GetAllocationTopReference(
Isolate* isolate, AllocationFlags flags) {
- return ((flags & PRETENURE_OLD_POINTER_SPACE) != 0) ?
- ExternalReference::old_pointer_space_allocation_top_address(isolate) :
- ExternalReference::new_space_allocation_top_address(isolate);
+ if ((flags & PRETENURE_OLD_POINTER_SPACE) != 0) {
+ return ExternalReference::old_pointer_space_allocation_top_address(
+ isolate);
+ } else if ((flags & PRETENURE_OLD_DATA_SPACE) != 0) {
+ return ExternalReference::old_data_space_allocation_top_address(isolate);
+ }
+ return ExternalReference::new_space_allocation_top_address(isolate);
}
static ExternalReference GetAllocationLimitReference(
Isolate* isolate, AllocationFlags flags) {
- return ((flags & PRETENURE_OLD_POINTER_SPACE) != 0) ?
- ExternalReference::old_pointer_space_allocation_limit_address(isolate) :
- ExternalReference::new_space_allocation_limit_address(isolate);
+ if ((flags & PRETENURE_OLD_POINTER_SPACE) != 0) {
+ return ExternalReference::old_pointer_space_allocation_limit_address(
+ isolate);
+ } else if ((flags & PRETENURE_OLD_DATA_SPACE) != 0) {
+ return ExternalReference::old_data_space_allocation_limit_address(
+ isolate);
+ }
+ return ExternalReference::new_space_allocation_limit_address(isolate);
}
};