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

Unified Diff: src/hydrogen.cc

Issue 132963012: Pretenure call new support. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE. Created 6 years, 10 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 b035ed1afa316f44037a8e4c7e12bb0d4c786896..b28ed3b4d61506dd5fe9c931bd8029d436ec9ad1 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -8237,12 +8237,27 @@ void HOptimizedGraphBuilder::VisitCallNew(CallNew* expr) {
// Allocate an instance of the implicit receiver object.
HValue* size_in_bytes = Add<HConstant>(instance_size);
- PretenureFlag pretenure_flag =
- (FLAG_pretenuring_call_new && !FLAG_allocation_site_pretenuring) ?
- isolate()->heap()->GetPretenureMode() : NOT_TENURED;
+ HAllocationMode allocation_mode;
+ if (!FLAG_allocation_site_pretenuring) {
Hannes Payer (out of office) 2014/02/11 15:51:23 Can we re-order this combination of cases to: if (
mvstanton 2014/02/17 15:53:08 very true, thx!
+ PretenureFlag pretenure_flag = FLAG_pretenuring_call_new
+ ? isolate()->heap()->GetPretenureMode()
+ : NOT_TENURED;
+ allocation_mode = HAllocationMode(pretenure_flag);
+ } else if (FLAG_pretenuring_call_new) {
+ // Try to use pretenuring feedback.
+ Handle<AllocationSite> allocation_site = expr->allocation_site();
+ if (!allocation_site.is_null()) {
+ allocation_mode = HAllocationMode(allocation_site);
+ // Take a dependency on allocation site.
+ AllocationSite::AddDependentCompilationInfo(allocation_site,
+ AllocationSite::TENURING,
+ top_info());
+ }
+ }
+
HAllocate* receiver =
- Add<HAllocate>(size_in_bytes, HType::JSObject(), pretenure_flag,
- JS_OBJECT_TYPE);
+ BuildAllocate(size_in_bytes, HType::JSObject(), JS_OBJECT_TYPE,
+ allocation_mode);
receiver->set_known_initial_map(initial_map);
// Load the initial map from the constructor.
« no previous file with comments | « src/hydrogen.h ('k') | src/ia32/builtins-ia32.cc » ('j') | src/ia32/builtins-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698