Commit d4363986 authored by ishell's avatar ishell Committed by Commit bot

[runtime] Remove further usages of PropertyType in favor of PropertyKind/PropertyLocation.

BUG=v8:5495

Review-Url: https://codereview.chromium.org/2622413004
Cr-Commit-Position: refs/heads/master@{#42328}
parent 391f1ac3
...@@ -550,7 +550,7 @@ MaybeHandle<JSObject> ApiNatives::InstantiateRemoteObject( ...@@ -550,7 +550,7 @@ MaybeHandle<JSObject> ApiNatives::InstantiateRemoteObject(
void ApiNatives::AddDataProperty(Isolate* isolate, Handle<TemplateInfo> info, void ApiNatives::AddDataProperty(Isolate* isolate, Handle<TemplateInfo> info,
Handle<Name> name, Handle<Object> value, Handle<Name> name, Handle<Object> value,
PropertyAttributes attributes) { PropertyAttributes attributes) {
PropertyDetails details(attributes, DATA, 0, PropertyCellType::kNoCell); PropertyDetails details(kData, attributes, 0, PropertyCellType::kNoCell);
auto details_handle = handle(details.AsSmi(), isolate); auto details_handle = handle(details.AsSmi(), isolate);
Handle<Object> data[] = {name, details_handle, value}; Handle<Object> data[] = {name, details_handle, value};
AddPropertyToPropertyList(isolate, info, arraysize(data), data); AddPropertyToPropertyList(isolate, info, arraysize(data), data);
...@@ -562,7 +562,7 @@ void ApiNatives::AddDataProperty(Isolate* isolate, Handle<TemplateInfo> info, ...@@ -562,7 +562,7 @@ void ApiNatives::AddDataProperty(Isolate* isolate, Handle<TemplateInfo> info,
PropertyAttributes attributes) { PropertyAttributes attributes) {
auto value = handle(Smi::FromInt(intrinsic), isolate); auto value = handle(Smi::FromInt(intrinsic), isolate);
auto intrinsic_marker = isolate->factory()->true_value(); auto intrinsic_marker = isolate->factory()->true_value();
PropertyDetails details(attributes, DATA, 0, PropertyCellType::kNoCell); PropertyDetails details(kData, attributes, 0, PropertyCellType::kNoCell);
auto details_handle = handle(details.AsSmi(), isolate); auto details_handle = handle(details.AsSmi(), isolate);
Handle<Object> data[] = {name, intrinsic_marker, details_handle, value}; Handle<Object> data[] = {name, intrinsic_marker, details_handle, value};
AddPropertyToPropertyList(isolate, info, arraysize(data), data); AddPropertyToPropertyList(isolate, info, arraysize(data), data);
...@@ -575,7 +575,7 @@ void ApiNatives::AddAccessorProperty(Isolate* isolate, ...@@ -575,7 +575,7 @@ void ApiNatives::AddAccessorProperty(Isolate* isolate,
Handle<FunctionTemplateInfo> getter, Handle<FunctionTemplateInfo> getter,
Handle<FunctionTemplateInfo> setter, Handle<FunctionTemplateInfo> setter,
PropertyAttributes attributes) { PropertyAttributes attributes) {
PropertyDetails details(attributes, ACCESSOR, 0, PropertyCellType::kNoCell); PropertyDetails details(kAccessor, attributes, 0, PropertyCellType::kNoCell);
auto details_handle = handle(details.AsSmi(), isolate); auto details_handle = handle(details.AsSmi(), isolate);
Handle<Object> data[] = {name, details_handle, getter, setter}; Handle<Object> data[] = {name, details_handle, getter, setter};
AddPropertyToPropertyList(isolate, info, arraysize(data), data); AddPropertyToPropertyList(isolate, info, arraysize(data), data);
......
...@@ -4414,7 +4414,7 @@ void Genesis::TransferNamedProperties(Handle<JSObject> from, ...@@ -4414,7 +4414,7 @@ void Genesis::TransferNamedProperties(Handle<JSObject> from,
DCHECK(!to->HasFastProperties()); DCHECK(!to->HasFastProperties());
// Add to dictionary. // Add to dictionary.
Handle<Object> callbacks(descs->GetCallbacksObject(i), isolate()); Handle<Object> callbacks(descs->GetCallbacksObject(i), isolate());
PropertyDetails d(details.attributes(), ACCESSOR_CONSTANT, i + 1, PropertyDetails d(kAccessor, details.attributes(), i + 1,
PropertyCellType::kMutable); PropertyCellType::kMutable);
JSObject::SetNormalizedProperty(to, key, callbacks, d); JSObject::SetNormalizedProperty(to, key, callbacks, d);
} }
......
...@@ -4617,7 +4617,7 @@ void CodeStubAssembler::InsertEntry<NameDictionary>(Node* dictionary, ...@@ -4617,7 +4617,7 @@ void CodeStubAssembler::InsertEntry<NameDictionary>(Node* dictionary,
// Prepare details of the new property. // Prepare details of the new property.
Variable var_details(this, MachineRepresentation::kTaggedSigned); Variable var_details(this, MachineRepresentation::kTaggedSigned);
const int kInitialIndex = 0; const int kInitialIndex = 0;
PropertyDetails d(NONE, DATA, kInitialIndex, PropertyCellType::kNoCell); PropertyDetails d(kData, NONE, kInitialIndex, PropertyCellType::kNoCell);
enum_index = enum_index =
SmiShl(enum_index, PropertyDetails::DictionaryStorageField::kShift); SmiShl(enum_index, PropertyDetails::DictionaryStorageField::kShift);
STATIC_ASSERT(kInitialIndex == 0); STATIC_ASSERT(kInitialIndex == 0);
......
...@@ -2456,7 +2456,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder, ...@@ -2456,7 +2456,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder,
field_type_(HType::Tagged()), field_type_(HType::Tagged()),
access_(HObjectAccess::ForMap()), access_(HObjectAccess::ForMap()),
lookup_type_(NOT_FOUND), lookup_type_(NOT_FOUND),
details_(NONE, DATA, Representation::None()) {} details_(PropertyDetails::Empty()) {}
// Checkes whether this PropertyAccessInfo can be handled as a monomorphic // Checkes whether this PropertyAccessInfo can be handled as a monomorphic
// load named. It additionally fills in the fields necessary to generate the // load named. It additionally fills in the fields necessary to generate the
......
...@@ -1247,11 +1247,11 @@ class ElementsAccessorBase : public ElementsAccessor { ...@@ -1247,11 +1247,11 @@ class ElementsAccessorBase : public ElementsAccessor {
static PropertyDetails GetDetailsImpl(FixedArrayBase* backing_store, static PropertyDetails GetDetailsImpl(FixedArrayBase* backing_store,
uint32_t entry) { uint32_t entry) {
return PropertyDetails(NONE, DATA, 0, PropertyCellType::kNoCell); return PropertyDetails(kData, NONE, 0, PropertyCellType::kNoCell);
} }
static PropertyDetails GetDetailsImpl(JSObject* holder, uint32_t entry) { static PropertyDetails GetDetailsImpl(JSObject* holder, uint32_t entry) {
return PropertyDetails(NONE, DATA, 0, PropertyCellType::kNoCell); return PropertyDetails(kData, NONE, 0, PropertyCellType::kNoCell);
} }
PropertyDetails GetDetails(JSObject* holder, uint32_t entry) final { PropertyDetails GetDetails(JSObject* holder, uint32_t entry) final {
...@@ -1417,7 +1417,7 @@ class DictionaryElementsAccessor ...@@ -1417,7 +1417,7 @@ class DictionaryElementsAccessor
if (attributes != NONE) object->RequireSlowElements(dictionary); if (attributes != NONE) object->RequireSlowElements(dictionary);
dictionary->ValueAtPut(entry, *value); dictionary->ValueAtPut(entry, *value);
PropertyDetails details = dictionary->DetailsAt(entry); PropertyDetails details = dictionary->DetailsAt(entry);
details = PropertyDetails(attributes, DATA, details.dictionary_index(), details = PropertyDetails(kData, attributes, details.dictionary_index(),
PropertyCellType::kNoCell); PropertyCellType::kNoCell);
dictionary->DetailsAtPut(entry, details); dictionary->DetailsAtPut(entry, details);
} }
...@@ -1425,7 +1425,7 @@ class DictionaryElementsAccessor ...@@ -1425,7 +1425,7 @@ class DictionaryElementsAccessor
static void AddImpl(Handle<JSObject> object, uint32_t index, static void AddImpl(Handle<JSObject> object, uint32_t index,
Handle<Object> value, PropertyAttributes attributes, Handle<Object> value, PropertyAttributes attributes,
uint32_t new_capacity) { uint32_t new_capacity) {
PropertyDetails details(attributes, DATA, 0, PropertyCellType::kNoCell); PropertyDetails details(kData, attributes, 0, PropertyCellType::kNoCell);
Handle<SeededNumberDictionary> dictionary = Handle<SeededNumberDictionary> dictionary =
object->HasFastElements() || object->HasFastStringWrapperElements() object->HasFastElements() || object->HasFastStringWrapperElements()
? JSObject::NormalizeElements(object) ? JSObject::NormalizeElements(object)
...@@ -2721,12 +2721,12 @@ class TypedElementsAccessor ...@@ -2721,12 +2721,12 @@ class TypedElementsAccessor
} }
static PropertyDetails GetDetailsImpl(JSObject* holder, uint32_t entry) { static PropertyDetails GetDetailsImpl(JSObject* holder, uint32_t entry) {
return PropertyDetails(DONT_DELETE, DATA, 0, PropertyCellType::kNoCell); return PropertyDetails(kData, DONT_DELETE, 0, PropertyCellType::kNoCell);
} }
static PropertyDetails GetDetailsImpl(FixedArrayBase* backing_store, static PropertyDetails GetDetailsImpl(FixedArrayBase* backing_store,
uint32_t entry) { uint32_t entry) {
return PropertyDetails(DONT_DELETE, DATA, 0, PropertyCellType::kNoCell); return PropertyDetails(kData, DONT_DELETE, 0, PropertyCellType::kNoCell);
} }
static bool HasElementImpl(Isolate* isolate, Handle<JSObject> holder, static bool HasElementImpl(Isolate* isolate, Handle<JSObject> holder,
...@@ -3085,7 +3085,7 @@ class SloppyArgumentsElementsAccessor ...@@ -3085,7 +3085,7 @@ class SloppyArgumentsElementsAccessor
FixedArray* parameter_map = FixedArray::cast(holder->elements()); FixedArray* parameter_map = FixedArray::cast(holder->elements());
uint32_t length = parameter_map->length() - 2; uint32_t length = parameter_map->length() - 2;
if (entry < length) { if (entry < length) {
return PropertyDetails(NONE, DATA, 0, PropertyCellType::kNoCell); return PropertyDetails(kData, NONE, 0, PropertyCellType::kNoCell);
} }
FixedArray* arguments = FixedArray::cast(parameter_map->get(1)); FixedArray* arguments = FixedArray::cast(parameter_map->get(1));
return ArgumentsAccessor::GetDetailsImpl(arguments, entry - length); return ArgumentsAccessor::GetDetailsImpl(arguments, entry - length);
...@@ -3272,7 +3272,7 @@ class SlowSloppyArgumentsElementsAccessor ...@@ -3272,7 +3272,7 @@ class SlowSloppyArgumentsElementsAccessor
old_elements->IsSeededNumberDictionary() old_elements->IsSeededNumberDictionary()
? Handle<SeededNumberDictionary>::cast(old_elements) ? Handle<SeededNumberDictionary>::cast(old_elements)
: JSObject::NormalizeElements(object); : JSObject::NormalizeElements(object);
PropertyDetails details(attributes, DATA, 0, PropertyCellType::kNoCell); PropertyDetails details(kData, attributes, 0, PropertyCellType::kNoCell);
Handle<SeededNumberDictionary> new_dictionary = Handle<SeededNumberDictionary> new_dictionary =
SeededNumberDictionary::AddNumberEntry(dictionary, index, value, SeededNumberDictionary::AddNumberEntry(dictionary, index, value,
details, object); details, object);
...@@ -3304,7 +3304,7 @@ class SlowSloppyArgumentsElementsAccessor ...@@ -3304,7 +3304,7 @@ class SlowSloppyArgumentsElementsAccessor
value = isolate->factory()->NewAliasedArgumentsEntry(context_entry); value = isolate->factory()->NewAliasedArgumentsEntry(context_entry);
} }
PropertyDetails details(attributes, DATA, 0, PropertyCellType::kNoCell); PropertyDetails details(kData, attributes, 0, PropertyCellType::kNoCell);
Handle<SeededNumberDictionary> arguments( Handle<SeededNumberDictionary> arguments(
SeededNumberDictionary::cast(parameter_map->get(1)), isolate); SeededNumberDictionary::cast(parameter_map->get(1)), isolate);
arguments = SeededNumberDictionary::AddNumberEntry( arguments = SeededNumberDictionary::AddNumberEntry(
...@@ -3483,8 +3483,7 @@ class StringWrapperElementsAccessor ...@@ -3483,8 +3483,7 @@ class StringWrapperElementsAccessor
if (entry < length) { if (entry < length) {
PropertyAttributes attributes = PropertyAttributes attributes =
static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE); static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE);
return PropertyDetails(attributes, v8::internal::DATA, 0, return PropertyDetails(kData, attributes, 0, PropertyCellType::kNoCell);
PropertyCellType::kNoCell);
} }
return BackingStoreAccessor::GetDetailsImpl(holder, entry - length); return BackingStoreAccessor::GetDetailsImpl(holder, entry - length);
} }
......
...@@ -1737,7 +1737,7 @@ Handle<JSGlobalObject> Factory::NewJSGlobalObject( ...@@ -1737,7 +1737,7 @@ Handle<JSGlobalObject> Factory::NewJSGlobalObject(
PropertyDetails details = descs->GetDetails(i); PropertyDetails details = descs->GetDetails(i);
// Only accessors are expected. // Only accessors are expected.
DCHECK_EQ(kAccessor, details.kind()); DCHECK_EQ(kAccessor, details.kind());
PropertyDetails d(details.attributes(), ACCESSOR_CONSTANT, i + 1, PropertyDetails d(kAccessor, details.attributes(), i + 1,
PropertyCellType::kMutable); PropertyCellType::kMutable);
Handle<Name> name(descs->GetKey(i)); Handle<Name> name(descs->GetKey(i));
Handle<PropertyCell> cell = NewPropertyCell(); Handle<PropertyCell> cell = NewPropertyCell();
......
...@@ -275,8 +275,7 @@ void LookupIterator::ReconfigureDataProperty(Handle<Object> value, ...@@ -275,8 +275,7 @@ void LookupIterator::ReconfigureDataProperty(Handle<Object> value,
JSObject::MigrateToMap(holder, new_map); JSObject::MigrateToMap(holder, new_map);
ReloadPropertyInformation<false>(); ReloadPropertyInformation<false>();
} else { } else {
PropertyDetails details(attributes, v8::internal::DATA, 0, PropertyDetails details(kData, attributes, 0, PropertyCellType::kMutable);
PropertyCellType::kMutable);
if (holder->IsJSGlobalObject()) { if (holder->IsJSGlobalObject()) {
Handle<GlobalDictionary> dictionary(holder->global_dictionary()); Handle<GlobalDictionary> dictionary(holder->global_dictionary());
...@@ -344,7 +343,7 @@ void LookupIterator::PrepareTransitionToDataProperty( ...@@ -344,7 +343,7 @@ void LookupIterator::PrepareTransitionToDataProperty(
// SetNextEnumerationIndex. // SetNextEnumerationIndex.
int index = dictionary->NextEnumerationIndex(); int index = dictionary->NextEnumerationIndex();
dictionary->SetNextEnumerationIndex(index + 1); dictionary->SetNextEnumerationIndex(index + 1);
property_details_ = PropertyDetails(attributes, i::DATA, index, property_details_ = PropertyDetails(kData, attributes, index,
PropertyCellType::kUninitialized); PropertyCellType::kUninitialized);
PropertyCellType new_type = PropertyCellType new_type =
PropertyCell::UpdatedType(cell, value, property_details_); PropertyCell::UpdatedType(cell, value, property_details_);
...@@ -355,7 +354,7 @@ void LookupIterator::PrepareTransitionToDataProperty( ...@@ -355,7 +354,7 @@ void LookupIterator::PrepareTransitionToDataProperty(
} else { } else {
// Don't set enumeration index (it will be set during value store). // Don't set enumeration index (it will be set during value store).
property_details_ = property_details_ =
PropertyDetails(attributes, i::DATA, 0, PropertyCellType::kNoCell); PropertyDetails(kData, attributes, 0, PropertyCellType::kNoCell);
transition_ = map; transition_ = map;
} }
return; return;
...@@ -369,7 +368,7 @@ void LookupIterator::PrepareTransitionToDataProperty( ...@@ -369,7 +368,7 @@ void LookupIterator::PrepareTransitionToDataProperty(
if (transition->is_dictionary_map()) { if (transition->is_dictionary_map()) {
// Don't set enumeration index (it will be set during value store). // Don't set enumeration index (it will be set during value store).
property_details_ = property_details_ =
PropertyDetails(attributes, i::DATA, 0, PropertyCellType::kNoCell); PropertyDetails(kData, attributes, 0, PropertyCellType::kNoCell);
} else { } else {
property_details_ = transition->GetLastDescriptorDetails(); property_details_ = transition->GetLastDescriptorDetails();
has_property_ = true; has_property_ = true;
...@@ -518,8 +517,7 @@ void LookupIterator::TransitionToAccessorPair(Handle<Object> pair, ...@@ -518,8 +517,7 @@ void LookupIterator::TransitionToAccessorPair(Handle<Object> pair,
Handle<JSObject> receiver = GetStoreTarget(); Handle<JSObject> receiver = GetStoreTarget();
holder_ = receiver; holder_ = receiver;
PropertyDetails details(attributes, ACCESSOR_CONSTANT, 0, PropertyDetails details(kAccessor, attributes, 0, PropertyCellType::kMutable);
PropertyCellType::kMutable);
if (IsElement()) { if (IsElement()) {
// TODO(verwaest): Move code into the element accessor. // TODO(verwaest): Move code into the element accessor.
......
...@@ -3754,14 +3754,14 @@ void MigrateFastToSlow(Handle<JSObject> object, Handle<Map> new_map, ...@@ -3754,14 +3754,14 @@ void MigrateFastToSlow(Handle<JSObject> object, Handle<Map> new_map,
value = isolate->factory()->NewHeapNumber(old->value()); value = isolate->factory()->NewHeapNumber(old->value());
} }
} }
PropertyDetails d(details.attributes(), DATA, i + 1, PropertyDetails d(kData, details.attributes(), i + 1,
PropertyCellType::kNoCell); PropertyCellType::kNoCell);
dictionary = NameDictionary::Add(dictionary, key, value, d); dictionary = NameDictionary::Add(dictionary, key, value, d);
} else { } else {
DCHECK_EQ(kAccessor, details.kind()); DCHECK_EQ(kAccessor, details.kind());
Handle<Object> value(object->RawFastPropertyAt(index), isolate); Handle<Object> value(object->RawFastPropertyAt(index), isolate);
PropertyDetails d(details.attributes(), ACCESSOR_CONSTANT, i + 1, PropertyDetails d(kAccessor, details.attributes(), i + 1,
PropertyCellType::kNoCell); PropertyCellType::kNoCell);
dictionary = NameDictionary::Add(dictionary, key, value, d); dictionary = NameDictionary::Add(dictionary, key, value, d);
} }
...@@ -3770,14 +3770,14 @@ void MigrateFastToSlow(Handle<JSObject> object, Handle<Map> new_map, ...@@ -3770,14 +3770,14 @@ void MigrateFastToSlow(Handle<JSObject> object, Handle<Map> new_map,
DCHECK_EQ(kDescriptor, details.location()); DCHECK_EQ(kDescriptor, details.location());
if (details.kind() == kData) { if (details.kind() == kData) {
Handle<Object> value(descs->GetConstant(i), isolate); Handle<Object> value(descs->GetConstant(i), isolate);
PropertyDetails d(details.attributes(), DATA, i + 1, PropertyDetails d(kData, details.attributes(), i + 1,
PropertyCellType::kNoCell); PropertyCellType::kNoCell);
dictionary = NameDictionary::Add(dictionary, key, value, d); dictionary = NameDictionary::Add(dictionary, key, value, d);
} else { } else {
DCHECK_EQ(kAccessor, details.kind()); DCHECK_EQ(kAccessor, details.kind());
Handle<Object> value(descs->GetCallbacksObject(i), isolate); Handle<Object> value(descs->GetCallbacksObject(i), isolate);
PropertyDetails d(details.attributes(), ACCESSOR_CONSTANT, i + 1, PropertyDetails d(kAccessor, details.attributes(), i + 1,
PropertyCellType::kNoCell); PropertyCellType::kNoCell);
dictionary = NameDictionary::Add(dictionary, key, value, d); dictionary = NameDictionary::Add(dictionary, key, value, d);
} }
...@@ -5753,7 +5753,7 @@ void JSObject::MigrateSlowToFast(Handle<JSObject> object, ...@@ -5753,7 +5753,7 @@ void JSObject::MigrateSlowToFast(Handle<JSObject> object,
Representation::Tagged()); Representation::Tagged());
} }
} else { } else {
DCHECK_EQ(kDescriptor, details.location()); DCHECK_EQ(kAccessor, details.kind());
d = Descriptor::AccessorConstant(key, handle(value, isolate), d = Descriptor::AccessorConstant(key, handle(value, isolate),
details.attributes()); details.attributes());
} }
...@@ -6967,7 +6967,7 @@ Maybe<bool> JSProxy::SetPrivateProperty(Isolate* isolate, Handle<JSProxy> proxy, ...@@ -6967,7 +6967,7 @@ Maybe<bool> JSProxy::SetPrivateProperty(Isolate* isolate, Handle<JSProxy> proxy,
} }
Handle<NameDictionary> dict(proxy->property_dictionary()); Handle<NameDictionary> dict(proxy->property_dictionary());
PropertyDetails details(DONT_ENUM, DATA, 0, PropertyCellType::kNoCell); PropertyDetails details(kData, DONT_ENUM, 0, PropertyCellType::kNoCell);
Handle<NameDictionary> result = Handle<NameDictionary> result =
NameDictionary::Add(dict, private_name, value, details); NameDictionary::Add(dict, private_name, value, details);
if (!dict.is_identical_to(result)) proxy->set_properties(*result); if (!dict.is_identical_to(result)) proxy->set_properties(*result);
...@@ -17100,12 +17100,12 @@ Handle<PropertyCell> JSGlobalObject::EnsureEmptyPropertyCell( ...@@ -17100,12 +17100,12 @@ Handle<PropertyCell> JSGlobalObject::EnsureEmptyPropertyCell(
if (original_cell_type == PropertyCellType::kInvalidated) { if (original_cell_type == PropertyCellType::kInvalidated) {
cell = PropertyCell::InvalidateEntry(dictionary, entry); cell = PropertyCell::InvalidateEntry(dictionary, entry);
} }
PropertyDetails details(NONE, DATA, 0, cell_type); PropertyDetails details(kData, NONE, 0, cell_type);
cell->set_property_details(details); cell->set_property_details(details);
return cell; return cell;
} }
cell = isolate->factory()->NewPropertyCell(); cell = isolate->factory()->NewPropertyCell();
PropertyDetails details(NONE, DATA, 0, cell_type); PropertyDetails details(kData, NONE, 0, cell_type);
dictionary = dictionary =
GlobalDictionary::Add(dictionary, name, cell, details, entry_out); GlobalDictionary::Add(dictionary, name, cell, details, entry_out);
// {*entry_out} is initialized inside GlobalDictionary::Add(). // {*entry_out} is initialized inside GlobalDictionary::Add().
......
...@@ -232,26 +232,16 @@ enum class PropertyCellConstantType { ...@@ -232,26 +232,16 @@ enum class PropertyCellConstantType {
// They are used both in property dictionaries and instance descriptors. // They are used both in property dictionaries and instance descriptors.
class PropertyDetails BASE_EMBEDDED { class PropertyDetails BASE_EMBEDDED {
public: public:
PropertyDetails(PropertyAttributes attributes, PropertyType type, int index, // Property details for dictionary mode properties/elements.
PropertyDetails(PropertyKind kind, PropertyAttributes attributes, int index,
PropertyCellType cell_type) { PropertyCellType cell_type) {
value_ = TypeField::encode(type) | AttributesField::encode(attributes) | value_ = KindField::encode(kind) | LocationField::encode(kField) |
AttributesField::encode(attributes) |
DictionaryStorageField::encode(index) | DictionaryStorageField::encode(index) |
PropertyCellTypeField::encode(cell_type); PropertyCellTypeField::encode(cell_type);
DCHECK(type == this->type());
DCHECK(attributes == this->attributes());
}
PropertyDetails(PropertyAttributes attributes,
PropertyType type,
Representation representation,
int field_index = 0) {
value_ = TypeField::encode(type)
| AttributesField::encode(attributes)
| RepresentationField::encode(EncodeRepresentation(representation))
| FieldIndexField::encode(field_index);
} }
// Property details for fast mode properties.
PropertyDetails(PropertyKind kind, PropertyAttributes attributes, PropertyDetails(PropertyKind kind, PropertyAttributes attributes,
PropertyLocation location, Representation representation, PropertyLocation location, Representation representation,
int field_index = 0) { int field_index = 0) {
...@@ -263,7 +253,7 @@ class PropertyDetails BASE_EMBEDDED { ...@@ -263,7 +253,7 @@ class PropertyDetails BASE_EMBEDDED {
static PropertyDetails Empty( static PropertyDetails Empty(
PropertyCellType cell_type = PropertyCellType::kNoCell) { PropertyCellType cell_type = PropertyCellType::kNoCell) {
return PropertyDetails(NONE, DATA, 0, cell_type); return PropertyDetails(kData, NONE, 0, cell_type);
} }
int pointer() const { return DescriptorPointer::decode(value_); } int pointer() const { return DescriptorPointer::decode(value_); }
......
...@@ -25,8 +25,8 @@ std::ostream& operator<<(std::ostream& os, ...@@ -25,8 +25,8 @@ std::ostream& operator<<(std::ostream& os,
Descriptor Descriptor::DataField(Handle<Name> key, int field_index, Descriptor Descriptor::DataField(Handle<Name> key, int field_index,
PropertyAttributes attributes, PropertyAttributes attributes,
Representation representation) { Representation representation) {
return Descriptor(key, FieldType::Any(key->GetIsolate()), attributes, DATA, return DataField(key, field_index, FieldType::Any(key->GetIsolate()),
representation, field_index); attributes, representation);
} }
// Outputs PropertyDetails as a dictionary details. // Outputs PropertyDetails as a dictionary details.
......
...@@ -37,19 +37,19 @@ class Descriptor final BASE_EMBEDDED { ...@@ -37,19 +37,19 @@ class Descriptor final BASE_EMBEDDED {
PropertyAttributes attributes, PropertyAttributes attributes,
Representation representation) { Representation representation) {
DCHECK(wrapped_field_type->IsSmi() || wrapped_field_type->IsWeakCell()); DCHECK(wrapped_field_type->IsSmi() || wrapped_field_type->IsWeakCell());
return Descriptor(key, wrapped_field_type, attributes, DATA, representation, return Descriptor(key, wrapped_field_type, kData, attributes, kField,
field_index); representation, field_index);
} }
static Descriptor DataConstant(Handle<Name> key, Handle<Object> value, static Descriptor DataConstant(Handle<Name> key, Handle<Object> value,
PropertyAttributes attributes) { PropertyAttributes attributes) {
return Descriptor(key, value, attributes, DATA_CONSTANT, return Descriptor(key, value, kData, attributes, kDescriptor,
value->OptimalRepresentation()); value->OptimalRepresentation());
} }
static Descriptor AccessorConstant(Handle<Name> key, Handle<Object> foreign, static Descriptor AccessorConstant(Handle<Name> key, Handle<Object> foreign,
PropertyAttributes attributes) { PropertyAttributes attributes) {
return Descriptor(key, foreign, attributes, ACCESSOR_CONSTANT, return Descriptor(key, foreign, kAccessor, attributes, kDescriptor,
Representation::Tagged()); Representation::Tagged());
} }
...@@ -73,12 +73,12 @@ class Descriptor final BASE_EMBEDDED { ...@@ -73,12 +73,12 @@ class Descriptor final BASE_EMBEDDED {
DCHECK_IMPLIES(key->IsPrivate(), !details_.IsEnumerable()); DCHECK_IMPLIES(key->IsPrivate(), !details_.IsEnumerable());
} }
Descriptor(Handle<Name> key, Handle<Object> value, Descriptor(Handle<Name> key, Handle<Object> value, PropertyKind kind,
PropertyAttributes attributes, PropertyType type, PropertyAttributes attributes, PropertyLocation location,
Representation representation, int field_index = 0) Representation representation, int field_index = 0)
: key_(key), : key_(key),
value_(value), value_(value),
details_(attributes, type, representation, field_index) { details_(kind, attributes, location, representation, field_index) {
DCHECK(key->IsUniqueName()); DCHECK(key->IsUniqueName());
DCHECK_IMPLIES(key->IsPrivate(), !details_.IsEnumerable()); DCHECK_IMPLIES(key->IsPrivate(), !details_.IsEnumerable());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment