Chromium Code Reviews| Index: src/runtime.cc |
| diff --git a/src/runtime.cc b/src/runtime.cc |
| index 8cd2de21b6c7513752456a06b374a8246cc4cb8e..42e9f43bd90dc930acac4ad64218faad7418a5f7 100644 |
| --- a/src/runtime.cc |
| +++ b/src/runtime.cc |
| @@ -234,7 +234,12 @@ static Handle<Object> CreateObjectLiteralBoilerplate( |
| constant_properties, |
| &is_result_from_cache); |
| - Handle<JSObject> boilerplate = isolate->factory()->NewJSObjectFromMap(map); |
| + Handle<JSObject> boilerplate; |
| + if (isolate->heap()->ShouldGloballyPretenure()) { |
| + boilerplate = isolate->factory()->NewJSObjectFromMap(map, TENURED); |
|
Michael Starzinger
2013/05/03 09:33:10
Can we add a "Heap::GetGlobalPretenureFlag()" help
Hannes Payer (out of office)
2013/05/03 09:35:43
Done.
|
| + } else { |
| + boilerplate = isolate->factory()->NewJSObjectFromMap(map); |
| + } |
| // Normalize the elements of the boilerplate to save space if needed. |
| if (!should_have_fast_elements) JSObject::NormalizeElements(boilerplate); |
| @@ -338,8 +343,15 @@ Handle<Object> Runtime::CreateArrayLiteralBoilerplate( |
| // Create the JSArray. |
| Handle<JSFunction> constructor( |
| JSFunction::NativeContextFromLiterals(*literals)->array_function()); |
| - Handle<JSArray> object = |
| - Handle<JSArray>::cast(isolate->factory()->NewJSObject(constructor)); |
| + |
| + Handle<JSArray> object; |
| + if (isolate->heap()->ShouldGloballyPretenure()) { |
| + object = Handle<JSArray>::cast( |
| + isolate->factory()->NewJSObject(constructor, TENURED)); |
| + } else { |
| + object = Handle<JSArray>::cast( |
| + isolate->factory()->NewJSObject(constructor)); |
| + } |
| ElementsKind constant_elements_kind = |
| static_cast<ElementsKind>(Smi::cast(elements->get(0))->value()); |
| @@ -6131,6 +6143,9 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToStringSkipCache) { |
| Object* number = args[0]; |
| RUNTIME_ASSERT(number->IsNumber()); |
| + if (isolate->heap()->ShouldGloballyPretenure()) { |
| + return isolate->heap()->NumberToString(number, false, TENURED); |
| + } |
| return isolate->heap()->NumberToString(number, false); |
| } |