[dict-proto] Rename v8_dict_mode_prototypes flag
The build time flag v8_dict_mode_prototypes is ill-named, because it does not control whether properties are kept in dictionary mode (this is done by the v8_dict_property_const_tracking flag), but instead it controls if SwissNameDictionary or NameDictionary is used as the property backing store for all dictionary mode objects. This CL renames the flag and updates its description. Change-Id: If1337838d1b6d8f089c281a77d9ef7cfd4007220 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2786859 Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Omer Katz <omerkatz@chromium.org> Reviewed-by: Camillo Bruni <cbruni@chromium.org> Reviewed-by: Santiago Aboy Solanes <solanes@chromium.org> Commit-Queue: Igor Sheludko <ishell@chromium.org> Cr-Commit-Position: refs/heads/master@{#73706}
This commit is contained in:
parent
4e086ac5a0
commit
51140a4409
10
BUILD.gn
10
BUILD.gn
@ -287,9 +287,9 @@ declare_args() {
|
|||||||
# Requires use_rtti = true
|
# Requires use_rtti = true
|
||||||
v8_enable_precise_zone_stats = false
|
v8_enable_precise_zone_stats = false
|
||||||
|
|
||||||
# Experimental feature for always keeping prototypes in dict/"slow" mode
|
# Experimental feature that uses SwissNameDictionary instead of NameDictionary
|
||||||
# Sets -DV8_DICT_MODE_PROTOTYPES
|
# as the backing store for all dictionary mode objects.
|
||||||
v8_dict_mode_prototypes = false
|
v8_enable_swiss_name_dictionary = false
|
||||||
|
|
||||||
# If enabled then macro definitions that are used in externally visible
|
# If enabled then macro definitions that are used in externally visible
|
||||||
# header files are placed in a separate header file v8-gn.h.
|
# header files are placed in a separate header file v8-gn.h.
|
||||||
@ -785,8 +785,8 @@ config("features") {
|
|||||||
if (v8_enable_short_builtin_calls) {
|
if (v8_enable_short_builtin_calls) {
|
||||||
defines += [ "V8_SHORT_BUILTIN_CALLS" ]
|
defines += [ "V8_SHORT_BUILTIN_CALLS" ]
|
||||||
}
|
}
|
||||||
if (v8_dict_mode_prototypes) {
|
if (v8_enable_swiss_name_dictionary) {
|
||||||
defines += [ "V8_DICT_MODE_PROTOTYPES" ]
|
defines += [ "V8_ENABLE_SWISS_NAME_DICTIONARY" ]
|
||||||
}
|
}
|
||||||
if (v8_enable_system_instrumentation) {
|
if (v8_enable_system_instrumentation) {
|
||||||
defines += [ "V8_ENABLE_SYSTEM_INSTRUMENTATION" ]
|
defines += [ "V8_ENABLE_SYSTEM_INSTRUMENTATION" ]
|
||||||
|
@ -6686,7 +6686,7 @@ Local<v8::Object> v8::Object::New(Isolate* isolate,
|
|||||||
// properties, and so we default to creating a properties backing store
|
// properties, and so we default to creating a properties backing store
|
||||||
// large enough to hold all of them, while we start with no elements
|
// large enough to hold all of them, while we start with no elements
|
||||||
// (see http://bit.ly/v8-fast-object-create-cpp for the motivation).
|
// (see http://bit.ly/v8-fast-object-create-cpp for the motivation).
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
i::Handle<i::SwissNameDictionary> properties =
|
i::Handle<i::SwissNameDictionary> properties =
|
||||||
i_isolate->factory()->NewSwissNameDictionary(static_cast<int>(length));
|
i_isolate->factory()->NewSwissNameDictionary(static_cast<int>(length));
|
||||||
AddPropertiesAndElementsToObject(i_isolate, properties, elements, names,
|
AddPropertiesAndElementsToObject(i_isolate, properties, elements, names,
|
||||||
|
@ -465,7 +465,7 @@ const kHeapObjectHeaderSize:
|
|||||||
constexpr int32 generates 'HeapObject::kHeaderSize';
|
constexpr int32 generates 'HeapObject::kHeaderSize';
|
||||||
|
|
||||||
const kDictModePrototypes:
|
const kDictModePrototypes:
|
||||||
constexpr bool generates 'V8_DICT_MODE_PROTOTYPES_BOOL';
|
constexpr bool generates 'V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL';
|
||||||
|
|
||||||
type TheHole extends Oddball;
|
type TheHole extends Oddball;
|
||||||
type Null extends Oddball;
|
type Null extends Oddball;
|
||||||
|
@ -327,7 +327,7 @@ TNode<JSObject> ConstructorBuiltinsAssembler::FastNewObject(
|
|||||||
}
|
}
|
||||||
BIND(&allocate_properties);
|
BIND(&allocate_properties);
|
||||||
{
|
{
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
properties =
|
properties =
|
||||||
AllocateSwissNameDictionary(SwissNameDictionary::kInitialCapacity);
|
AllocateSwissNameDictionary(SwissNameDictionary::kInitialCapacity);
|
||||||
} else {
|
} else {
|
||||||
@ -548,7 +548,7 @@ TNode<HeapObject> ConstructorBuiltinsAssembler::CreateShallowObjectLiteral(
|
|||||||
BIND(&if_dictionary);
|
BIND(&if_dictionary);
|
||||||
{
|
{
|
||||||
Comment("Copy dictionary properties");
|
Comment("Copy dictionary properties");
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
var_properties =
|
var_properties =
|
||||||
CopySwissNameDictionary(CAST(LoadSlowProperties(boilerplate)));
|
CopySwissNameDictionary(CAST(LoadSlowProperties(boilerplate)));
|
||||||
} else {
|
} else {
|
||||||
|
@ -1072,7 +1072,7 @@ TF_BUILTIN(ObjectCreate, ObjectBuiltinsAssembler) {
|
|||||||
BIND(&null_proto);
|
BIND(&null_proto);
|
||||||
{
|
{
|
||||||
map = LoadSlowObjectWithNullPrototypeMap(native_context);
|
map = LoadSlowObjectWithNullPrototypeMap(native_context);
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
properties =
|
properties =
|
||||||
AllocateSwissNameDictionary(SwissNameDictionary::kInitialCapacity);
|
AllocateSwissNameDictionary(SwissNameDictionary::kInitialCapacity);
|
||||||
} else {
|
} else {
|
||||||
@ -1420,7 +1420,7 @@ TNode<JSObject> ObjectBuiltinsAssembler::FromPropertyDescriptor(
|
|||||||
// We want to preallocate the slots for value, writable, get, set,
|
// We want to preallocate the slots for value, writable, get, set,
|
||||||
// enumerable and configurable - a total of 6
|
// enumerable and configurable - a total of 6
|
||||||
TNode<HeapObject> properties =
|
TNode<HeapObject> properties =
|
||||||
V8_DICT_MODE_PROTOTYPES_BOOL
|
V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL
|
||||||
? TNode<HeapObject>(AllocateSwissNameDictionary(6))
|
? TNode<HeapObject>(AllocateSwissNameDictionary(6))
|
||||||
: AllocateNameDictionary(6);
|
: AllocateNameDictionary(6);
|
||||||
TNode<JSObject> js_desc = AllocateJSObjectFromMap(map, properties);
|
TNode<JSObject> js_desc = AllocateJSObjectFromMap(map, properties);
|
||||||
|
@ -52,7 +52,7 @@ TNode<JSProxy> ProxiesCodeStubAssembler::AllocateProxy(
|
|||||||
BIND(&create_proxy);
|
BIND(&create_proxy);
|
||||||
TNode<HeapObject> proxy = Allocate(JSProxy::kSize);
|
TNode<HeapObject> proxy = Allocate(JSProxy::kSize);
|
||||||
StoreMapNoWriteBarrier(proxy, map.value());
|
StoreMapNoWriteBarrier(proxy, map.value());
|
||||||
RootIndex empty_dict = V8_DICT_MODE_PROTOTYPES_BOOL
|
RootIndex empty_dict = V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL
|
||||||
? RootIndex::kEmptySwissPropertyDictionary
|
? RootIndex::kEmptySwissPropertyDictionary
|
||||||
: RootIndex::kEmptyPropertyDictionary;
|
: RootIndex::kEmptyPropertyDictionary;
|
||||||
StoreObjectFieldRoot(proxy, JSProxy::kPropertiesOrHashOffset, empty_dict);
|
StoreObjectFieldRoot(proxy, JSProxy::kPropertiesOrHashOffset, empty_dict);
|
||||||
|
@ -323,7 +323,7 @@ TNode<JSRegExpResult> RegExpBuiltinsAssembler::ConstructNewResultFromMatchInfo(
|
|||||||
TNode<NativeContext> native_context = LoadNativeContext(context);
|
TNode<NativeContext> native_context = LoadNativeContext(context);
|
||||||
TNode<Map> map = LoadSlowObjectWithNullPrototypeMap(native_context);
|
TNode<Map> map = LoadSlowObjectWithNullPrototypeMap(native_context);
|
||||||
TNode<HeapObject> properties;
|
TNode<HeapObject> properties;
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
properties = AllocateSwissNameDictionary(num_properties);
|
properties = AllocateSwissNameDictionary(num_properties);
|
||||||
} else {
|
} else {
|
||||||
properties =
|
properties =
|
||||||
|
@ -1723,7 +1723,7 @@ TNode<HeapObject> CodeStubAssembler::LoadSlowProperties(
|
|||||||
CSA_SLOW_ASSERT(this, IsDictionaryMap(LoadMap(object)));
|
CSA_SLOW_ASSERT(this, IsDictionaryMap(LoadMap(object)));
|
||||||
TNode<Object> properties = LoadJSReceiverPropertiesOrHash(object);
|
TNode<Object> properties = LoadJSReceiverPropertiesOrHash(object);
|
||||||
NodeGenerator<HeapObject> make_empty = [=]() -> TNode<HeapObject> {
|
NodeGenerator<HeapObject> make_empty = [=]() -> TNode<HeapObject> {
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
return EmptySwissPropertyDictionaryConstant();
|
return EmptySwissPropertyDictionaryConstant();
|
||||||
} else {
|
} else {
|
||||||
return EmptyPropertyDictionaryConstant();
|
return EmptyPropertyDictionaryConstant();
|
||||||
@ -1731,7 +1731,7 @@ TNode<HeapObject> CodeStubAssembler::LoadSlowProperties(
|
|||||||
};
|
};
|
||||||
NodeGenerator<HeapObject> cast_properties = [=] {
|
NodeGenerator<HeapObject> cast_properties = [=] {
|
||||||
TNode<HeapObject> dict = CAST(properties);
|
TNode<HeapObject> dict = CAST(properties);
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
CSA_ASSERT(this, Word32Or(IsSwissNameDictionary(dict),
|
CSA_ASSERT(this, Word32Or(IsSwissNameDictionary(dict),
|
||||||
IsGlobalDictionary(dict)));
|
IsGlobalDictionary(dict)));
|
||||||
} else {
|
} else {
|
||||||
@ -1923,7 +1923,7 @@ TNode<IntPtrT> CodeStubAssembler::LoadJSReceiverIdentityHash(
|
|||||||
|
|
||||||
GotoIf(InstanceTypeEqual(properties_instance_type, PROPERTY_ARRAY_TYPE),
|
GotoIf(InstanceTypeEqual(properties_instance_type, PROPERTY_ARRAY_TYPE),
|
||||||
&if_property_array);
|
&if_property_array);
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
GotoIf(
|
GotoIf(
|
||||||
InstanceTypeEqual(properties_instance_type, SWISS_NAME_DICTIONARY_TYPE),
|
InstanceTypeEqual(properties_instance_type, SWISS_NAME_DICTIONARY_TYPE),
|
||||||
&if_swiss_property_dictionary);
|
&if_swiss_property_dictionary);
|
||||||
@ -1950,7 +1950,7 @@ TNode<IntPtrT> CodeStubAssembler::LoadJSReceiverIdentityHash(
|
|||||||
var_hash = Signed(DecodeWord<PropertyArray::HashField>(length_and_hash));
|
var_hash = Signed(DecodeWord<PropertyArray::HashField>(length_and_hash));
|
||||||
Goto(&done);
|
Goto(&done);
|
||||||
}
|
}
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
BIND(&if_swiss_property_dictionary);
|
BIND(&if_swiss_property_dictionary);
|
||||||
{
|
{
|
||||||
var_hash = Signed(
|
var_hash = Signed(
|
||||||
@ -14064,7 +14064,7 @@ TNode<Map> CodeStubAssembler::CheckEnumCache(TNode<JSReceiver> receiver,
|
|||||||
TNode<Smi> length;
|
TNode<Smi> length;
|
||||||
TNode<HeapObject> properties = LoadSlowProperties(receiver);
|
TNode<HeapObject> properties = LoadSlowProperties(receiver);
|
||||||
|
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
CSA_ASSERT(this, Word32Or(IsSwissNameDictionary(properties),
|
CSA_ASSERT(this, Word32Or(IsSwissNameDictionary(properties),
|
||||||
IsGlobalDictionary(properties)));
|
IsGlobalDictionary(properties)));
|
||||||
|
|
||||||
|
@ -113,10 +113,10 @@ STATIC_ASSERT(V8_DEFAULT_STACK_SIZE_KB* KB +
|
|||||||
const size_t kShortBuiltinCallsOldSpaceSizeThreshold = size_t{2} * GB;
|
const size_t kShortBuiltinCallsOldSpaceSizeThreshold = size_t{2} * GB;
|
||||||
|
|
||||||
// Determine whether dict mode prototypes feature is enabled.
|
// Determine whether dict mode prototypes feature is enabled.
|
||||||
#ifdef V8_DICT_MODE_PROTOTYPES
|
#ifdef V8_ENABLE_SWISS_NAME_DICTIONARY
|
||||||
#define V8_DICT_MODE_PROTOTYPES_BOOL true
|
#define V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL true
|
||||||
#else
|
#else
|
||||||
#define V8_DICT_MODE_PROTOTYPES_BOOL false
|
#define V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL false
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Determine whether dict property constness tracking feature is enabled.
|
// Determine whether dict property constness tracking feature is enabled.
|
||||||
|
@ -670,7 +670,7 @@ bool AccessInfoFactory::TryLoadPropertyDetails(
|
|||||||
}
|
}
|
||||||
|
|
||||||
Handle<JSObject> holder = maybe_holder.ToHandleChecked();
|
Handle<JSObject> holder = maybe_holder.ToHandleChecked();
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
SwissNameDictionary dict = holder->property_dictionary_swiss();
|
SwissNameDictionary dict = holder->property_dictionary_swiss();
|
||||||
*index_out = dict.FindEntry(isolate(), name);
|
*index_out = dict.FindEntry(isolate(), name);
|
||||||
if (index_out->is_found()) {
|
if (index_out->is_found()) {
|
||||||
|
@ -202,7 +202,7 @@ class ConstantInDictionaryPrototypeChainDependency final
|
|||||||
CHECK(!object.HasFastProperties());
|
CHECK(!object.HasFastProperties());
|
||||||
|
|
||||||
ValidationResult result =
|
ValidationResult result =
|
||||||
V8_DICT_MODE_PROTOTYPES_BOOL
|
V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL
|
||||||
? try_load(object.property_dictionary_swiss())
|
? try_load(object.property_dictionary_swiss())
|
||||||
: try_load(object.property_dictionary());
|
: try_load(object.property_dictionary());
|
||||||
|
|
||||||
|
@ -1754,7 +1754,7 @@ void JSObject::IncrementSpillStatistics(Isolate* isolate,
|
|||||||
info->number_of_slow_used_properties_ += dict.NumberOfElements();
|
info->number_of_slow_used_properties_ += dict.NumberOfElements();
|
||||||
info->number_of_slow_unused_properties_ +=
|
info->number_of_slow_unused_properties_ +=
|
||||||
dict.Capacity() - dict.NumberOfElements();
|
dict.Capacity() - dict.NumberOfElements();
|
||||||
} else if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
} else if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
SwissNameDictionary dict = property_dictionary_swiss();
|
SwissNameDictionary dict = property_dictionary_swiss();
|
||||||
info->number_of_slow_used_properties_ += dict.NumberOfElements();
|
info->number_of_slow_used_properties_ += dict.NumberOfElements();
|
||||||
info->number_of_slow_unused_properties_ +=
|
info->number_of_slow_unused_properties_ +=
|
||||||
|
@ -315,7 +315,7 @@ bool JSObject::PrintProperties(std::ostream& os) { // NOLINT
|
|||||||
} else if (IsJSGlobalObject()) {
|
} else if (IsJSGlobalObject()) {
|
||||||
PrintDictionaryContents(
|
PrintDictionaryContents(
|
||||||
os, JSGlobalObject::cast(*this).global_dictionary(kAcquireLoad));
|
os, JSGlobalObject::cast(*this).global_dictionary(kAcquireLoad));
|
||||||
} else if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
} else if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
PrintDictionaryContents(os, property_dictionary_swiss());
|
PrintDictionaryContents(os, property_dictionary_swiss());
|
||||||
} else {
|
} else {
|
||||||
PrintDictionaryContents(os, property_dictionary());
|
PrintDictionaryContents(os, property_dictionary());
|
||||||
|
@ -1634,7 +1634,7 @@ Handle<JSObject> Factory::CopyJSObjectWithAllocationSite(
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Handle<Object> copied_properties;
|
Handle<Object> copied_properties;
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
copied_properties = SwissNameDictionary::ShallowCopy(
|
copied_properties = SwissNameDictionary::ShallowCopy(
|
||||||
isolate(), handle(source->property_dictionary_swiss(), isolate()));
|
isolate(), handle(source->property_dictionary_swiss(), isolate()));
|
||||||
} else {
|
} else {
|
||||||
@ -2222,7 +2222,7 @@ Handle<JSObject> Factory::NewSlowJSObjectFromMap(
|
|||||||
Handle<AllocationSite> allocation_site) {
|
Handle<AllocationSite> allocation_site) {
|
||||||
DCHECK(map->is_dictionary_map());
|
DCHECK(map->is_dictionary_map());
|
||||||
Handle<HeapObject> object_properties;
|
Handle<HeapObject> object_properties;
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
object_properties = NewSwissNameDictionary(capacity, allocation);
|
object_properties = NewSwissNameDictionary(capacity, allocation);
|
||||||
} else {
|
} else {
|
||||||
object_properties = NameDictionary::New(isolate(), capacity);
|
object_properties = NameDictionary::New(isolate(), capacity);
|
||||||
@ -2236,9 +2236,10 @@ Handle<JSObject> Factory::NewSlowJSObjectFromMap(
|
|||||||
Handle<JSObject> Factory::NewSlowJSObjectWithPropertiesAndElements(
|
Handle<JSObject> Factory::NewSlowJSObjectWithPropertiesAndElements(
|
||||||
Handle<HeapObject> prototype, Handle<HeapObject> properties,
|
Handle<HeapObject> prototype, Handle<HeapObject> properties,
|
||||||
Handle<FixedArrayBase> elements) {
|
Handle<FixedArrayBase> elements) {
|
||||||
DCHECK_IMPLIES(V8_DICT_MODE_PROTOTYPES_BOOL,
|
DCHECK_IMPLIES(V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL,
|
||||||
properties->IsSwissNameDictionary());
|
properties->IsSwissNameDictionary());
|
||||||
DCHECK_IMPLIES(!V8_DICT_MODE_PROTOTYPES_BOOL, properties->IsNameDictionary());
|
DCHECK_IMPLIES(!V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL,
|
||||||
|
properties->IsNameDictionary());
|
||||||
|
|
||||||
Handle<Map> object_map = isolate()->slow_object_with_object_prototype_map();
|
Handle<Map> object_map = isolate()->slow_object_with_object_prototype_map();
|
||||||
if (object_map->prototype() != *prototype) {
|
if (object_map->prototype() != *prototype) {
|
||||||
|
@ -5193,7 +5193,7 @@ void Genesis::TransferNamedProperties(Handle<JSObject> from,
|
|||||||
JSObject::AddProperty(isolate(), to, key, value, details.attributes());
|
JSObject::AddProperty(isolate(), to, key, value, details.attributes());
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
} else if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
// Copy all keys and values in enumeration order.
|
// Copy all keys and values in enumeration order.
|
||||||
Handle<SwissNameDictionary> properties = Handle<SwissNameDictionary>(
|
Handle<SwissNameDictionary> properties = Handle<SwissNameDictionary>(
|
||||||
from->property_dictionary_swiss(), isolate());
|
from->property_dictionary_swiss(), isolate());
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
namespace v8 {
|
namespace v8 {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
#ifdef V8_DICT_MODE_PROTOTYPES
|
#ifdef V8_ENABLE_SWISS_NAME_DICTIONARY
|
||||||
class SwissNameDictionary;
|
class SwissNameDictionary;
|
||||||
using PropertyDictionary = SwissNameDictionary;
|
using PropertyDictionary = SwissNameDictionary;
|
||||||
#else
|
#else
|
||||||
|
@ -604,7 +604,7 @@ void JSReceiver::initialize_properties(Isolate* isolate) {
|
|||||||
DCHECK(!ObjectInYoungGeneration(roots.empty_property_dictionary()));
|
DCHECK(!ObjectInYoungGeneration(roots.empty_property_dictionary()));
|
||||||
DCHECK(!ObjectInYoungGeneration(roots.empty_ordered_property_dictionary()));
|
DCHECK(!ObjectInYoungGeneration(roots.empty_ordered_property_dictionary()));
|
||||||
if (map(isolate).is_dictionary_map()) {
|
if (map(isolate).is_dictionary_map()) {
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
WRITE_FIELD(*this, kPropertiesOrHashOffset,
|
WRITE_FIELD(*this, kPropertiesOrHashOffset,
|
||||||
roots.empty_swiss_property_dictionary());
|
roots.empty_swiss_property_dictionary());
|
||||||
} else {
|
} else {
|
||||||
@ -628,7 +628,7 @@ DEF_GETTER(JSReceiver, HasFastProperties, bool) {
|
|||||||
DEF_GETTER(JSReceiver, property_dictionary, NameDictionary) {
|
DEF_GETTER(JSReceiver, property_dictionary, NameDictionary) {
|
||||||
DCHECK(!IsJSGlobalObject(isolate));
|
DCHECK(!IsJSGlobalObject(isolate));
|
||||||
DCHECK(!HasFastProperties(isolate));
|
DCHECK(!HasFastProperties(isolate));
|
||||||
DCHECK(!V8_DICT_MODE_PROTOTYPES_BOOL);
|
DCHECK(!V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL);
|
||||||
|
|
||||||
// Can't use ReadOnlyRoots(isolate) as this isolate could be produced by
|
// Can't use ReadOnlyRoots(isolate) as this isolate could be produced by
|
||||||
// i::GetIsolateForPtrCompr(HeapObject).
|
// i::GetIsolateForPtrCompr(HeapObject).
|
||||||
@ -642,7 +642,7 @@ DEF_GETTER(JSReceiver, property_dictionary, NameDictionary) {
|
|||||||
DEF_GETTER(JSReceiver, property_dictionary_swiss, SwissNameDictionary) {
|
DEF_GETTER(JSReceiver, property_dictionary_swiss, SwissNameDictionary) {
|
||||||
DCHECK(!IsJSGlobalObject(isolate));
|
DCHECK(!IsJSGlobalObject(isolate));
|
||||||
DCHECK(!HasFastProperties(isolate));
|
DCHECK(!HasFastProperties(isolate));
|
||||||
DCHECK(V8_DICT_MODE_PROTOTYPES_BOOL);
|
DCHECK(V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL);
|
||||||
|
|
||||||
// Can't use ReadOnlyRoots(isolate) as this isolate could be produced by
|
// Can't use ReadOnlyRoots(isolate) as this isolate could be produced by
|
||||||
// i::GetIsolateForPtrCompr(HeapObject).
|
// i::GetIsolateForPtrCompr(HeapObject).
|
||||||
|
@ -359,7 +359,7 @@ Maybe<bool> JSReceiver::SetOrCopyDataProperties(
|
|||||||
source_length = JSGlobalObject::cast(*from)
|
source_length = JSGlobalObject::cast(*from)
|
||||||
.global_dictionary(kAcquireLoad)
|
.global_dictionary(kAcquireLoad)
|
||||||
.NumberOfEnumerableProperties();
|
.NumberOfEnumerableProperties();
|
||||||
} else if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
} else if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
source_length =
|
source_length =
|
||||||
from->property_dictionary_swiss().NumberOfEnumerableProperties();
|
from->property_dictionary_swiss().NumberOfEnumerableProperties();
|
||||||
} else {
|
} else {
|
||||||
@ -662,7 +662,7 @@ Object SetHashAndUpdateProperties(HeapObject properties, int hash) {
|
|||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
DCHECK(properties.IsSwissNameDictionary());
|
DCHECK(properties.IsSwissNameDictionary());
|
||||||
SwissNameDictionary::cast(properties).SetHash(hash);
|
SwissNameDictionary::cast(properties).SetHash(hash);
|
||||||
} else {
|
} else {
|
||||||
@ -682,12 +682,13 @@ int GetIdentityHashHelper(JSReceiver object) {
|
|||||||
if (properties.IsPropertyArray()) {
|
if (properties.IsPropertyArray()) {
|
||||||
return PropertyArray::cast(properties).Hash();
|
return PropertyArray::cast(properties).Hash();
|
||||||
}
|
}
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL && properties.IsSwissNameDictionary()) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL &&
|
||||||
|
properties.IsSwissNameDictionary()) {
|
||||||
return SwissNameDictionary::cast(properties).Hash();
|
return SwissNameDictionary::cast(properties).Hash();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (properties.IsNameDictionary()) {
|
if (properties.IsNameDictionary()) {
|
||||||
DCHECK(!V8_DICT_MODE_PROTOTYPES_BOOL);
|
DCHECK(!V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL);
|
||||||
return NameDictionary::cast(properties).Hash();
|
return NameDictionary::cast(properties).Hash();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -786,7 +787,7 @@ void JSReceiver::DeleteNormalizedProperty(Handle<JSReceiver> object,
|
|||||||
|
|
||||||
cell->ClearAndInvalidate(ReadOnlyRoots(isolate));
|
cell->ClearAndInvalidate(ReadOnlyRoots(isolate));
|
||||||
} else {
|
} else {
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
Handle<SwissNameDictionary> dictionary(
|
Handle<SwissNameDictionary> dictionary(
|
||||||
object->property_dictionary_swiss(), isolate);
|
object->property_dictionary_swiss(), isolate);
|
||||||
|
|
||||||
@ -2136,7 +2137,7 @@ MaybeHandle<JSObject> JSObject::New(Handle<JSFunction> constructor,
|
|||||||
ASSIGN_RETURN_ON_EXCEPTION(
|
ASSIGN_RETURN_ON_EXCEPTION(
|
||||||
isolate, initial_map,
|
isolate, initial_map,
|
||||||
JSFunction::GetDerivedMap(isolate, constructor, new_target), JSObject);
|
JSFunction::GetDerivedMap(isolate, constructor, new_target), JSObject);
|
||||||
int initial_capacity = V8_DICT_MODE_PROTOTYPES_BOOL
|
int initial_capacity = V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL
|
||||||
? SwissNameDictionary::kInitialCapacity
|
? SwissNameDictionary::kInitialCapacity
|
||||||
: NameDictionary::kInitialCapacity;
|
: NameDictionary::kInitialCapacity;
|
||||||
Handle<JSObject> result = isolate->factory()->NewFastOrSlowJSObjectFromMap(
|
Handle<JSObject> result = isolate->factory()->NewFastOrSlowJSObjectFromMap(
|
||||||
@ -2468,7 +2469,7 @@ void JSObject::SetNormalizedProperty(Handle<JSObject> object, Handle<Name> name,
|
|||||||
DCHECK_EQ(dictionary->CellAt(entry).value(), *value);
|
DCHECK_EQ(dictionary->CellAt(entry).value(), *value);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
Handle<SwissNameDictionary> dictionary(
|
Handle<SwissNameDictionary> dictionary(
|
||||||
object->property_dictionary_swiss(), isolate);
|
object->property_dictionary_swiss(), isolate);
|
||||||
InternalIndex entry = dictionary->FindEntry(isolate, *name);
|
InternalIndex entry = dictionary->FindEntry(isolate, *name);
|
||||||
@ -2968,7 +2969,7 @@ void MigrateFastToSlow(Isolate* isolate, Handle<JSObject> object,
|
|||||||
property_count += expected_additional_properties;
|
property_count += expected_additional_properties;
|
||||||
} else {
|
} else {
|
||||||
// Make space for two more properties.
|
// Make space for two more properties.
|
||||||
int initial_capacity = V8_DICT_MODE_PROTOTYPES_BOOL
|
int initial_capacity = V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL
|
||||||
? SwissNameDictionary::kInitialCapacity
|
? SwissNameDictionary::kInitialCapacity
|
||||||
: NameDictionary::kInitialCapacity;
|
: NameDictionary::kInitialCapacity;
|
||||||
property_count += initial_capacity;
|
property_count += initial_capacity;
|
||||||
@ -2976,7 +2977,7 @@ void MigrateFastToSlow(Isolate* isolate, Handle<JSObject> object,
|
|||||||
|
|
||||||
Handle<NameDictionary> dictionary;
|
Handle<NameDictionary> dictionary;
|
||||||
Handle<SwissNameDictionary> ord_dictionary;
|
Handle<SwissNameDictionary> ord_dictionary;
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
ord_dictionary = isolate->factory()->NewSwissNameDictionary(property_count);
|
ord_dictionary = isolate->factory()->NewSwissNameDictionary(property_count);
|
||||||
} else {
|
} else {
|
||||||
dictionary = isolate->factory()->NewNameDictionary(property_count);
|
dictionary = isolate->factory()->NewNameDictionary(property_count);
|
||||||
@ -3011,7 +3012,7 @@ void MigrateFastToSlow(Isolate* isolate, Handle<JSObject> object,
|
|||||||
: PropertyConstness::kMutable;
|
: PropertyConstness::kMutable;
|
||||||
PropertyDetails d(details.kind(), details.attributes(), constness);
|
PropertyDetails d(details.kind(), details.attributes(), constness);
|
||||||
|
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
ord_dictionary =
|
ord_dictionary =
|
||||||
SwissNameDictionary::Add(isolate, ord_dictionary, key, value, d);
|
SwissNameDictionary::Add(isolate, ord_dictionary, key, value, d);
|
||||||
} else {
|
} else {
|
||||||
@ -3019,7 +3020,7 @@ void MigrateFastToSlow(Isolate* isolate, Handle<JSObject> object,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (!V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
// Copy the next enumeration index from instance descriptor.
|
// Copy the next enumeration index from instance descriptor.
|
||||||
dictionary->set_next_enumeration_index(real_size + 1);
|
dictionary->set_next_enumeration_index(real_size + 1);
|
||||||
}
|
}
|
||||||
@ -3044,7 +3045,7 @@ void MigrateFastToSlow(Isolate* isolate, Handle<JSObject> object,
|
|||||||
// the left-over space to avoid races with the sweeper thread.
|
// the left-over space to avoid races with the sweeper thread.
|
||||||
object->synchronized_set_map(*new_map);
|
object->synchronized_set_map(*new_map);
|
||||||
|
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
object->SetProperties(*ord_dictionary);
|
object->SetProperties(*ord_dictionary);
|
||||||
} else {
|
} else {
|
||||||
object->SetProperties(*dictionary);
|
object->SetProperties(*dictionary);
|
||||||
@ -3421,7 +3422,7 @@ void JSObject::MigrateSlowToFast(Handle<JSObject> object,
|
|||||||
Handle<NameDictionary> dictionary;
|
Handle<NameDictionary> dictionary;
|
||||||
Handle<SwissNameDictionary> swiss_dictionary;
|
Handle<SwissNameDictionary> swiss_dictionary;
|
||||||
int number_of_elements;
|
int number_of_elements;
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
swiss_dictionary = handle(object->property_dictionary_swiss(), isolate);
|
swiss_dictionary = handle(object->property_dictionary_swiss(), isolate);
|
||||||
number_of_elements = swiss_dictionary->NumberOfElements();
|
number_of_elements = swiss_dictionary->NumberOfElements();
|
||||||
} else {
|
} else {
|
||||||
@ -3435,7 +3436,7 @@ void JSObject::MigrateSlowToFast(Handle<JSObject> object,
|
|||||||
|
|
||||||
Handle<FixedArray> iteration_order;
|
Handle<FixedArray> iteration_order;
|
||||||
int iteration_length;
|
int iteration_length;
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
// |iteration_order| remains empty handle, we don't need it.
|
// |iteration_order| remains empty handle, we don't need it.
|
||||||
iteration_length = swiss_dictionary->UsedCapacity();
|
iteration_length = swiss_dictionary->UsedCapacity();
|
||||||
} else {
|
} else {
|
||||||
@ -3449,7 +3450,7 @@ void JSObject::MigrateSlowToFast(Handle<JSObject> object,
|
|||||||
ReadOnlyRoots roots(isolate);
|
ReadOnlyRoots roots(isolate);
|
||||||
for (int i = 0; i < iteration_length; i++) {
|
for (int i = 0; i < iteration_length; i++) {
|
||||||
PropertyKind kind;
|
PropertyKind kind;
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
InternalIndex index(swiss_dictionary->EntryForEnumerationIndex(i));
|
InternalIndex index(swiss_dictionary->EntryForEnumerationIndex(i));
|
||||||
Object key = swiss_dictionary->KeyAt(index);
|
Object key = swiss_dictionary->KeyAt(index);
|
||||||
if (!SwissNameDictionary::IsKey(roots, key)) {
|
if (!SwissNameDictionary::IsKey(roots, key)) {
|
||||||
@ -3524,7 +3525,7 @@ void JSObject::MigrateSlowToFast(Handle<JSObject> object,
|
|||||||
Object value;
|
Object value;
|
||||||
PropertyDetails details = PropertyDetails::Empty();
|
PropertyDetails details = PropertyDetails::Empty();
|
||||||
|
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
InternalIndex index(swiss_dictionary->EntryForEnumerationIndex(i));
|
InternalIndex index(swiss_dictionary->EntryForEnumerationIndex(i));
|
||||||
Object key_obj = swiss_dictionary->KeyAt(index);
|
Object key_obj = swiss_dictionary->KeyAt(index);
|
||||||
if (!SwissNameDictionary::IsKey(roots, key_obj)) {
|
if (!SwissNameDictionary::IsKey(roots, key_obj)) {
|
||||||
@ -3797,7 +3798,7 @@ bool TestPropertiesIntegrityLevel(JSObject object, PropertyAttributes level) {
|
|||||||
return TestFastPropertiesIntegrityLevel(object.map(), level);
|
return TestFastPropertiesIntegrityLevel(object.map(), level);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
return TestDictionaryPropertiesIntegrityLevel(
|
return TestDictionaryPropertiesIntegrityLevel(
|
||||||
object.property_dictionary_swiss(), object.GetReadOnlyRoots(), level);
|
object.property_dictionary_swiss(), object.GetReadOnlyRoots(), level);
|
||||||
} else {
|
} else {
|
||||||
@ -4102,7 +4103,7 @@ Maybe<bool> JSObject::PreventExtensionsWithTransition(
|
|||||||
isolate);
|
isolate);
|
||||||
JSObject::ApplyAttributesToDictionary(isolate, roots, dictionary,
|
JSObject::ApplyAttributesToDictionary(isolate, roots, dictionary,
|
||||||
attrs);
|
attrs);
|
||||||
} else if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
} else if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
Handle<SwissNameDictionary> dictionary(
|
Handle<SwissNameDictionary> dictionary(
|
||||||
object->property_dictionary_swiss(), isolate);
|
object->property_dictionary_swiss(), isolate);
|
||||||
JSObject::ApplyAttributesToDictionary(isolate, roots, dictionary,
|
JSObject::ApplyAttributesToDictionary(isolate, roots, dictionary,
|
||||||
@ -4165,7 +4166,7 @@ Handle<Object> JSObject::DictionaryPropertyAt(Handle<JSObject> object,
|
|||||||
InternalIndex dict_index) {
|
InternalIndex dict_index) {
|
||||||
Isolate* isolate = object->GetIsolate();
|
Isolate* isolate = object->GetIsolate();
|
||||||
|
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
SwissNameDictionary dict = object->property_dictionary_swiss();
|
SwissNameDictionary dict = object->property_dictionary_swiss();
|
||||||
return handle(dict.ValueAt(dict_index), isolate);
|
return handle(dict.ValueAt(dict_index), isolate);
|
||||||
} else {
|
} else {
|
||||||
@ -4363,7 +4364,7 @@ Object JSObject::SlowReverseLookup(Object value) {
|
|||||||
return JSGlobalObject::cast(*this)
|
return JSGlobalObject::cast(*this)
|
||||||
.global_dictionary(kAcquireLoad)
|
.global_dictionary(kAcquireLoad)
|
||||||
.SlowReverseLookup(value);
|
.SlowReverseLookup(value);
|
||||||
} else if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
} else if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
return property_dictionary_swiss().SlowReverseLookup(GetIsolate(), value);
|
return property_dictionary_swiss().SlowReverseLookup(GetIsolate(), value);
|
||||||
} else {
|
} else {
|
||||||
return property_dictionary().SlowReverseLookup(value);
|
return property_dictionary().SlowReverseLookup(value);
|
||||||
@ -4464,7 +4465,7 @@ void JSObject::OptimizeAsPrototype(Handle<JSObject> object,
|
|||||||
dict.DetailsAtPut(index, details);
|
dict.DetailsAtPut(index, details);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
make_constant(object->property_dictionary_swiss());
|
make_constant(object->property_dictionary_swiss());
|
||||||
} else {
|
} else {
|
||||||
make_constant(object->property_dictionary());
|
make_constant(object->property_dictionary());
|
||||||
|
@ -44,12 +44,12 @@ class JSReceiver : public HeapObject {
|
|||||||
// map.
|
// map.
|
||||||
DECL_GETTER(property_array, PropertyArray)
|
DECL_GETTER(property_array, PropertyArray)
|
||||||
|
|
||||||
// Gets slow properties for non-global objects (if v8_dict_mode_prototypes is
|
// Gets slow properties for non-global objects (if
|
||||||
// not set).
|
// v8_enable_swiss_name_dictionary is not set).
|
||||||
DECL_GETTER(property_dictionary, NameDictionary)
|
DECL_GETTER(property_dictionary, NameDictionary)
|
||||||
|
|
||||||
// Gets slow properties for non-global objects (if v8_dict_mode_prototypes is
|
// Gets slow properties for non-global objects (if
|
||||||
// set).
|
// v8_enable_swiss_name_dictionary is set).
|
||||||
DECL_GETTER(property_dictionary_swiss, SwissNameDictionary)
|
DECL_GETTER(property_dictionary_swiss, SwissNameDictionary)
|
||||||
|
|
||||||
// Sets the properties backing store and makes sure any existing hash is moved
|
// Sets the properties backing store and makes sure any existing hash is moved
|
||||||
|
@ -65,7 +65,7 @@ Handle<JSRegExpResultIndices> JSRegExpResultIndices::BuildIndices(
|
|||||||
Handle<FixedArray> names(Handle<FixedArray>::cast(maybe_names));
|
Handle<FixedArray> names(Handle<FixedArray>::cast(maybe_names));
|
||||||
int num_names = names->length() >> 1;
|
int num_names = names->length() >> 1;
|
||||||
Handle<HeapObject> group_names;
|
Handle<HeapObject> group_names;
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
group_names = isolate->factory()->NewSwissNameDictionary(num_names);
|
group_names = isolate->factory()->NewSwissNameDictionary(num_names);
|
||||||
} else {
|
} else {
|
||||||
group_names = isolate->factory()->NewNameDictionary(num_names);
|
group_names = isolate->factory()->NewNameDictionary(num_names);
|
||||||
@ -81,7 +81,7 @@ Handle<JSRegExpResultIndices> JSRegExpResultIndices::BuildIndices(
|
|||||||
if (!capture_indices->IsUndefined(isolate)) {
|
if (!capture_indices->IsUndefined(isolate)) {
|
||||||
capture_indices = Handle<JSArray>::cast(capture_indices);
|
capture_indices = Handle<JSArray>::cast(capture_indices);
|
||||||
}
|
}
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
group_names = SwissNameDictionary::Add(
|
group_names = SwissNameDictionary::Add(
|
||||||
isolate, Handle<SwissNameDictionary>::cast(group_names), name,
|
isolate, Handle<SwissNameDictionary>::cast(group_names), name,
|
||||||
capture_indices, PropertyDetails::Empty());
|
capture_indices, PropertyDetails::Empty());
|
||||||
|
@ -1003,7 +1003,7 @@ Maybe<bool> KeyAccumulator::CollectOwnPropertyNames(Handle<JSReceiver> receiver,
|
|||||||
enum_keys = GetOwnEnumPropertyDictionaryKeys(
|
enum_keys = GetOwnEnumPropertyDictionaryKeys(
|
||||||
isolate_, mode_, this, object,
|
isolate_, mode_, this, object,
|
||||||
JSGlobalObject::cast(*object).global_dictionary(kAcquireLoad));
|
JSGlobalObject::cast(*object).global_dictionary(kAcquireLoad));
|
||||||
} else if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
} else if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
enum_keys = GetOwnEnumPropertyDictionaryKeys(
|
enum_keys = GetOwnEnumPropertyDictionaryKeys(
|
||||||
isolate_, mode_, this, object, object->property_dictionary_swiss());
|
isolate_, mode_, this, object, object->property_dictionary_swiss());
|
||||||
} else {
|
} else {
|
||||||
@ -1042,7 +1042,7 @@ Maybe<bool> KeyAccumulator::CollectOwnPropertyNames(Handle<JSReceiver> receiver,
|
|||||||
handle(JSGlobalObject::cast(*object).global_dictionary(kAcquireLoad),
|
handle(JSGlobalObject::cast(*object).global_dictionary(kAcquireLoad),
|
||||||
isolate_),
|
isolate_),
|
||||||
this));
|
this));
|
||||||
} else if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
} else if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
RETURN_NOTHING_IF_NOT_SUCCESSFUL(CollectKeysFromDictionary(
|
RETURN_NOTHING_IF_NOT_SUCCESSFUL(CollectKeysFromDictionary(
|
||||||
handle(object->property_dictionary_swiss(), isolate_), this));
|
handle(object->property_dictionary_swiss(), isolate_), this));
|
||||||
} else {
|
} else {
|
||||||
@ -1067,7 +1067,7 @@ ExceptionStatus KeyAccumulator::CollectPrivateNames(Handle<JSReceiver> receiver,
|
|||||||
handle(JSGlobalObject::cast(*object).global_dictionary(kAcquireLoad),
|
handle(JSGlobalObject::cast(*object).global_dictionary(kAcquireLoad),
|
||||||
isolate_),
|
isolate_),
|
||||||
this));
|
this));
|
||||||
} else if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
} else if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
RETURN_FAILURE_IF_NOT_SUCCESSFUL(CollectKeysFromDictionary(
|
RETURN_FAILURE_IF_NOT_SUCCESSFUL(CollectKeysFromDictionary(
|
||||||
handle(object->property_dictionary_swiss(), isolate_), this));
|
handle(object->property_dictionary_swiss(), isolate_), this));
|
||||||
} else {
|
} else {
|
||||||
@ -1152,7 +1152,7 @@ Handle<FixedArray> KeyAccumulator::GetOwnEnumPropertyKeys(
|
|||||||
return GetOwnEnumPropertyDictionaryKeys(
|
return GetOwnEnumPropertyDictionaryKeys(
|
||||||
isolate, KeyCollectionMode::kOwnOnly, nullptr, object,
|
isolate, KeyCollectionMode::kOwnOnly, nullptr, object,
|
||||||
JSGlobalObject::cast(*object).global_dictionary(kAcquireLoad));
|
JSGlobalObject::cast(*object).global_dictionary(kAcquireLoad));
|
||||||
} else if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
} else if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
return GetOwnEnumPropertyDictionaryKeys(
|
return GetOwnEnumPropertyDictionaryKeys(
|
||||||
isolate, KeyCollectionMode::kOwnOnly, nullptr, object,
|
isolate, KeyCollectionMode::kOwnOnly, nullptr, object,
|
||||||
object->property_dictionary_swiss());
|
object->property_dictionary_swiss());
|
||||||
@ -1186,7 +1186,7 @@ Maybe<bool> KeyAccumulator::CollectOwnJSProxyKeys(Handle<JSReceiver> receiver,
|
|||||||
Handle<JSProxy> proxy) {
|
Handle<JSProxy> proxy) {
|
||||||
STACK_CHECK(isolate_, Nothing<bool>());
|
STACK_CHECK(isolate_, Nothing<bool>());
|
||||||
if (filter_ == PRIVATE_NAMES_ONLY) {
|
if (filter_ == PRIVATE_NAMES_ONLY) {
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
RETURN_NOTHING_IF_NOT_SUCCESSFUL(CollectKeysFromDictionary(
|
RETURN_NOTHING_IF_NOT_SUCCESSFUL(CollectKeysFromDictionary(
|
||||||
handle(proxy->property_dictionary_swiss(), isolate_), this));
|
handle(proxy->property_dictionary_swiss(), isolate_), this));
|
||||||
} else {
|
} else {
|
||||||
|
@ -404,7 +404,7 @@ class ObjectDescriptor {
|
|||||||
void CreateTemplates(LocalIsolate* isolate) {
|
void CreateTemplates(LocalIsolate* isolate) {
|
||||||
auto* factory = isolate->factory();
|
auto* factory = isolate->factory();
|
||||||
descriptor_array_template_ = factory->empty_descriptor_array();
|
descriptor_array_template_ = factory->empty_descriptor_array();
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
properties_dictionary_template_ =
|
properties_dictionary_template_ =
|
||||||
factory->empty_swiss_property_dictionary();
|
factory->empty_swiss_property_dictionary();
|
||||||
} else {
|
} else {
|
||||||
@ -414,7 +414,7 @@ class ObjectDescriptor {
|
|||||||
if (HasDictionaryProperties()) {
|
if (HasDictionaryProperties()) {
|
||||||
int need_space_for =
|
int need_space_for =
|
||||||
property_count_ + computed_count_ + property_slack_;
|
property_count_ + computed_count_ + property_slack_;
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
properties_dictionary_template_ =
|
properties_dictionary_template_ =
|
||||||
isolate->factory()->NewSwissNameDictionary(need_space_for,
|
isolate->factory()->NewSwissNameDictionary(need_space_for,
|
||||||
AllocationType::kOld);
|
AllocationType::kOld);
|
||||||
@ -449,11 +449,12 @@ class ObjectDescriptor {
|
|||||||
DCHECK(!value->IsAccessorPair());
|
DCHECK(!value->IsAccessorPair());
|
||||||
if (HasDictionaryProperties()) {
|
if (HasDictionaryProperties()) {
|
||||||
PropertyKind kind = is_accessor ? i::kAccessor : i::kData;
|
PropertyKind kind = is_accessor ? i::kAccessor : i::kData;
|
||||||
int enum_order = V8_DICT_MODE_PROTOTYPES_BOOL ? kDummyEnumerationIndex
|
int enum_order = V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL
|
||||||
: next_enumeration_index_++;
|
? kDummyEnumerationIndex
|
||||||
|
: next_enumeration_index_++;
|
||||||
PropertyDetails details(kind, attribs, PropertyCellType::kNoCell,
|
PropertyDetails details(kind, attribs, PropertyCellType::kNoCell,
|
||||||
enum_order);
|
enum_order);
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
properties_dictionary_template_ =
|
properties_dictionary_template_ =
|
||||||
DictionaryAddNoUpdateNextEnumerationIndex(
|
DictionaryAddNoUpdateNextEnumerationIndex(
|
||||||
isolate, properties_ordered_dictionary_template(), name, value,
|
isolate, properties_ordered_dictionary_template(), name, value,
|
||||||
@ -478,7 +479,7 @@ class ObjectDescriptor {
|
|||||||
Smi value = Smi::FromInt(value_index);
|
Smi value = Smi::FromInt(value_index);
|
||||||
if (HasDictionaryProperties()) {
|
if (HasDictionaryProperties()) {
|
||||||
UpdateNextEnumerationIndex(value_index);
|
UpdateNextEnumerationIndex(value_index);
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
AddToDictionaryTemplate(isolate,
|
AddToDictionaryTemplate(isolate,
|
||||||
properties_ordered_dictionary_template(), name,
|
properties_ordered_dictionary_template(), name,
|
||||||
value_index, value_kind, value);
|
value_index, value_kind, value);
|
||||||
@ -518,7 +519,7 @@ class ObjectDescriptor {
|
|||||||
void Finalize(LocalIsolate* isolate) {
|
void Finalize(LocalIsolate* isolate) {
|
||||||
if (HasDictionaryProperties()) {
|
if (HasDictionaryProperties()) {
|
||||||
DCHECK_EQ(current_computed_index_, computed_properties_->length());
|
DCHECK_EQ(current_computed_index_, computed_properties_->length());
|
||||||
if (!V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (!V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
properties_dictionary_template()->set_next_enumeration_index(
|
properties_dictionary_template()->set_next_enumeration_index(
|
||||||
next_enumeration_index_);
|
next_enumeration_index_);
|
||||||
}
|
}
|
||||||
|
@ -381,7 +381,7 @@ void LookupIterator::PrepareForDataProperty(Handle<Object> value) {
|
|||||||
// that's only for the case that the existing map is a fast mode map.
|
// that's only for the case that the existing map is a fast mode map.
|
||||||
// Therefore, we need to perform the necessary updates to the property
|
// Therefore, we need to perform the necessary updates to the property
|
||||||
// details and the prototype validity cell directly.
|
// details and the prototype validity cell directly.
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
SwissNameDictionary dict = holder->property_dictionary_swiss();
|
SwissNameDictionary dict = holder->property_dictionary_swiss();
|
||||||
dict.DetailsAtPut(dictionary_entry(), property_details_);
|
dict.DetailsAtPut(dictionary_entry(), property_details_);
|
||||||
} else {
|
} else {
|
||||||
@ -433,7 +433,7 @@ void LookupIterator::PrepareForDataProperty(Handle<Object> value) {
|
|||||||
property_details_ =
|
property_details_ =
|
||||||
property_details_.CopyWithConstness(PropertyConstness::kMutable);
|
property_details_.CopyWithConstness(PropertyConstness::kMutable);
|
||||||
|
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
SwissNameDictionary dict = holder_obj->property_dictionary_swiss();
|
SwissNameDictionary dict = holder_obj->property_dictionary_swiss();
|
||||||
dict.DetailsAtPut(dictionary_entry(), property_details_);
|
dict.DetailsAtPut(dictionary_entry(), property_details_);
|
||||||
} else {
|
} else {
|
||||||
@ -507,7 +507,7 @@ void LookupIterator::ReconfigureDataProperty(Handle<Object> value,
|
|||||||
DCHECK_EQ(cell->value(), *value);
|
DCHECK_EQ(cell->value(), *value);
|
||||||
} else {
|
} else {
|
||||||
PropertyDetails details(kData, attributes, PropertyConstness::kMutable);
|
PropertyDetails details(kData, attributes, PropertyConstness::kMutable);
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
Handle<SwissNameDictionary> dictionary(
|
Handle<SwissNameDictionary> dictionary(
|
||||||
holder_obj->property_dictionary_swiss(isolate_), isolate());
|
holder_obj->property_dictionary_swiss(isolate_), isolate());
|
||||||
dictionary->ValueAtPut(dictionary_entry(), *value);
|
dictionary->ValueAtPut(dictionary_entry(), *value);
|
||||||
@ -650,7 +650,7 @@ void LookupIterator::ApplyTransitionToDataProperty(
|
|||||||
receiver->IsJSObject(isolate_)) {
|
receiver->IsJSObject(isolate_)) {
|
||||||
JSObject::InvalidatePrototypeChains(receiver->map(isolate_));
|
JSObject::InvalidatePrototypeChains(receiver->map(isolate_));
|
||||||
}
|
}
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
Handle<SwissNameDictionary> dictionary(
|
Handle<SwissNameDictionary> dictionary(
|
||||||
receiver->property_dictionary_swiss(isolate_), isolate_);
|
receiver->property_dictionary_swiss(isolate_), isolate_);
|
||||||
|
|
||||||
@ -855,7 +855,7 @@ Handle<Object> LookupIterator::FetchValue(
|
|||||||
result = holder->global_dictionary(isolate_, kAcquireLoad)
|
result = holder->global_dictionary(isolate_, kAcquireLoad)
|
||||||
.ValueAt(isolate_, dictionary_entry());
|
.ValueAt(isolate_, dictionary_entry());
|
||||||
} else if (!holder_->HasFastProperties(isolate_)) {
|
} else if (!holder_->HasFastProperties(isolate_)) {
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
result = holder_->property_dictionary_swiss(isolate_).ValueAt(
|
result = holder_->property_dictionary_swiss(isolate_).ValueAt(
|
||||||
dictionary_entry());
|
dictionary_entry());
|
||||||
} else {
|
} else {
|
||||||
@ -938,7 +938,7 @@ bool LookupIterator::IsConstDictValueEqualTo(Object value) const {
|
|||||||
}
|
}
|
||||||
Handle<JSReceiver> holder = GetHolder<JSReceiver>();
|
Handle<JSReceiver> holder = GetHolder<JSReceiver>();
|
||||||
Object current_value;
|
Object current_value;
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
SwissNameDictionary dict = holder->property_dictionary_swiss();
|
SwissNameDictionary dict = holder->property_dictionary_swiss();
|
||||||
current_value = dict.ValueAt(dictionary_entry());
|
current_value = dict.ValueAt(dictionary_entry());
|
||||||
} else {
|
} else {
|
||||||
@ -1036,7 +1036,7 @@ void LookupIterator::WriteDataValue(Handle<Object> value,
|
|||||||
property_details_.constness() == PropertyConstness::kConst,
|
property_details_.constness() == PropertyConstness::kConst,
|
||||||
holder->IsJSProxy(isolate_) || IsConstDictValueEqualTo(*value));
|
holder->IsJSProxy(isolate_) || IsConstDictValueEqualTo(*value));
|
||||||
|
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
SwissNameDictionary dictionary =
|
SwissNameDictionary dictionary =
|
||||||
holder->property_dictionary_swiss(isolate_);
|
holder->property_dictionary_swiss(isolate_);
|
||||||
dictionary.ValueAtPut(dictionary_entry(), *value);
|
dictionary.ValueAtPut(dictionary_entry(), *value);
|
||||||
@ -1187,7 +1187,7 @@ LookupIterator::State LookupIterator::LookupInRegularHolder(
|
|||||||
property_details_ = descriptors.GetDetails(number_);
|
property_details_ = descriptors.GetDetails(number_);
|
||||||
} else {
|
} else {
|
||||||
DCHECK_IMPLIES(holder.IsJSProxy(isolate_), name()->IsPrivate(isolate_));
|
DCHECK_IMPLIES(holder.IsJSProxy(isolate_), name()->IsPrivate(isolate_));
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
SwissNameDictionary dict = holder.property_dictionary_swiss(isolate_);
|
SwissNameDictionary dict = holder.property_dictionary_swiss(isolate_);
|
||||||
number_ = dict.FindEntry(isolate(), *name_);
|
number_ = dict.FindEntry(isolate(), *name_);
|
||||||
if (number_.is_not_found()) return NotFound(holder);
|
if (number_.is_not_found()) return NotFound(holder);
|
||||||
|
@ -3576,7 +3576,7 @@ Maybe<bool> JSProxy::SetPrivateSymbol(Isolate* isolate, Handle<JSProxy> proxy,
|
|||||||
}
|
}
|
||||||
|
|
||||||
PropertyDetails details(kData, DONT_ENUM, PropertyConstness::kMutable);
|
PropertyDetails details(kData, DONT_ENUM, PropertyConstness::kMutable);
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
Handle<SwissNameDictionary> dict(proxy->property_dictionary_swiss(),
|
Handle<SwissNameDictionary> dict(proxy->property_dictionary_swiss(),
|
||||||
isolate);
|
isolate);
|
||||||
Handle<SwissNameDictionary> result =
|
Handle<SwissNameDictionary> result =
|
||||||
|
@ -344,7 +344,7 @@ PrimitiveHeapObject InferMethodName(Isolate* isolate, JSReceiver receiver,
|
|||||||
name = InferMethodNameFromDictionary(
|
name = InferMethodNameFromDictionary(
|
||||||
isolate, JSGlobalObject::cast(object).global_dictionary(kAcquireLoad),
|
isolate, JSGlobalObject::cast(object).global_dictionary(kAcquireLoad),
|
||||||
fun, name);
|
fun, name);
|
||||||
} else if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
} else if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
name = InferMethodNameFromDictionary(
|
name = InferMethodNameFromDictionary(
|
||||||
isolate, object.property_dictionary_swiss(), fun, name);
|
isolate, object.property_dictionary_swiss(), fun, name);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1377,7 +1377,7 @@ void V8HeapExplorer::ExtractPropertyReferences(JSObject js_obj,
|
|||||||
PropertyDetails details = cell.property_details();
|
PropertyDetails details = cell.property_details();
|
||||||
SetDataOrAccessorPropertyReference(details.kind(), entry, name, value);
|
SetDataOrAccessorPropertyReference(details.kind(), entry, name, value);
|
||||||
}
|
}
|
||||||
} else if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
} else if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
// SwissNameDictionary::IterateEntries creates a Handle, which should not
|
// SwissNameDictionary::IterateEntries creates a Handle, which should not
|
||||||
// leak out of here.
|
// leak out of here.
|
||||||
HandleScope scope(isolate);
|
HandleScope scope(isolate);
|
||||||
|
@ -528,7 +528,7 @@ bool InitClassPrototype(Isolate* isolate,
|
|||||||
// Class prototypes do not have a name accessor.
|
// Class prototypes do not have a name accessor.
|
||||||
const bool install_name_accessor = false;
|
const bool install_name_accessor = false;
|
||||||
|
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
Handle<SwissNameDictionary> properties_dictionary_template =
|
Handle<SwissNameDictionary> properties_dictionary_template =
|
||||||
Handle<SwissNameDictionary>::cast(properties_template);
|
Handle<SwissNameDictionary>::cast(properties_template);
|
||||||
return AddDescriptorsByTemplate(
|
return AddDescriptorsByTemplate(
|
||||||
@ -589,7 +589,7 @@ bool InitClassConstructor(
|
|||||||
// All class constructors have a name accessor.
|
// All class constructors have a name accessor.
|
||||||
const bool install_name_accessor = true;
|
const bool install_name_accessor = true;
|
||||||
|
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
Handle<SwissNameDictionary> properties_dictionary_template =
|
Handle<SwissNameDictionary> properties_dictionary_template =
|
||||||
Handle<SwissNameDictionary>::cast(properties_template);
|
Handle<SwissNameDictionary>::cast(properties_template);
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ MaybeHandle<JSObject> JSObjectWalkVisitor<ContextObject>::StructureWalk(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
Handle<SwissNameDictionary> dict(
|
Handle<SwissNameDictionary> dict(
|
||||||
copy->property_dictionary_swiss(isolate), isolate);
|
copy->property_dictionary_swiss(isolate), isolate);
|
||||||
for (InternalIndex i : dict->IterateEntries()) {
|
for (InternalIndex i : dict->IterateEntries()) {
|
||||||
|
@ -401,7 +401,7 @@ RUNTIME_FUNCTION(Runtime_AddDictionaryProperty) {
|
|||||||
|
|
||||||
PropertyDetails property_details(
|
PropertyDetails property_details(
|
||||||
kData, NONE, PropertyDetails::kConstIfDictConstnessTracking);
|
kData, NONE, PropertyDetails::kConstIfDictConstnessTracking);
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
Handle<SwissNameDictionary> dictionary(
|
Handle<SwissNameDictionary> dictionary(
|
||||||
receiver->property_dictionary_swiss(), isolate);
|
receiver->property_dictionary_swiss(), isolate);
|
||||||
dictionary = SwissNameDictionary::Add(isolate, dictionary, name, value,
|
dictionary = SwissNameDictionary::Add(isolate, dictionary, name, value,
|
||||||
@ -680,7 +680,7 @@ RUNTIME_FUNCTION(Runtime_GetProperty) {
|
|||||||
}
|
}
|
||||||
} else if (!holder->HasFastProperties()) {
|
} else if (!holder->HasFastProperties()) {
|
||||||
// Attempt dictionary lookup.
|
// Attempt dictionary lookup.
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
SwissNameDictionary dictionary = holder->property_dictionary_swiss();
|
SwissNameDictionary dictionary = holder->property_dictionary_swiss();
|
||||||
InternalIndex entry = dictionary.FindEntry(isolate, *key);
|
InternalIndex entry = dictionary.FindEntry(isolate, *key);
|
||||||
if (entry.is_found() &&
|
if (entry.is_found() &&
|
||||||
|
@ -1891,7 +1891,7 @@ TEST(AllocateJSObjectFromMap) {
|
|||||||
JSObject::NormalizeProperties(isolate, object, KEEP_INOBJECT_PROPERTIES, 0,
|
JSObject::NormalizeProperties(isolate, object, KEEP_INOBJECT_PROPERTIES, 0,
|
||||||
"Normalize");
|
"Normalize");
|
||||||
Handle<HeapObject> properties =
|
Handle<HeapObject> properties =
|
||||||
V8_DICT_MODE_PROTOTYPES_BOOL
|
V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL
|
||||||
? Handle<HeapObject>(object->property_dictionary_swiss(), isolate)
|
? Handle<HeapObject>(object->property_dictionary_swiss(), isolate)
|
||||||
: handle(object->property_dictionary(), isolate);
|
: handle(object->property_dictionary(), isolate);
|
||||||
Handle<JSObject> result = Handle<JSObject>::cast(
|
Handle<JSObject> result = Handle<JSObject>::cast(
|
||||||
@ -1899,7 +1899,7 @@ TEST(AllocateJSObjectFromMap) {
|
|||||||
handle(object->elements(), isolate))
|
handle(object->elements(), isolate))
|
||||||
.ToHandleChecked());
|
.ToHandleChecked());
|
||||||
CHECK_EQ(result->map(), object->map());
|
CHECK_EQ(result->map(), object->map());
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
CHECK_EQ(result->property_dictionary_swiss(),
|
CHECK_EQ(result->property_dictionary_swiss(),
|
||||||
object->property_dictionary_swiss());
|
object->property_dictionary_swiss());
|
||||||
} else {
|
} else {
|
||||||
|
@ -29,7 +29,7 @@ int AddToSetAndGetHash(Isolate* isolate, Handle<JSObject> obj,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int GetPropertyDictionaryHash(Handle<JSObject> obj) {
|
int GetPropertyDictionaryHash(Handle<JSObject> obj) {
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
return obj->property_dictionary_swiss().Hash();
|
return obj->property_dictionary_swiss().Hash();
|
||||||
} else {
|
} else {
|
||||||
return obj->property_dictionary().Hash();
|
return obj->property_dictionary().Hash();
|
||||||
@ -37,7 +37,7 @@ int GetPropertyDictionaryHash(Handle<JSObject> obj) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int GetPropertyDictionaryLength(Handle<JSObject> obj) {
|
int GetPropertyDictionaryLength(Handle<JSObject> obj) {
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
return obj->property_dictionary_swiss().Capacity();
|
return obj->property_dictionary_swiss().Capacity();
|
||||||
} else {
|
} else {
|
||||||
return obj->property_dictionary().length();
|
return obj->property_dictionary().length();
|
||||||
@ -45,7 +45,7 @@ int GetPropertyDictionaryLength(Handle<JSObject> obj) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CheckIsDictionaryModeObject(Handle<JSObject> obj) {
|
void CheckIsDictionaryModeObject(Handle<JSObject> obj) {
|
||||||
if (V8_DICT_MODE_PROTOTYPES_BOOL) {
|
if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) {
|
||||||
CHECK(obj->raw_properties_or_hash().IsSwissNameDictionary());
|
CHECK(obj->raw_properties_or_hash().IsSwissNameDictionary());
|
||||||
} else {
|
} else {
|
||||||
CHECK(obj->raw_properties_or_hash().IsNameDictionary());
|
CHECK(obj->raw_properties_or_hash().IsNameDictionary());
|
||||||
|
Loading…
Reference in New Issue
Block a user