| 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);
|
| }
|
| }
|
|
|
|
|