#include "src/objects/map-updater.h"
#include <optional>
#include <queue>
#include "src/base/platform/mutex.h"
#include "src/execution/frames.h"
#include "src/execution/isolate.h"
#include "src/handles/handles.h"
#include "src/heap/parked-scope-inl.h"
#include "src/objects/field-type.h"
#include "src/objects/keys.h"
#include "src/objects/objects-inl.h"
#include "src/objects/objects.h"
#include "src/objects/property-details.h"
#include "src/objects/transitions.h"
namespace v8::internal {
namespace {
inline bool EqualImmutableValues(Tagged<Object> obj1, Tagged<Object> obj2) { … }
V8_WARN_UNUSED_RESULT Handle<FieldType> GeneralizeFieldType(
Representation rep1, Handle<FieldType> type1, Representation rep2,
Handle<FieldType> type2, Isolate* isolate) { … }
void PrintGeneralization(
Isolate* isolate, DirectHandle<Map> map, FILE* file, const char* reason,
InternalIndex modify_index, int split, int descriptors,
bool descriptor_to_field, Representation old_representation,
Representation new_representation, PropertyConstness old_constness,
PropertyConstness new_constness, MaybeHandle<FieldType> old_field_type,
MaybeHandle<Object> old_value, MaybeHandle<FieldType> new_field_type,
MaybeHandle<Object> new_value) { … }
}
MapUpdater::MapUpdater(Isolate* isolate, Handle<Map> old_map)
: … { … }
Tagged<Name> MapUpdater::GetKey(InternalIndex descriptor) const { … }
PropertyDetails MapUpdater::GetDetails(InternalIndex descriptor) const { … }
Tagged<Object> MapUpdater::GetValue(InternalIndex descriptor) const { … }
Tagged<FieldType> MapUpdater::GetFieldType(InternalIndex descriptor) const { … }
Handle<FieldType> MapUpdater::GetOrComputeFieldType(
InternalIndex descriptor, PropertyLocation location,
Representation representation) const { … }
Handle<FieldType> MapUpdater::GetOrComputeFieldType(
DirectHandle<DescriptorArray> descriptors, InternalIndex descriptor,
PropertyLocation location, Representation representation) { … }
Handle<Map> MapUpdater::ReconfigureToDataField(InternalIndex descriptor,
PropertyAttributes attributes,
PropertyConstness constness,
Representation representation,
Handle<FieldType> field_type) { … }
Handle<Map> MapUpdater::ReconfigureElementsKind(ElementsKind elements_kind) { … }
Handle<Map> MapUpdater::ApplyPrototypeTransition(Handle<HeapObject> prototype) { … }
Handle<Map> MapUpdater::UpdateMapNoLock(Isolate* isolate, Handle<Map> map) { … }
Handle<Map> MapUpdater::Update() { … }
Handle<Map> MapUpdater::UpdateImpl() { … }
namespace {
struct IntegrityLevelTransitionInfo { … };
IntegrityLevelTransitionInfo DetectIntegrityLevelTransitions(
Tagged<Map> map, Isolate* isolate, DisallowGarbageCollection* no_gc,
ConcurrencyMode cmode) { … }
}
std::optional<Tagged<Map>> MapUpdater::TryUpdateNoLock(Isolate* isolate,
Tagged<Map> old_map,
ConcurrencyMode cmode) { … }
void MapUpdater::GeneralizeField(DirectHandle<Map> map,
InternalIndex modify_index,
PropertyConstness new_constness,
Representation new_representation,
Handle<FieldType> new_field_type) { … }
MapUpdater::State MapUpdater::Normalize(const char* reason) { … }
void MapUpdater::CompleteInobjectSlackTracking(Isolate* isolate,
Tagged<Map> initial_map) { … }
MapUpdater::State MapUpdater::TryReconfigureToDataFieldInplace() { … }
bool MapUpdater::TrySaveIntegrityLevelTransitions() { … }
MapUpdater::State MapUpdater::FindRootMap() { … }
MapUpdater::State MapUpdater::FindTargetMap() { … }
Handle<DescriptorArray> MapUpdater::BuildDescriptorArray() { … }
Handle<Map> MapUpdater::FindSplitMap(
DirectHandle<DescriptorArray> descriptors) { … }
MapUpdater::State MapUpdater::ConstructNewMap() { … }
MapUpdater::State MapUpdater::ConstructNewMapWithIntegrityLevelTransition() { … }
namespace {
void PrintReconfiguration(Isolate* isolate, DirectHandle<Map> map, FILE* file,
InternalIndex modify_index, PropertyKind kind,
PropertyAttributes attributes) { … }
}
Handle<Map> MapUpdater::ReconfigureExistingProperty(
Isolate* isolate, Handle<Map> map, InternalIndex descriptor,
PropertyKind kind, PropertyAttributes attributes,
PropertyConstness constness) { … }
void MapUpdater::UpdateFieldType(Isolate* isolate, DirectHandle<Map> map,
InternalIndex descriptor, Handle<Name> name,
PropertyConstness new_constness,
Representation new_representation,
Handle<FieldType> new_type) { … }
void MapUpdater::GeneralizeField(Isolate* isolate, DirectHandle<Map> map,
InternalIndex modify_index,
PropertyConstness new_constness,
Representation new_representation,
Handle<FieldType> new_field_type) { … }
}