| Index: src/heap/spaces.cc
|
| diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc
|
| index 988da6bc99e6440f2b6e873aee94887c70a38620..8fe4a0ce5ea4edab06e1faf8e02172235c190942 100644
|
| --- a/src/heap/spaces.cc
|
| +++ b/src/heap/spaces.cc
|
| @@ -954,7 +954,8 @@ PagedSpace::PagedSpace(Heap* heap, AllocationSpace space,
|
| Executability executable)
|
| : Space(heap, space, executable),
|
| free_list_(this),
|
| - end_of_unswept_pages_(NULL) {
|
| + end_of_unswept_pages_(NULL),
|
| + force_oom_(false) {
|
| area_size_ = MemoryAllocator::PageAreaSize(space);
|
| accounting_stats_.Clear();
|
|
|
| @@ -1077,6 +1078,11 @@ void CompactionSpace::RefillFreeList() {
|
| }
|
|
|
|
|
| +bool CompactionSpace::ShouldForceOOM() {
|
| + return heap()->paged_space(identity())->ShouldForceOOM();
|
| +}
|
| +
|
| +
|
| void PagedSpace::MoveOverFreeMemory(PagedSpace* other) {
|
| DCHECK(identity() == other->identity());
|
| // Destroy the linear allocation space of {other}. This is needed to
|
| @@ -1168,6 +1174,8 @@ Object* PagedSpace::FindObject(Address addr) {
|
|
|
|
|
| bool PagedSpace::CanExpand(size_t size) {
|
| + if (ShouldForceOOM()) return false;
|
| +
|
| DCHECK(heap()->mark_compact_collector()->is_compacting() ||
|
| Capacity() <= heap()->MaxOldGenerationSize());
|
|
|
|
|