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

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: Quick adjustment to bit fields 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
« no previous file with comments | « src/heap.cc ('k') | src/hydrogen-instructions.h » ('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 c39f8a47fe604425dcd5a7f37b35f68bb985c63d..2e8f462f0fead659eeb1b54f8f13fbaf7da0742b 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -5213,7 +5213,8 @@ void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
boilerplate_object,
total_size,
expr->literal_index(),
- expr->depth());
+ expr->depth(),
+ DONT_TRACK_ALLOCATION_SITE);
} else {
literal = new(zone()) HObjectLiteral(context,
expr->constant_properties(),
@@ -5323,7 +5324,13 @@ void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) {
Handle<JSObject> boilerplate = Handle<JSObject>::cast(raw_boilerplate);
ElementsKind boilerplate_elements_kind =
- Handle<JSObject>::cast(boilerplate)->GetElementsKind();
+ Handle<JSObject>::cast(boilerplate)->GetElementsKind();
+
+ // 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.
+ AllocationSiteMode mode = AllocationSiteInfo::GetMode(
+ boilerplate_elements_kind);
// Check whether to use fast or slow deep-copying for boilerplate.
int total_size = 0;
@@ -5332,17 +5339,22 @@ void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) {
HFastLiteral::kMaxLiteralDepth,
&max_properties,
&total_size)) {
+ if (mode == TRACK_ALLOCATION_SITE) {
+ total_size += AllocationSiteInfo::kSize;
+ }
literal = new(zone()) HFastLiteral(context,
boilerplate,
total_size,
expr->literal_index(),
- expr->depth());
+ expr->depth(),
+ mode);
} else {
literal = new(zone()) HArrayLiteral(context,
boilerplate,
length,
expr->literal_index(),
- expr->depth());
+ expr->depth(),
+ mode);
}
// The array is expected in the bailout environment during computation
« no previous file with comments | « src/heap.cc ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698