diff options
Diffstat (limited to 'deps/v8/src/objects/literal-objects.cc')
-rw-r--r-- | deps/v8/src/objects/literal-objects.cc | 62 |
1 files changed, 30 insertions, 32 deletions
diff --git a/deps/v8/src/objects/literal-objects.cc b/deps/v8/src/objects/literal-objects.cc index 8dfea9f77c..e6d57de82e 100644 --- a/deps/v8/src/objects/literal-objects.cc +++ b/deps/v8/src/objects/literal-objects.cc @@ -37,9 +37,9 @@ inline int EncodeComputedEntry(ClassBoilerplate::ValueKind value_kind, return flags; } -template <typename LocalIsolate> +template <typename IsolateT> void AddToDescriptorArrayTemplate( - LocalIsolate* isolate, Handle<DescriptorArray> descriptor_array_template, + IsolateT* isolate, Handle<DescriptorArray> descriptor_array_template, Handle<Name> name, ClassBoilerplate::ValueKind value_kind, Handle<Object> value) { InternalIndex entry = descriptor_array_template->Search( @@ -90,18 +90,18 @@ void AddToDescriptorArrayTemplate( } } -template <typename LocalIsolate> +template <typename IsolateT> Handle<NameDictionary> DictionaryAddNoUpdateNextEnumerationIndex( - LocalIsolate* isolate, Handle<NameDictionary> dictionary, Handle<Name> name, + IsolateT* isolate, Handle<NameDictionary> dictionary, Handle<Name> name, Handle<Object> value, PropertyDetails details, InternalIndex* entry_out = nullptr) { return NameDictionary::AddNoUpdateNextEnumerationIndex( isolate, dictionary, name, value, details, entry_out); } -template <typename LocalIsolate> +template <typename IsolateT> Handle<SwissNameDictionary> DictionaryAddNoUpdateNextEnumerationIndex( - LocalIsolate* isolate, Handle<SwissNameDictionary> dictionary, + IsolateT* isolate, Handle<SwissNameDictionary> dictionary, Handle<Name> name, Handle<Object> value, PropertyDetails details, InternalIndex* entry_out = nullptr) { // SwissNameDictionary does not maintain the enumeration order in property @@ -109,10 +109,10 @@ Handle<SwissNameDictionary> DictionaryAddNoUpdateNextEnumerationIndex( return SwissNameDictionary::Add(isolate, dictionary, name, value, details); } -template <typename LocalIsolate> +template <typename IsolateT> Handle<NumberDictionary> DictionaryAddNoUpdateNextEnumerationIndex( - LocalIsolate* isolate, Handle<NumberDictionary> dictionary, - uint32_t element, Handle<Object> value, PropertyDetails details, + IsolateT* isolate, Handle<NumberDictionary> dictionary, uint32_t element, + Handle<Object> value, PropertyDetails details, InternalIndex* entry_out = nullptr) { // NumberDictionary does not maintain the enumeration order, so it's // a normal Add(). @@ -149,10 +149,9 @@ inline int GetExistingValueIndex(Object value) { return value.IsSmi() ? Smi::ToInt(value) : kAccessorNotDefined; } -template <typename LocalIsolate, typename Dictionary, typename Key> -void AddToDictionaryTemplate(LocalIsolate* isolate, - Handle<Dictionary> dictionary, Key key, - int key_index, +template <typename IsolateT, typename Dictionary, typename Key> +void AddToDictionaryTemplate(IsolateT* isolate, Handle<Dictionary> dictionary, + Key key, int key_index, ClassBoilerplate::ValueKind value_kind, Smi value) { InternalIndex entry = dictionary->FindEntry(isolate, key); @@ -372,7 +371,7 @@ void AddToDictionaryTemplate(LocalIsolate* isolate, // Helper class that eases building of a properties, elements and computed // properties templates. -template <typename LocalIsolate> +template <typename IsolateT> class ObjectDescriptor { public: void IncComputedCount() { ++computed_count_; } @@ -401,7 +400,7 @@ class ObjectDescriptor { return computed_properties_; } - void CreateTemplates(LocalIsolate* isolate) { + void CreateTemplates(IsolateT* isolate) { auto* factory = isolate->factory(); descriptor_array_template_ = factory->empty_descriptor_array(); if (V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) { @@ -443,8 +442,8 @@ class ObjectDescriptor { temp_handle_ = handle(Smi::zero(), isolate); } - void AddConstant(LocalIsolate* isolate, Handle<Name> name, - Handle<Object> value, PropertyAttributes attribs) { + void AddConstant(IsolateT* isolate, Handle<Name> name, Handle<Object> value, + PropertyAttributes attribs) { bool is_accessor = value->IsAccessorInfo(); DCHECK(!value->IsAccessorPair()); if (HasDictionaryProperties()) { @@ -473,7 +472,7 @@ class ObjectDescriptor { } } - void AddNamedProperty(LocalIsolate* isolate, Handle<Name> name, + void AddNamedProperty(IsolateT* isolate, Handle<Name> name, ClassBoilerplate::ValueKind value_kind, int value_index) { Smi value = Smi::FromInt(value_index); @@ -494,7 +493,7 @@ class ObjectDescriptor { } } - void AddIndexedProperty(LocalIsolate* isolate, uint32_t element, + void AddIndexedProperty(IsolateT* isolate, uint32_t element, ClassBoilerplate::ValueKind value_kind, int value_index) { Smi value = Smi::FromInt(value_index); @@ -516,7 +515,7 @@ class ObjectDescriptor { next_enumeration_index_ = current_index + 1; } - void Finalize(LocalIsolate* isolate) { + void Finalize(IsolateT* isolate) { if (HasDictionaryProperties()) { DCHECK_EQ(current_computed_index_, computed_properties_->length()); if (!V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL) { @@ -555,9 +554,9 @@ class ObjectDescriptor { Handle<Object> temp_handle_; }; -template <typename LocalIsolate, typename PropertyDict> +template <typename IsolateT, typename PropertyDict> void ClassBoilerplate::AddToPropertiesTemplate( - LocalIsolate* isolate, Handle<PropertyDict> dictionary, Handle<Name> name, + IsolateT* isolate, Handle<PropertyDict> dictionary, Handle<Name> name, int key_index, ClassBoilerplate::ValueKind value_kind, Smi value) { AddToDictionaryTemplate(isolate, dictionary, name, key_index, value_kind, value); @@ -572,9 +571,9 @@ template void ClassBoilerplate::AddToPropertiesTemplate( Isolate* isolate, Handle<SwissNameDictionary> dictionary, Handle<Name> name, int key_index, ClassBoilerplate::ValueKind value_kind, Smi value); -template <typename LocalIsolate> +template <typename IsolateT> void ClassBoilerplate::AddToElementsTemplate( - LocalIsolate* isolate, Handle<NumberDictionary> dictionary, uint32_t key, + IsolateT* isolate, Handle<NumberDictionary> dictionary, uint32_t key, int key_index, ClassBoilerplate::ValueKind value_kind, Smi value) { AddToDictionaryTemplate(isolate, dictionary, key, key_index, value_kind, value); @@ -586,21 +585,20 @@ template void ClassBoilerplate::AddToElementsTemplate( LocalIsolate* isolate, Handle<NumberDictionary> dictionary, uint32_t key, int key_index, ClassBoilerplate::ValueKind value_kind, Smi value); -template <typename LocalIsolate> +template <typename IsolateT> Handle<ClassBoilerplate> ClassBoilerplate::BuildClassBoilerplate( - LocalIsolate* isolate, ClassLiteral* expr) { + IsolateT* isolate, ClassLiteral* expr) { // Create a non-caching handle scope to ensure that the temporary handle used // by ObjectDescriptor for passing Smis around does not corrupt handle cache // in CanonicalHandleScope. - typename LocalIsolate::HandleScopeType scope(isolate); + typename IsolateT::HandleScopeType scope(isolate); auto* factory = isolate->factory(); - ObjectDescriptor<LocalIsolate> static_desc(kMinimumClassPropertiesCount); - ObjectDescriptor<LocalIsolate> instance_desc( - kMinimumPrototypePropertiesCount); + ObjectDescriptor<IsolateT> static_desc(kMinimumClassPropertiesCount); + ObjectDescriptor<IsolateT> instance_desc(kMinimumPrototypePropertiesCount); for (int i = 0; i < expr->public_members()->length(); i++) { ClassLiteral::Property* property = expr->public_members()->at(i); - ObjectDescriptor<LocalIsolate>& desc = + ObjectDescriptor<IsolateT>& desc = property->is_static() ? static_desc : instance_desc; if (property->is_computed_name()) { if (property->kind() != ClassLiteral::Property::FIELD) { @@ -678,7 +676,7 @@ Handle<ClassBoilerplate> ClassBoilerplate::BuildClassBoilerplate( continue; } - ObjectDescriptor<LocalIsolate>& desc = + ObjectDescriptor<IsolateT>& desc = property->is_static() ? static_desc : instance_desc; if (property->is_computed_name()) { int computed_name_index = dynamic_argument_index; |