@@ -399,23 +399,23 @@ TNode<IntPtrT> BaseCollectionsAssembler::EstimatedInitialSize(
399
399
[=] { return IntPtrConstant (0 ); });
400
400
}
401
401
402
- void BaseCollectionsAssembler::GotoIfCannotBeWeakKey (
403
- const TNode<Object> obj, Label* if_cannot_be_weak_key ) {
402
+ void BaseCollectionsAssembler::GotoIfCannotBeHeldWeakly (
403
+ const TNode<Object> obj, Label* if_cannot_be_held_weakly ) {
404
404
Label check_symbol_key (this );
405
405
Label end (this );
406
- GotoIf (TaggedIsSmi (obj), if_cannot_be_weak_key );
406
+ GotoIf (TaggedIsSmi (obj), if_cannot_be_held_weakly );
407
407
TNode<Uint16T> instance_type = LoadMapInstanceType (LoadMap (CAST (obj)));
408
408
GotoIfNot (IsJSReceiverInstanceType (instance_type), &check_symbol_key);
409
409
// TODO(v8:12547) Shared structs should only be able to point to shared values
410
410
// in weak collections. For now, disallow them as weak collection keys.
411
- GotoIf (IsJSSharedStructInstanceType (instance_type), if_cannot_be_weak_key );
411
+ GotoIf (IsJSSharedStructInstanceType (instance_type), if_cannot_be_held_weakly );
412
412
Goto (&end);
413
413
Bind (&check_symbol_key);
414
- GotoIfNot (HasHarmonySymbolAsWeakmapKeyFlag (), if_cannot_be_weak_key );
415
- GotoIfNot (IsSymbolInstanceType (instance_type), if_cannot_be_weak_key );
414
+ GotoIfNot (HasHarmonySymbolAsWeakmapKeyFlag (), if_cannot_be_held_weakly );
415
+ GotoIfNot (IsSymbolInstanceType (instance_type), if_cannot_be_held_weakly );
416
416
TNode<Uint32T> flags = LoadSymbolFlags (CAST (obj));
417
417
GotoIf (Word32And (flags, Symbol::IsInPublicSymbolTableBit::kMask ),
418
- if_cannot_be_weak_key );
418
+ if_cannot_be_held_weakly );
419
419
Goto (&end);
420
420
Bind (&end);
421
421
}
@@ -2573,17 +2573,17 @@ TF_BUILTIN(WeakMapLookupHashIndex, WeakCollectionsBuiltinsAssembler) {
2573
2573
auto table = Parameter<EphemeronHashTable>(Descriptor::kTable );
2574
2574
auto key = Parameter<Object>(Descriptor::kKey );
2575
2575
2576
- Label if_cannot_be_weak_key (this );
2576
+ Label if_cannot_be_held_weakly (this );
2577
2577
2578
- GotoIfCannotBeWeakKey (key, &if_cannot_be_weak_key );
2578
+ GotoIfCannotBeHeldWeakly (key, &if_cannot_be_held_weakly );
2579
2579
2580
- TNode<IntPtrT> hash = GetHash (CAST (key), &if_cannot_be_weak_key );
2580
+ TNode<IntPtrT> hash = GetHash (CAST (key), &if_cannot_be_held_weakly );
2581
2581
TNode<IntPtrT> capacity = LoadTableCapacity (table);
2582
2582
TNode<IntPtrT> key_index = FindKeyIndexForKey (
2583
- table, key, hash, EntryMask (capacity), &if_cannot_be_weak_key );
2583
+ table, key, hash, EntryMask (capacity), &if_cannot_be_held_weakly );
2584
2584
Return (SmiTag (ValueIndexFromKeyIndex (key_index)));
2585
2585
2586
- BIND (&if_cannot_be_weak_key );
2586
+ BIND (&if_cannot_be_held_weakly );
2587
2587
Return (SmiConstant (-1 ));
2588
2588
}
2589
2589
@@ -2638,22 +2638,22 @@ TF_BUILTIN(WeakCollectionDelete, WeakCollectionsBuiltinsAssembler) {
2638
2638
auto collection = Parameter<JSWeakCollection>(Descriptor::kCollection );
2639
2639
auto key = Parameter<Object>(Descriptor::kKey );
2640
2640
2641
- Label call_runtime (this ), if_cannot_be_weak_key (this );
2641
+ Label call_runtime (this ), if_cannot_be_held_weakly (this );
2642
2642
2643
- GotoIfCannotBeWeakKey (key, &if_cannot_be_weak_key );
2643
+ GotoIfCannotBeHeldWeakly (key, &if_cannot_be_held_weakly );
2644
2644
2645
- TNode<IntPtrT> hash = GetHash (CAST (key), &if_cannot_be_weak_key );
2645
+ TNode<IntPtrT> hash = GetHash (CAST (key), &if_cannot_be_held_weakly );
2646
2646
TNode<EphemeronHashTable> table = LoadTable (collection);
2647
2647
TNode<IntPtrT> capacity = LoadTableCapacity (table);
2648
2648
TNode<IntPtrT> key_index = FindKeyIndexForKey (
2649
- table, key, hash, EntryMask (capacity), &if_cannot_be_weak_key );
2649
+ table, key, hash, EntryMask (capacity), &if_cannot_be_held_weakly );
2650
2650
TNode<IntPtrT> number_of_elements = LoadNumberOfElements (table, -1 );
2651
2651
GotoIf (ShouldShrink (capacity, number_of_elements), &call_runtime);
2652
2652
2653
2653
RemoveEntry (table, key_index, number_of_elements);
2654
2654
Return (TrueConstant ());
2655
2655
2656
- BIND (&if_cannot_be_weak_key );
2656
+ BIND (&if_cannot_be_held_weakly );
2657
2657
Return (FalseConstant ());
2658
2658
2659
2659
BIND (&call_runtime);
@@ -2735,7 +2735,7 @@ TF_BUILTIN(WeakMapPrototypeSet, WeakCollectionsBuiltinsAssembler) {
2735
2735
" WeakMap.prototype.set" );
2736
2736
2737
2737
Label throw_invalid_key (this );
2738
- GotoIfCannotBeWeakKey (key, &throw_invalid_key);
2738
+ GotoIfCannotBeHeldWeakly (key, &throw_invalid_key);
2739
2739
2740
2740
Return (
2741
2741
CallBuiltin (Builtin::kWeakCollectionSet , context, receiver, key, value));
@@ -2753,7 +2753,7 @@ TF_BUILTIN(WeakSetPrototypeAdd, WeakCollectionsBuiltinsAssembler) {
2753
2753
" WeakSet.prototype.add" );
2754
2754
2755
2755
Label throw_invalid_value (this );
2756
- GotoIfCannotBeWeakKey (value, &throw_invalid_value);
2756
+ GotoIfCannotBeHeldWeakly (value, &throw_invalid_value);
2757
2757
2758
2758
Return (CallBuiltin (Builtin::kWeakCollectionSet , context, receiver, value,
2759
2759
TrueConstant ()));
0 commit comments