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

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: Removed unnecessary class specifiers 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 c39f8a47fe604425dcd5a7f37b35f68bb985c63d..636ce8a557ef9fd866efe522ec1aead95ada38b9 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_INFO);
} else {
literal = new(zone()) HObjectLiteral(context,
expr->constant_properties(),
@@ -5323,7 +5324,16 @@ 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();
+
+ // Heuristic: We only need to create allocation site info if the boilerplate
+ // elements kind is the initial elements kind.
Toon Verwaest 2013/01/16 10:53:42 This comment seems to belong above ::GetMode(Eleme
mvstanton 2013/01/16 13:01:56 Yep, indeed!
+ //
+ // 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.
+ AllocationSiteInfoMode mode = AllocationSiteInfo::GetMode(
+ boilerplate_elements_kind);
// Check whether to use fast or slow deep-copying for boilerplate.
int total_size = 0;
@@ -5332,17 +5342,22 @@ void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) {
HFastLiteral::kMaxLiteralDepth,
&max_properties,
&total_size)) {
+ if (mode == TRACK_ALLOCATION_SITE_INFO) {
+ 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

Powered by Google App Engine
This is Rietveld 408576698