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

Unified Diff: src/hydrogen.cc

Issue 11817017: Additional work to get array literal allocation tracking working, even with --always-opt (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Code cleanup Created 7 years, 11 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 f286dacbe8d43366828c5dfad4651c6056cff07c..1c6d75e4966dab40b8ddb03ac84b38dde82ae452 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -5332,11 +5332,23 @@ void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) {
HFastLiteral::kMaxLiteralDepth,
&max_properties,
&total_size)) {
+ // Heuristic: We only need to create allocation site info if the boilerplate
+ // elements kind is the initial elements kind.
+ //
+ // TODO(mvstanton): This heuristic is only a temporary solution. In the
+ // end, we want to quit creating allocation site info after a certain number
+ // of GCs for a call site.
+ bool create_allocation_site_info = FLAG_track_allocation_sites &&
+ IsFastSmiElementsKind(boilerplate_elements_kind);
+ if (create_allocation_site_info) {
+ total_size += AllocationSiteInfo::kSize;
+ }
literal = new(zone()) HFastLiteral(context,
boilerplate,
total_size,
expr->literal_index(),
- expr->depth());
+ expr->depth(),
+ create_allocation_site_info);
} else {
literal = new(zone()) HArrayLiteral(context,
boilerplate,

Powered by Google App Engine
This is Rietveld 408576698