| Index: src/heap.cc
|
| diff --git a/src/heap.cc b/src/heap.cc
|
| index 8de945505036f1638df233654716c7698ba2699c..43886c144ceff279231e87f63a9d84447e592660 100644
|
| --- a/src/heap.cc
|
| +++ b/src/heap.cc
|
| @@ -1727,6 +1727,7 @@ Object* Heap::AllocateProxy(Address proxy, PretenureFlag pretenure) {
|
| // Statically ensure that it is safe to allocate proxies in paged spaces.
|
| STATIC_ASSERT(Proxy::kSize <= Page::kMaxHeapObjectSize);
|
| AllocationSpace space = (pretenure == TENURED) ? OLD_DATA_SPACE : NEW_SPACE;
|
| + if (always_allocate()) space = OLD_DATA_SPACE;
|
| Object* result = Allocate(proxy_map(), space);
|
| if (result->IsFailure()) return result;
|
|
|
| @@ -1822,12 +1823,13 @@ Object* Heap::AllocateConsString(String* first, String* second) {
|
| : long_cons_string_map();
|
| }
|
|
|
| - Object* result = Allocate(map, NEW_SPACE);
|
| + Object* result = Allocate(map,
|
| + always_allocate() ? OLD_POINTER_SPACE : NEW_SPACE);
|
| if (result->IsFailure()) return result;
|
| - ASSERT(InNewSpace(result));
|
| ConsString* cons_string = ConsString::cast(result);
|
| - cons_string->set_first(first, SKIP_WRITE_BARRIER);
|
| - cons_string->set_second(second, SKIP_WRITE_BARRIER);
|
| + WriteBarrierMode mode = cons_string->GetWriteBarrierMode();
|
| + cons_string->set_first(first, mode);
|
| + cons_string->set_second(second, mode);
|
| cons_string->set_length(length);
|
| return result;
|
| }
|
| @@ -1884,7 +1886,8 @@ Object* Heap::AllocateExternalStringFromAscii(
|
| return Failure::OutOfMemoryException();
|
| }
|
|
|
| - Object* result = Allocate(map, NEW_SPACE);
|
| + Object* result = Allocate(map,
|
| + always_allocate() ? OLD_DATA_SPACE : NEW_SPACE);
|
| if (result->IsFailure()) return result;
|
|
|
| ExternalAsciiString* external_string = ExternalAsciiString::cast(result);
|
| @@ -1903,7 +1906,8 @@ Object* Heap::AllocateExternalStringFromTwoByte(
|
| return Failure::OutOfMemoryException();
|
| }
|
| Map* map = ExternalTwoByteString::StringMap(static_cast<int>(length));
|
| - Object* result = Allocate(map, NEW_SPACE);
|
| + Object* result = Allocate(map,
|
| + always_allocate() ? OLD_DATA_SPACE : NEW_SPACE);
|
| if (result->IsFailure()) return result;
|
|
|
| ExternalTwoByteString* external_string = ExternalTwoByteString::cast(result);
|
| @@ -2288,6 +2292,7 @@ Object* Heap::AllocateJSObjectFromMap(Map* map, PretenureFlag pretenure) {
|
| AllocationSpace space =
|
| (pretenure == TENURED) ? OLD_POINTER_SPACE : NEW_SPACE;
|
| if (map->instance_size() > MaxObjectSizeInPagedSpace()) space = LO_SPACE;
|
| + if (always_allocate()) space = OLD_POINTER_SPACE;
|
| Object* obj = Allocate(map, space);
|
| if (obj->IsFailure()) return obj;
|
|
|
|
|