| Index: src/objects-inl.h
|
| diff --git a/src/objects-inl.h b/src/objects-inl.h
|
| index cff5b61b527bec83db46b2efbc99d85898e0a1ae..c4f386eb1bf2c80872e7d5be40fba475ad2eb856 100644
|
| --- a/src/objects-inl.h
|
| +++ b/src/objects-inl.h
|
| @@ -1704,6 +1704,38 @@ inline bool AllocationSite::MakePretenureDecision(
|
| }
|
|
|
|
|
| +int AllocationSite::GetInitialElementsCapacity() {
|
| + if (FLAG_initial_capacity_mode != 2) {
|
| + return JSArray::PreallocatedArrayElements();
|
| + }
|
| +
|
| + if (SitePointsToLiteral()) return 0;
|
| + int value = Smi::cast(transition_info())->value();
|
| + return InitialElementsCapacity::decode(value);
|
| +}
|
| +
|
| +
|
| +void AllocationSite::DigestInitialElementsCapacityFeedback(int new_length) {
|
| + if (FLAG_initial_capacity_mode != 2) return;
|
| +
|
| + if (new_length > 0 && !SitePointsToLiteral()) {
|
| + int to_store = (new_length + (new_length >> 1) + 16) / 4;
|
| + int old_capacity = GetInitialElementsCapacity();
|
| + if (to_store > old_capacity &&
|
| + InitialElementsCapacity::is_valid(to_store)) {
|
| + int value = Smi::cast(transition_info())->value();
|
| + set_transition_info(
|
| + Smi::FromInt(InitialElementsCapacity::update(value, to_store)),
|
| + SKIP_WRITE_BARRIER);
|
| + if (FLAG_trace_track_allocation_sites) {
|
| + PrintF("Initial elements capacity for site %p, updated to %d.\n",
|
| + static_cast<void*>(this), to_store);
|
| + }
|
| + }
|
| + }
|
| +}
|
| +
|
| +
|
| inline bool AllocationSite::DigestPretenuringFeedback(
|
| bool maximum_size_scavenge) {
|
| bool deopt = false;
|
|
|