@@ -425,25 +425,25 @@ TNode<IntPtrT> BaseCollectionsAssembler::EstimatedInitialSize(
425425}
426426
427427// https://tc39.es/proposal-symbols-as-weakmap-keys/#sec-canbeheldweakly-abstract-operation
428- void BaseCollectionsAssembler::GotoIfCannotBeWeakKey (
429- const TNode<Object> obj, Label* if_cannot_be_weak_key ) {
428+ void BaseCollectionsAssembler::GotoIfCannotBeHeldWeakly (
429+ const TNode<Object> obj, Label* if_cannot_be_held_weakly ) {
430430 Label check_symbol_key (this );
431431 Label end (this );
432- GotoIf (TaggedIsSmi (obj), if_cannot_be_weak_key );
432+ GotoIf (TaggedIsSmi (obj), if_cannot_be_held_weakly );
433433 TNode<Uint16T> instance_type = LoadMapInstanceType (LoadMap (CAST (obj)));
434434 GotoIfNot (IsJSReceiverInstanceType (instance_type), &check_symbol_key);
435435 // TODO(v8:12547) Shared structs and arrays should only be able to point
436436 // to shared values in weak collections. For now, disallow them as weak
437437 // collection keys.
438- GotoIf (IsJSSharedStructInstanceType (instance_type), if_cannot_be_weak_key );
439- GotoIf (IsJSSharedArrayInstanceType (instance_type), if_cannot_be_weak_key );
438+ GotoIf (IsJSSharedStructInstanceType (instance_type), if_cannot_be_held_weakly );
439+ GotoIf (IsJSSharedArrayInstanceType (instance_type), if_cannot_be_held_weakly );
440440 Goto (&end);
441441 Bind (&check_symbol_key);
442- GotoIfNot (HasHarmonySymbolAsWeakmapKeyFlag (), if_cannot_be_weak_key );
443- GotoIfNot (IsSymbolInstanceType (instance_type), if_cannot_be_weak_key );
442+ GotoIfNot (HasHarmonySymbolAsWeakmapKeyFlag (), if_cannot_be_held_weakly );
443+ GotoIfNot (IsSymbolInstanceType (instance_type), if_cannot_be_held_weakly );
444444 TNode<Uint32T> flags = LoadSymbolFlags (CAST (obj));
445445 GotoIf (Word32And (flags, Symbol::IsInPublicSymbolTableBit::kMask ),
446- if_cannot_be_weak_key );
446+ if_cannot_be_held_weakly );
447447 Goto (&end);
448448 Bind (&end);
449449}
@@ -2586,17 +2586,17 @@ TF_BUILTIN(WeakMapLookupHashIndex, WeakCollectionsBuiltinsAssembler) {
25862586 auto table = Parameter<EphemeronHashTable>(Descriptor::kTable );
25872587 auto key = Parameter<Object>(Descriptor::kKey );
25882588
2589- Label if_cannot_be_weak_key (this );
2589+ Label if_cannot_be_held_weakly (this );
25902590
2591- GotoIfCannotBeWeakKey (key, &if_cannot_be_weak_key );
2591+ GotoIfCannotBeHeldWeakly (key, &if_cannot_be_held_weakly );
25922592
2593- TNode<IntPtrT> hash = GetHash (CAST (key), &if_cannot_be_weak_key );
2593+ TNode<IntPtrT> hash = GetHash (CAST (key), &if_cannot_be_held_weakly );
25942594 TNode<IntPtrT> capacity = LoadTableCapacity (table);
25952595 TNode<IntPtrT> key_index = FindKeyIndexForKey (
2596- table, key, hash, EntryMask (capacity), &if_cannot_be_weak_key );
2596+ table, key, hash, EntryMask (capacity), &if_cannot_be_held_weakly );
25972597 Return (SmiTag (ValueIndexFromKeyIndex (key_index)));
25982598
2599- BIND (&if_cannot_be_weak_key );
2599+ BIND (&if_cannot_be_held_weakly );
26002600 Return (SmiConstant (-1 ));
26012601}
26022602
@@ -2651,22 +2651,22 @@ TF_BUILTIN(WeakCollectionDelete, WeakCollectionsBuiltinsAssembler) {
26512651 auto collection = Parameter<JSWeakCollection>(Descriptor::kCollection );
26522652 auto key = Parameter<Object>(Descriptor::kKey );
26532653
2654- Label call_runtime (this ), if_cannot_be_weak_key (this );
2654+ Label call_runtime (this ), if_cannot_be_held_weakly (this );
26552655
2656- GotoIfCannotBeWeakKey (key, &if_cannot_be_weak_key );
2656+ GotoIfCannotBeHeldWeakly (key, &if_cannot_be_held_weakly );
26572657
2658- TNode<IntPtrT> hash = GetHash (CAST (key), &if_cannot_be_weak_key );
2658+ TNode<IntPtrT> hash = GetHash (CAST (key), &if_cannot_be_held_weakly );
26592659 TNode<EphemeronHashTable> table = LoadTable (collection);
26602660 TNode<IntPtrT> capacity = LoadTableCapacity (table);
26612661 TNode<IntPtrT> key_index = FindKeyIndexForKey (
2662- table, key, hash, EntryMask (capacity), &if_cannot_be_weak_key );
2662+ table, key, hash, EntryMask (capacity), &if_cannot_be_held_weakly );
26632663 TNode<IntPtrT> number_of_elements = LoadNumberOfElements (table, -1 );
26642664 GotoIf (ShouldShrink (capacity, number_of_elements), &call_runtime);
26652665
26662666 RemoveEntry (table, key_index, number_of_elements);
26672667 Return (TrueConstant ());
26682668
2669- BIND (&if_cannot_be_weak_key );
2669+ BIND (&if_cannot_be_held_weakly );
26702670 Return (FalseConstant ());
26712671
26722672 BIND (&call_runtime);
@@ -2751,7 +2751,7 @@ TF_BUILTIN(WeakMapPrototypeSet, WeakCollectionsBuiltinsAssembler) {
27512751 " WeakMap.prototype.set" );
27522752
27532753 Label throw_invalid_key (this );
2754- GotoIfCannotBeWeakKey (key, &throw_invalid_key);
2754+ GotoIfCannotBeHeldWeakly (key, &throw_invalid_key);
27552755
27562756 Return (
27572757 CallBuiltin (Builtin::kWeakCollectionSet , context, receiver, key, value));
@@ -2769,7 +2769,7 @@ TF_BUILTIN(WeakSetPrototypeAdd, WeakCollectionsBuiltinsAssembler) {
27692769 " WeakSet.prototype.add" );
27702770
27712771 Label throw_invalid_value (this );
2772- GotoIfCannotBeWeakKey (value, &throw_invalid_value);
2772+ GotoIfCannotBeHeldWeakly (value, &throw_invalid_value);
27732773
27742774 Return (CallBuiltin (Builtin::kWeakCollectionSet , context, receiver, value,
27752775 TrueConstant ()));
0 commit comments