diff options
Diffstat (limited to 'deps/v8/src/builtins/builtins-collections-gen.cc')
-rw-r--r-- | deps/v8/src/builtins/builtins-collections-gen.cc | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/deps/v8/src/builtins/builtins-collections-gen.cc b/deps/v8/src/builtins/builtins-collections-gen.cc index 19a6ae0729..b5a9851c70 100644 --- a/deps/v8/src/builtins/builtins-collections-gen.cc +++ b/deps/v8/src/builtins/builtins-collections-gen.cc @@ -7,14 +7,12 @@ #include "src/builtins/builtins-constructor-gen.h" #include "src/builtins/builtins-iterator-gen.h" #include "src/builtins/builtins-utils-gen.h" -#include "src/code-stub-assembler.h" +#include "src/codegen/code-stub-assembler.h" #include "src/heap/factory-inl.h" #include "src/heap/heap-inl.h" #include "src/objects/hash-table-inl.h" #include "src/objects/js-collection.h" #include "src/objects/ordered-hash-table.h" -#include "torque-generated/builtins-base-from-dsl-gen.h" -#include "torque-generated/builtins-collections-from-dsl-gen.h" namespace v8 { namespace internal { @@ -25,11 +23,10 @@ using TNode = compiler::TNode<T>; template <class T> using TVariable = compiler::TypedCodeAssemblerVariable<T>; -class BaseCollectionsAssembler : public CodeStubAssembler, - public CollectionsBuiltinsFromDSLAssembler { +class BaseCollectionsAssembler : public CodeStubAssembler { public: explicit BaseCollectionsAssembler(compiler::CodeAssemblerState* state) - : CodeStubAssembler(state), CollectionsBuiltinsFromDSLAssembler(state) {} + : CodeStubAssembler(state) {} virtual ~BaseCollectionsAssembler() = default; @@ -158,7 +155,7 @@ void BaseCollectionsAssembler::AddConstructorEntry( var_exception); CSA_ASSERT(this, Word32BinaryNot(IsTheHole(key_value))); if (variant == kMap || variant == kWeakMap) { - BaseBuiltinsFromDSLAssembler::KeyValuePair pair = + TorqueStructKeyValuePair pair = if_may_have_side_effects != nullptr ? LoadKeyValuePairNoSideEffects(context, key_value, if_may_have_side_effects) @@ -318,7 +315,7 @@ void BaseCollectionsAssembler::AddConstructorEntriesFromIterable( TNode<Object> add_func = GetAddFunction(variant, context, collection); IteratorBuiltinsAssembler iterator_assembler(this->state()); - IteratorBuiltinsAssembler::IteratorRecord iterator = + TorqueStructIteratorRecord iterator = iterator_assembler.GetIterator(context, iterable); CSA_ASSERT(this, Word32BinaryNot(IsUndefined(iterator.object))); @@ -598,8 +595,8 @@ class CollectionsBuiltinsAssembler : public BaseCollectionsAssembler { // Transitions the iterator to the non obsolete backing store. // This is a NOP if the [table] is not obsolete. - typedef std::function<void(Node* const table, Node* const index)> - UpdateInTransition; + using UpdateInTransition = + std::function<void(Node* const table, Node* const index)>; template <typename TableType> std::pair<TNode<TableType>, TNode<IntPtrT>> Transition( TNode<TableType> const table, TNode<IntPtrT> const index, @@ -830,7 +827,7 @@ void CollectionsBuiltinsAssembler::SameValueZeroSmi(Node* key_smi, void CollectionsBuiltinsAssembler::BranchIfMapIteratorProtectorValid( Label* if_true, Label* if_false) { Node* protector_cell = LoadRoot(RootIndex::kMapIteratorProtector); - DCHECK(isolate()->heap()->map_iterator_protector()->IsPropertyCell()); + DCHECK(isolate()->heap()->map_iterator_protector().IsPropertyCell()); Branch(WordEqual(LoadObjectField(protector_cell, PropertyCell::kValueOffset), SmiConstant(Isolate::kProtectorValid)), if_true, if_false); @@ -887,7 +884,7 @@ void BranchIfIterableWithOriginalKeyOrValueMapIterator( void CollectionsBuiltinsAssembler::BranchIfSetIteratorProtectorValid( Label* if_true, Label* if_false) { Node* const protector_cell = LoadRoot(RootIndex::kSetIteratorProtector); - DCHECK(isolate()->heap()->set_iterator_protector()->IsPropertyCell()); + DCHECK(isolate()->heap()->set_iterator_protector().IsPropertyCell()); Branch(WordEqual(LoadObjectField(protector_cell, PropertyCell::kValueOffset), SmiConstant(Isolate::kProtectorValid)), if_true, if_false); @@ -1576,8 +1573,8 @@ void CollectionsBuiltinsAssembler::StoreOrderedHashMapNewEntry( Node* const hash, Node* const number_of_buckets, Node* const occupancy) { Node* const bucket = WordAnd(hash, IntPtrSub(number_of_buckets, IntPtrConstant(1))); - Node* const bucket_entry = UnsafeLoadFixedArrayElement( - table, bucket, OrderedHashMap::HashTableStartIndex() * kTaggedSize); + TNode<Smi> bucket_entry = CAST(UnsafeLoadFixedArrayElement( + table, bucket, OrderedHashMap::HashTableStartIndex() * kTaggedSize)); // Store the entry elements. Node* const entry_start = IntPtrAdd( @@ -1750,8 +1747,8 @@ void CollectionsBuiltinsAssembler::StoreOrderedHashSetNewEntry( Node* const number_of_buckets, Node* const occupancy) { Node* const bucket = WordAnd(hash, IntPtrSub(number_of_buckets, IntPtrConstant(1))); - Node* const bucket_entry = UnsafeLoadFixedArrayElement( - table, bucket, OrderedHashSet::HashTableStartIndex() * kTaggedSize); + TNode<Smi> bucket_entry = CAST(UnsafeLoadFixedArrayElement( + table, bucket, OrderedHashSet::HashTableStartIndex() * kTaggedSize)); // Store the entry elements. Node* const entry_start = IntPtrAdd( @@ -2299,8 +2296,8 @@ class WeakCollectionsBuiltinsAssembler : public BaseCollectionsAssembler { // Builds code that finds the EphemeronHashTable entry for a {key} using the // comparison code generated by {key_compare}. The key index is returned if // the {key} is found. - typedef std::function<void(TNode<Object> entry_key, Label* if_same)> - KeyComparator; + using KeyComparator = + std::function<void(TNode<Object> entry_key, Label* if_same)>; TNode<IntPtrT> FindKeyIndex(TNode<HeapObject> table, TNode<IntPtrT> key_hash, TNode<IntPtrT> entry_mask, const KeyComparator& key_compare); |