| Index: src/spaces.cc
|
| diff --git a/src/spaces.cc b/src/spaces.cc
|
| index 8e7a947f171e86b7693bc682f71ed702e9644980..d2572d9a2cd3f42ba67001952bab6e666bce066e 100644
|
| --- a/src/spaces.cc
|
| +++ b/src/spaces.cc
|
| @@ -721,8 +721,7 @@ MaybeObject* PagedSpace::FindObject(Address addr) {
|
| return Failure::Exception();
|
| }
|
|
|
| -
|
| -bool PagedSpace::Expand() {
|
| +bool PagedSpace::CanExpand() {
|
| ASSERT(max_capacity_ % Page::kObjectAreaSize == 0);
|
| ASSERT(Capacity() % Page::kObjectAreaSize == 0);
|
|
|
| @@ -733,6 +732,12 @@ bool PagedSpace::Expand() {
|
| // Are we going to exceed capacity for this space?
|
| if ((Capacity() + Page::kPageSize) > max_capacity_) return false;
|
|
|
| + return true;
|
| +}
|
| +
|
| +bool PagedSpace::Expand() {
|
| + if (!CanExpand()) return false;
|
| +
|
| Page* p = heap()->isolate()->memory_allocator()->
|
| AllocatePage(this, executable());
|
| if (p == NULL) return false;
|
|
|