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

Unified Diff: src/hydrogen.cc

Issue 15734002: Add pretenuring support to HAllocateObject. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index f25efbfbc3e44bdbaf7b84cf156fef687584967f..ec7570247bea6a3f402c293746b42b6386c046f9 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -9785,8 +9785,16 @@ void HOptimizedGraphBuilder::VisitCallNew(CallNew* expr) {
constructor->shared()->CompleteInobjectSlackTracking();
}
+ HAllocateObject::Flags flags = HAllocateObject::DefaultFlags();
+ if (FLAG_pretenure_hallocateobject &&
+ isolate()->heap()->ShouldGloballyPretenure()) {
+ flags = static_cast<HAllocateObject::Flags>(
+ flags | HAllocateObject::CAN_ALLOCATE_IN_OLD_POINTER_SPACE);
+ }
+
// Replace the constructor function with a newly allocated receiver.
- HInstruction* receiver = new(zone()) HAllocateObject(context, constructor);
+ HInstruction* receiver =
+ new(zone()) HAllocateObject(context, constructor, flags);
// Index of the receiver from the top of the expression stack.
const int receiver_index = argument_count - 1;
AddInstruction(receiver);

Powered by Google App Engine
This is Rietveld 408576698