Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 1cf6d836fb11ae9f8dc78d93e92f4e61ce4e01d3..df04a052e51cf055193c10782bcd252b0b98f3ec 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -8782,11 +8782,19 @@ void HOptimizedGraphBuilder::VisitCallNew(CallNew* expr) { |
HValue* size_in_bytes = |
AddInstruction(new(zone()) HConstant(instance_size, |
Representation::Integer32())); |
+ |
+ HAllocate::Flags flags = HAllocate::DefaultFlags(); |
+ if (FLAG_pretenuring_call_new && |
+ isolate()->heap()->ShouldGloballyPretenure()) { |
+ flags = static_cast<HAllocate::Flags>( |
+ flags | HAllocate::CAN_ALLOCATE_IN_OLD_POINTER_SPACE); |
+ } |
+ |
HInstruction* receiver = |
AddInstruction(new(zone()) HAllocate(context, |
size_in_bytes, |
HType::JSObject(), |
- HAllocate::DefaultFlags())); |
+ flags)); |
HAllocate::cast(receiver)->set_known_initial_map(initial_map); |
// Load the initial map from the constructor. |