Chromium Code Reviews

Unified Diff: src/crankshaft/hydrogen.cc

Issue 1571673002: [not for landing] Re-shuffle AllocationSite members (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@rebased-scratchpad
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/crankshaft/hydrogen-instructions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen.cc
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc
index 2bf85f87c2a04592828fbff1f3068582266ed442..21ae07f2d84b6efdab7becb3d632331250860cf9 100644
--- a/src/crankshaft/hydrogen.cc
+++ b/src/crankshaft/hydrogen.cc
@@ -3246,18 +3246,19 @@ void HGraphBuilder::BuildCreateAllocationMemento(
HObjectAccess::ForAllocationMementoSite(),
allocation_site);
if (FLAG_allocation_site_pretenuring) {
- HValue* memento_create_count =
- Add<HLoadNamedField>(allocation_site, nullptr,
- HObjectAccess::ForAllocationSiteOffset(
- AllocationSite::kPretenureCreateCountOffset));
+ // The memento created counter is embedded in the first 26 bits of pretenure
+ // data. The value itself is bounded by new space size and cleared after
+ // every GC cycle. Overflow into the higher bits is thus not an issue.
+ HValue* memento_create_count = Add<HLoadNamedField>(
+ allocation_site, nullptr, HObjectAccess::ForAllocationSiteOffset(
+ AllocationSite::kPretenureDataOffset));
memento_create_count = AddUncasted<HAdd>(
memento_create_count, 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);
- Add<HStoreNamedField>(
- allocation_site, HObjectAccess::ForAllocationSiteOffset(
- AllocationSite::kPretenureCreateCountOffset), memento_create_count);
+ Add<HStoreNamedField>(allocation_site,
+ HObjectAccess::ForAllocationSiteOffset(
+ AllocationSite::kPretenureDataOffset),
+ memento_create_count);
}
}
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/crankshaft/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine