Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 19edbd0c2efecd25d9ef55dc94d06f94d384ea99..bbb7d56e5b36a5534b86c504e88c8351c247cd3f 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -10108,6 +10108,15 @@ HInstruction* HOptimizedGraphBuilder::BuildFastLiteral( |
NoObservableSideEffectsScope no_effects(this); |
+ HAllocate::Flags flags = HAllocate::CAN_ALLOCATE_IN_NEW_SPACE; |
+ // TODO(hpayer): add support for old data space |
+ if (FLAG_pretenure_literals && |
+ isolate()->heap()->ShouldGloballyPretenure() && |
+ data_size == 0) { |
+ flags = static_cast<HAllocate::Flags>( |
+ flags | HAllocate::CAN_ALLOCATE_IN_OLD_POINTER_SPACE); |
+ } |
+ |
HValue* size_in_bytes = |
AddInstruction(new(zone) HConstant(total_size, |
Representation::Integer32())); |
@@ -10115,7 +10124,7 @@ HInstruction* HOptimizedGraphBuilder::BuildFastLiteral( |
AddInstruction(new(zone) HAllocate(context, |
size_in_bytes, |
HType::JSObject(), |
- HAllocate::CAN_ALLOCATE_IN_NEW_SPACE)); |
+ flags)); |
int offset = 0; |
BuildEmitDeepCopy(boilerplate_object, original_boilerplate_object, result, |
&offset, mode, id); |