Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(455)

Unified Diff: src/hydrogen.cc

Issue 16226012: Added pretenuring support for call new. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/flag-definitions.h ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « src/flag-definitions.h ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698