#include "src/heap/pretenuring-handler.h"
#include "src/common/globals.h"
#include "src/execution/isolate.h"
#include "src/flags/flags.h"
#include "src/handles/global-handles-inl.h"
#include "src/heap/gc-tracer-inl.h"
#include "src/heap/new-spaces.h"
#include "src/objects/allocation-site-inl.h"
namespace v8 {
namespace internal {
PretenuringHandler::PretenuringHandler(Heap* heap)
: … { … }
PretenuringHandler::~PretenuringHandler() = default;
namespace {
static constexpr int kMinMementoCount = …;
double GetPretenuringRatioThreshold(size_t new_space_capacity) { … }
inline bool MakePretenureDecision(
Tagged<AllocationSite> site,
AllocationSite::PretenureDecision current_decision, double ratio,
bool new_space_capacity_was_above_pretenuring_threshold,
size_t new_space_capacity) { … }
inline void ResetPretenuringFeedback(Tagged<AllocationSite> site) { … }
inline bool DigestPretenuringFeedback(
Isolate* isolate, Tagged<AllocationSite> site,
bool new_space_capacity_was_above_pretenuring_threshold,
size_t new_space_capacity) { … }
bool PretenureAllocationSiteManually(Isolate* isolate,
Tagged<AllocationSite> site) { … }
}
int PretenuringHandler::GetMinMementoCountForTesting() { … }
void PretenuringHandler::MergeAllocationSitePretenuringFeedback(
const PretenuringFeedbackMap& local_pretenuring_feedback) { … }
void PretenuringHandler::RemoveAllocationSitePretenuringFeedback(
Tagged<AllocationSite> site) { … }
void PretenuringHandler::ProcessPretenuringFeedback(
size_t new_space_capacity_before_gc) { … }
void PretenuringHandler::PretenureAllocationSiteOnNextCollection(
Tagged<AllocationSite> site) { … }
void PretenuringHandler::reset() { … }
}
}