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

Unified Diff: src/hydrogen.cc

Issue 132063004: More efficient use of space in AllocationSite. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 69969bdf28113dde6f0a47a23dd1db63536d4a0b..a52b7b992a0696e58a3eb2d5ccd49140b67249f7 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -2640,17 +2640,21 @@ void HGraphBuilder::BuildCreateAllocationMemento(
HObjectAccess::ForAllocationMementoSite(),
allocation_site);
if (FLAG_allocation_site_pretenuring) {
- HValue* memento_create_count = Add<HLoadNamedField>(
+ // We want to add 1 to the memento create count. The field is actually a smi
+ // bitfield, but the memento create count is in the lower 14 bits. Therefore
+ // we don't need to mask and shift.
+ STATIC_ASSERT(AllocationSite::MementoCreateCountBits::kShift == 0);
+ HValue* pretenure_data = Add<HLoadNamedField>(
allocation_site, HObjectAccess::ForAllocationSiteOffset(
- AllocationSite::kMementoCreateCountOffset));
- memento_create_count = AddUncasted<HAdd>(
- memento_create_count, graph()->GetConstant1());
+ AllocationSite::kPretenureDataOffset));
+ pretenure_data = AddUncasted<HAdd>(
+ pretenure_data, graph()->GetConstant1());
// This smi value is reset to zero after every gc, overflow isn't a problem
// since the counter is bounded by the new space size.
- memento_create_count->ClearFlag(HValue::kCanOverflow);
+ pretenure_data->ClearFlag(HValue::kCanOverflow);
HStoreNamedField* store = Add<HStoreNamedField>(
allocation_site, HObjectAccess::ForAllocationSiteOffset(
- AllocationSite::kMementoCreateCountOffset), memento_create_count);
+ AllocationSite::kPretenureDataOffset), pretenure_data);
// No write barrier needed to store a smi.
store->SkipWriteBarrier();
}

Powered by Google App Engine
This is Rietveld 408576698