Revert "[heap] Fix typo in pretenuring"

This reverts commit 350f57281a.

Reason for revert: Causes failures with --shared-string-table

https://bugs.chromium.org/p/chromium/issues/detail?id=1399489
https://bugs.chromium.org/p/chromium/issues/detail?id=1399491
https://bugs.chromium.org/p/chromium/issues/detail?id=1399488
https://bugs.chromium.org/p/v8/issues/detail?id=13574

Original change's description:
> [heap] Fix typo in pretenuring
>
> PretenturingHandler -> PretenuringHandler
>
> Change-Id: If25e8be65dc6050688213fbb481751d7cbcd0e8b
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4085984
> Commit-Queue: Omer Katz <omerkatz@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#84727}

Change-Id: Ib9765f459b7f7ee9a320998709a6eecd4beece1b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4092495
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84759}
This commit is contained in:
Dominik Inführ 2022-12-09 13:06:35 +00:00 committed by V8 LUCI CQ
parent 5eb7f8e8b4
commit a44a164e6d
11 changed files with 51 additions and 50 deletions

View File

@ -1670,7 +1670,7 @@ class Heap {
AtomicMarkingState* atomic_marking_state() { return &atomic_marking_state_; }
PretenuringHandler* pretenuring_handler() { return &pretenuring_handler_; }
PretenturingHandler* pretenuring_handler() { return &pretenuring_handler_; }
private:
class AllocationTrackerForDebugging;
@ -2417,7 +2417,7 @@ class Heap {
NonAtomicMarkingState non_atomic_marking_state_;
AtomicMarkingState atomic_marking_state_;
PretenuringHandler pretenuring_handler_;
PretenturingHandler pretenuring_handler_;
// This field is used only when not running with MinorMC.
ResizeNewSpaceMode resize_new_space_mode_ = ResizeNewSpaceMode::kNone;
@ -2457,7 +2457,7 @@ class Heap {
friend class ObjectStatsCollector;
friend class Page;
friend class PagedSpaceBase;
friend class PretenuringHandler;
friend class PretenturingHandler;
friend class ReadOnlyRoots;
friend class DisableConservativeStackScanningScopeForTesting;
friend class Scavenger;

View File

@ -1844,7 +1844,7 @@ class EvacuateNewSpaceVisitor final : public EvacuateVisitorBase {
Heap* heap, EvacuationAllocator* local_allocator,
ConcurrentAllocator* shared_old_allocator,
RecordMigratedSlotVisitor* record_visitor,
PretenuringHandler::PretenuringFeedbackMap* local_pretenuring_feedback,
PretenturingHandler::PretenuringFeedbackMap* local_pretenuring_feedback,
AlwaysPromoteYoung always_promote_young)
: EvacuateVisitorBase(heap, local_allocator, shared_old_allocator,
record_visitor),
@ -1949,8 +1949,8 @@ class EvacuateNewSpaceVisitor final : public EvacuateVisitorBase {
LocalAllocationBuffer buffer_;
intptr_t promoted_size_;
intptr_t semispace_copied_size_;
PretenuringHandler* const pretenuring_handler_;
PretenuringHandler::PretenuringFeedbackMap* local_pretenuring_feedback_;
PretenturingHandler* const pretenuring_handler_;
PretenturingHandler::PretenuringFeedbackMap* local_pretenuring_feedback_;
bool is_incremental_marking_;
AlwaysPromoteYoung always_promote_young_;
const bool shortcut_strings_;
@ -1961,7 +1961,7 @@ class EvacuateNewSpacePageVisitor final : public HeapObjectVisitor {
public:
explicit EvacuateNewSpacePageVisitor(
Heap* heap, RecordMigratedSlotVisitor* record_visitor,
PretenuringHandler::PretenuringFeedbackMap* local_pretenuring_feedback)
PretenturingHandler::PretenuringFeedbackMap* local_pretenuring_feedback)
: heap_(heap),
record_visitor_(record_visitor),
moved_bytes_(0),
@ -2008,8 +2008,8 @@ class EvacuateNewSpacePageVisitor final : public HeapObjectVisitor {
Heap* heap_;
RecordMigratedSlotVisitor* record_visitor_;
intptr_t moved_bytes_;
PretenuringHandler* const pretenuring_handler_;
PretenuringHandler::PretenuringFeedbackMap* local_pretenuring_feedback_;
PretenturingHandler* const pretenuring_handler_;
PretenturingHandler::PretenuringFeedbackMap* local_pretenuring_feedback_;
};
class EvacuateOldSpaceVisitor final : public EvacuateVisitorBase {
@ -4230,7 +4230,7 @@ class Evacuator : public Malloced {
AlwaysPromoteYoung always_promote_young)
: heap_(heap),
local_pretenuring_feedback_(
PretenuringHandler::kInitialFeedbackCapacity),
PretenturingHandler::kInitialFeedbackCapacity),
shared_old_allocator_(CreateSharedOldAllocator(heap_)),
new_space_visitor_(heap_, local_allocator, shared_old_allocator_.get(),
record_visitor, &local_pretenuring_feedback_,
@ -4276,7 +4276,7 @@ class Evacuator : public Malloced {
Heap* heap_;
PretenuringHandler::PretenuringFeedbackMap local_pretenuring_feedback_;
PretenturingHandler::PretenuringFeedbackMap local_pretenuring_feedback_;
// Allocator for the shared heap.
std::unique_ptr<ConcurrentAllocator> shared_old_allocator_;

View File

@ -16,7 +16,7 @@
namespace v8 {
namespace internal {
void PretenuringHandler::UpdateAllocationSite(
void PretenturingHandler::UpdateAllocationSite(
Map map, HeapObject object, PretenuringFeedbackMap* pretenuring_feedback) {
DCHECK_NE(pretenuring_feedback, &global_pretenuring_feedback_);
#ifdef DEBUG
@ -42,9 +42,9 @@ void PretenuringHandler::UpdateAllocationSite(
(*pretenuring_feedback)[AllocationSite::unchecked_cast(Object(key))]++;
}
template <PretenuringHandler::FindMementoMode mode>
AllocationMemento PretenuringHandler::FindAllocationMemento(Map map,
HeapObject object) {
template <PretenturingHandler::FindMementoMode mode>
AllocationMemento PretenturingHandler::FindAllocationMemento(
Map map, HeapObject object) {
Address object_address = object.address();
Address memento_address =
object_address + ALIGN_TO_ALLOCATION_ALIGNMENT(object.SizeFromMap(map));

View File

@ -12,12 +12,12 @@
namespace v8 {
namespace internal {
PretenuringHandler::PretenuringHandler(Heap* heap)
PretenturingHandler::PretenturingHandler(Heap* heap)
: heap_(heap), global_pretenuring_feedback_(kInitialFeedbackCapacity) {}
PretenuringHandler::~PretenuringHandler() = default;
PretenturingHandler::~PretenturingHandler() = default;
void PretenuringHandler::MergeAllocationSitePretenuringFeedback(
void PretenturingHandler::MergeAllocationSitePretenuringFeedback(
const PretenuringFeedbackMap& local_pretenuring_feedback) {
PtrComprCageBase cage_base(heap_->isolate());
AllocationSite site;
@ -42,7 +42,7 @@ void PretenuringHandler::MergeAllocationSitePretenuringFeedback(
}
}
bool PretenuringHandler::DeoptMaybeTenuredAllocationSites() const {
bool PretenturingHandler::DeoptMaybeTenuredAllocationSites() const {
NewSpace* new_space = heap_->new_space();
return new_space && new_space->IsAtMaximumCapacity() &&
!heap_->MaximumSizeMinorGC();
@ -139,12 +139,12 @@ bool PretenureAllocationSiteManually(Isolate* isolate, AllocationSite site) {
} // namespace
void PretenuringHandler::RemoveAllocationSitePretenuringFeedback(
void PretenturingHandler::RemoveAllocationSitePretenuringFeedback(
AllocationSite site) {
global_pretenuring_feedback_.erase(site);
}
void PretenuringHandler::ProcessPretenuringFeedback() {
void PretenturingHandler::ProcessPretenuringFeedback() {
bool trigger_deoptimization = false;
if (v8_flags.allocation_site_pretenuring) {
int tenure_decisions = 0;
@ -229,7 +229,7 @@ void PretenuringHandler::ProcessPretenuringFeedback() {
}
}
void PretenuringHandler::PretenureAllocationSiteOnNextCollection(
void PretenturingHandler::PretenureAllocationSiteOnNextCollection(
AllocationSite site) {
if (!allocation_sites_to_pretenure_) {
allocation_sites_to_pretenure_.reset(
@ -238,7 +238,7 @@ void PretenuringHandler::PretenureAllocationSiteOnNextCollection(
allocation_sites_to_pretenure_->Push(site);
}
void PretenuringHandler::reset() { allocation_sites_to_pretenure_.reset(); }
void PretenturingHandler::reset() { allocation_sites_to_pretenure_.reset(); }
} // namespace internal
} // namespace v8

View File

@ -18,15 +18,15 @@ template <typename T>
class GlobalHandleVector;
class Heap;
class PretenuringHandler final {
class PretenturingHandler final {
public:
static const int kInitialFeedbackCapacity = 256;
using PretenuringFeedbackMap =
std::unordered_map<AllocationSite, size_t, Object::Hasher>;
enum FindMementoMode { kForRuntime, kForGC };
explicit PretenuringHandler(Heap* heap);
~PretenuringHandler();
explicit PretenturingHandler(Heap* heap);
~PretenturingHandler();
void reset();

View File

@ -620,7 +620,8 @@ Scavenger::Scavenger(ScavengerCollector* collector, Heap* heap, bool is_logging,
copied_list_local_(*copied_list),
ephemeron_table_list_local_(*ephemeron_table_list),
pretenuring_handler_(heap_->pretenuring_handler()),
local_pretenuring_feedback_(PretenuringHandler::kInitialFeedbackCapacity),
local_pretenuring_feedback_(
PretenturingHandler::kInitialFeedbackCapacity),
copied_size_(0),
promoted_size_(0),
allocator_(heap, CompactionSpaceKind::kCompactionSpaceForScavenge),

View File

@ -202,8 +202,8 @@ class Scavenger {
PromotionList::Local promotion_list_local_;
CopiedList::Local copied_list_local_;
EphemeronTableList::Local ephemeron_table_list_local_;
PretenuringHandler* const pretenuring_handler_;
PretenuringHandler::PretenuringFeedbackMap local_pretenuring_feedback_;
PretenturingHandler* const pretenuring_handler_;
PretenturingHandler::PretenuringFeedbackMap local_pretenuring_feedback_;
size_t copied_size_;
size_t promoted_size_;
EvacuationAllocator allocator_;

View File

@ -39,7 +39,7 @@ class Sweeper::ConcurrentSweeper final {
explicit ConcurrentSweeper(Sweeper* sweeper)
: sweeper_(sweeper),
local_pretenuring_feedback_(
PretenuringHandler::kInitialFeedbackCapacity) {}
PretenturingHandler::kInitialFeedbackCapacity) {}
bool ConcurrentSweepSpace(AllocationSpace identity, JobDelegate* delegate) {
DCHECK(IsValidSweepingSpace(identity));
@ -63,7 +63,7 @@ class Sweeper::ConcurrentSweeper final {
return false;
}
PretenuringHandler::PretenuringFeedbackMap* local_pretenuring_feedback() {
PretenturingHandler::PretenuringFeedbackMap* local_pretenuring_feedback() {
return &local_pretenuring_feedback_;
}
@ -73,7 +73,7 @@ class Sweeper::ConcurrentSweeper final {
private:
Sweeper* const sweeper_;
PretenuringHandler::PretenuringFeedbackMap local_pretenuring_feedback_;
PretenturingHandler::PretenuringFeedbackMap local_pretenuring_feedback_;
CachedOldToNewRememberedSets snapshot_old_to_new_remembered_sets_;
};
@ -157,7 +157,7 @@ Sweeper::Sweeper(Heap* heap)
should_reduce_memory_(false),
pretenuring_handler_(heap_->pretenuring_handler()),
local_pretenuring_feedback_(
PretenuringHandler::kInitialFeedbackCapacity) {}
PretenturingHandler::kInitialFeedbackCapacity) {}
Sweeper::~Sweeper() {
DCHECK(concurrent_sweepers_.empty());
@ -473,7 +473,7 @@ void Sweeper::ClearMarkBitsAndHandleLivenessStatistics(Page* page,
int Sweeper::RawSweep(
Page* p, FreeSpaceTreatmentMode free_space_treatment_mode,
SweepingMode sweeping_mode, const base::MutexGuard& page_guard,
PretenuringHandler::PretenuringFeedbackMap* local_pretenuring_feedback) {
PretenturingHandler::PretenuringFeedbackMap* local_pretenuring_feedback) {
Space* space = p->owner();
DCHECK_NOT_NULL(space);
DCHECK(space->identity() == OLD_SPACE || space->identity() == CODE_SPACE ||
@ -732,8 +732,8 @@ class PromotedPageRecordMigratedSlotVisitor
inline void HandlePromotedObject(
HeapObject object, NonAtomicMarkingState* marking_state,
PretenuringHandler* pretenuring_handler, PtrComprCageBase cage_base,
PretenuringHandler::PretenuringFeedbackMap* local_pretenuring_feedback,
PretenturingHandler* pretenuring_handler, PtrComprCageBase cage_base,
PretenturingHandler::PretenuringFeedbackMap* local_pretenuring_feedback,
PromotedPageRecordMigratedSlotVisitor* record_visitor) {
DCHECK(marking_state->IsBlack(object));
pretenuring_handler->UpdateAllocationSite(object.map(), object,
@ -749,7 +749,7 @@ inline void HandlePromotedObject(
void Sweeper::RawIteratePromotedPageForRememberedSets(
MemoryChunk* chunk,
PretenuringHandler::PretenuringFeedbackMap* local_pretenuring_feedback,
PretenturingHandler::PretenuringFeedbackMap* local_pretenuring_feedback,
CachedOldToNewRememberedSets* snapshot_old_to_new_remembered_sets) {
DCHECK(chunk->owner_identity() == OLD_SPACE ||
chunk->owner_identity() == LO_SPACE);
@ -866,7 +866,7 @@ int Sweeper::ParallelSweepSpace(AllocationSpace identity,
int Sweeper::ParallelSweepPage(
Page* page, AllocationSpace identity,
PretenuringHandler::PretenuringFeedbackMap* local_pretenuring_feedback,
PretenturingHandler::PretenuringFeedbackMap* local_pretenuring_feedback,
SweepingMode sweeping_mode) {
DCHECK(IsValidSweepingSpace(identity));
@ -912,7 +912,7 @@ void Sweeper::ParallelIteratePromotedPagesForRememberedSets() {
void Sweeper::ParallelIteratePromotedPageForRememberedSets(
MemoryChunk* chunk,
PretenuringHandler::PretenuringFeedbackMap* local_pretenuring_feedback,
PretenturingHandler::PretenuringFeedbackMap* local_pretenuring_feedback,
CachedOldToNewRememberedSets* snapshot_old_to_new_remembered_sets) {
DCHECK_NOT_NULL(chunk);
base::MutexGuard guard(chunk->mutex());

View File

@ -99,7 +99,7 @@ class Sweeper {
int required_freed_bytes, int max_pages = 0);
int ParallelSweepPage(
Page* page, AllocationSpace identity,
PretenuringHandler::PretenuringFeedbackMap* local_pretenuring_feedback,
PretenturingHandler::PretenuringFeedbackMap* local_pretenuring_feedback,
SweepingMode sweeping_mode);
void EnsurePageIsSwept(Page* page);
@ -107,16 +107,16 @@ class Sweeper {
int RawSweep(
Page* p, FreeSpaceTreatmentMode free_space_treatment_mode,
SweepingMode sweeping_mode, const base::MutexGuard& page_guard,
PretenuringHandler::PretenuringFeedbackMap* local_pretenuring_feedback);
PretenturingHandler::PretenuringFeedbackMap* local_pretenuring_feedback);
void ParallelIteratePromotedPagesForRememberedSets();
void ParallelIteratePromotedPageForRememberedSets(
MemoryChunk* chunk,
PretenuringHandler::PretenuringFeedbackMap* local_pretenuring_feedback,
PretenturingHandler::PretenuringFeedbackMap* local_pretenuring_feedback,
CachedOldToNewRememberedSets* snapshot_old_to_new_remembered_sets);
void RawIteratePromotedPageForRememberedSets(
MemoryChunk* chunk,
PretenuringHandler::PretenuringFeedbackMap* local_pretenuring_feedback,
PretenturingHandler::PretenuringFeedbackMap* local_pretenuring_feedback,
CachedOldToNewRememberedSets* snapshot_old_to_new_remembered_sets);
// After calling this function sweeping is considered to be in progress
@ -234,8 +234,8 @@ class Sweeper {
std::atomic<bool> sweeping_in_progress_;
bool should_reduce_memory_;
bool should_sweep_non_new_spaces_ = false;
PretenuringHandler* const pretenuring_handler_;
PretenuringHandler::PretenuringFeedbackMap local_pretenuring_feedback_;
PretenturingHandler* const pretenuring_handler_;
PretenturingHandler::PretenuringFeedbackMap local_pretenuring_feedback_;
base::Optional<GarbageCollector> current_new_space_collector_;
CachedOldToNewRememberedSets snapshot_old_to_new_remembered_sets_;

View File

@ -5343,10 +5343,10 @@ bool JSObject::UpdateAllocationSite(Handle<JSObject> object,
DisallowGarbageCollection no_gc;
Heap* heap = object->GetHeap();
PretenuringHandler* pretunring_handler = heap->pretenuring_handler();
PretenturingHandler* pretunring_handler = heap->pretenuring_handler();
AllocationMemento memento =
pretunring_handler
->FindAllocationMemento<PretenuringHandler::kForRuntime>(
->FindAllocationMemento<PretenturingHandler::kForRuntime>(
object->map(), *object);
if (memento.is_null()) return false;

View File

@ -1368,11 +1368,11 @@ RUNTIME_FUNCTION(Runtime_PretenureAllocationSite) {
return ReturnFuzzSafe(ReadOnlyRoots(isolate).false_value(), isolate);
}
PretenuringHandler* pretenuring_handler = heap->pretenuring_handler();
PretenturingHandler* pretenuring_handler = heap->pretenuring_handler();
AllocationMemento memento =
pretenuring_handler
->FindAllocationMemento<PretenuringHandler::kForRuntime>(object.map(),
object);
->FindAllocationMemento<PretenturingHandler::kForRuntime>(
object.map(), object);
if (memento.is_null())
return ReturnFuzzSafe(ReadOnlyRoots(isolate).false_value(), isolate);
AllocationSite site = memento.GetAllocationSite();