@@ -379,10 +379,6 @@ class GlobalHandles::Node final : public NodeBase<GlobalHandles::Node> {
379379 Internals::kNodeStateMask );
380380 STATIC_ASSERT (WEAK == Internals::kNodeStateIsWeakValue );
381381 STATIC_ASSERT (PENDING == Internals::kNodeStateIsPendingValue );
382- STATIC_ASSERT (static_cast <int >(IsIndependent::kShift ) ==
383- Internals::kNodeIsIndependentShift );
384- STATIC_ASSERT (static_cast <int >(IsActive::kShift ) ==
385- Internals::kNodeIsActiveShift );
386382 set_in_young_list (false );
387383 }
388384
@@ -406,16 +402,6 @@ class GlobalHandles::Node final : public NodeBase<GlobalHandles::Node> {
406402 flags_ = NodeState::update (flags_, state);
407403 }
408404
409- bool is_independent () { return IsIndependent::decode (flags_); }
410- void set_independent (bool v) { flags_ = IsIndependent::update (flags_, v); }
411-
412- bool is_active () {
413- return IsActive::decode (flags_);
414- }
415- void set_active (bool v) {
416- flags_ = IsActive::update (flags_, v);
417- }
418-
419405 bool is_in_young_list () const { return IsInYoungList::decode (flags_); }
420406 void set_in_young_list (bool v) { flags_ = IsInYoungList::update (flags_, v); }
421407
@@ -562,7 +548,6 @@ class GlobalHandles::Node final : public NodeBase<GlobalHandles::Node> {
562548 // This method invokes a finalizer. Updating the method name would require
563549 // adjusting CFI blacklist as weak_callback_ is invoked on the wrong type.
564550 CHECK (IsPendingFinalizer ());
565- CHECK (!is_active ());
566551 set_state (NEAR_DEATH);
567552 // Check that we are not passing a finalized external string to
568553 // the callback.
@@ -593,24 +578,17 @@ class GlobalHandles::Node final : public NodeBase<GlobalHandles::Node> {
593578 private:
594579 // Fields that are not used for managing node memory.
595580 void ClearImplFields () {
596- set_independent (false );
597- set_active (false );
598581 weak_callback_ = nullptr ;
599582 }
600583
601584 void CheckImplFieldsAreCleared () {
602- DCHECK (!is_independent ());
603- DCHECK (!is_active ());
604585 DCHECK_EQ (nullptr , weak_callback_);
605586 }
606587
607588 // This stores three flags (independent, partially_dependent and
608589 // in_young_list) and a State.
609590 class NodeState : public BitField8 <State, 0 , 3 > {};
610- class IsIndependent : public BitField8 <bool , NodeState::kNext , 1 > {};
611- // The following two fields are mutually exclusive
612- class IsActive : public BitField8 <bool , IsIndependent::kNext , 1 > {};
613- class IsInYoungList : public BitField8 <bool , IsActive::kNext , 1 > {};
591+ class IsInYoungList : public BitField8 <bool , NodeState::kNext , 1 > {};
614592 class NodeWeaknessType
615593 : public BitField8<WeaknessType, IsInYoungList::kNext , 2 > {};
616594
@@ -873,12 +851,6 @@ void GlobalHandles::IterateWeakRootsIdentifyFinalizers(
873851
874852void GlobalHandles::IdentifyWeakUnmodifiedObjects (
875853 WeakSlotCallback is_unmodified) {
876- for (Node* node : young_nodes_) {
877- if (node->IsWeak () && !is_unmodified (node->location ())) {
878- node->set_active (true );
879- }
880- }
881-
882854 LocalEmbedderHeapTracer* const tracer =
883855 isolate ()->heap ()->local_embedder_heap_tracer ();
884856 for (TracedNode* node : traced_young_nodes_) {
@@ -895,9 +867,7 @@ void GlobalHandles::IdentifyWeakUnmodifiedObjects(
895867
896868void GlobalHandles::IterateYoungStrongAndDependentRoots (RootVisitor* v) {
897869 for (Node* node : young_nodes_) {
898- if (node->IsStrongRetainer () ||
899- (node->IsWeakRetainer () && !node->is_independent () &&
900- node->is_active ())) {
870+ if (node->IsStrongRetainer ()) {
901871 v->VisitRootPointer (Root::kGlobalHandles , node->label (),
902872 node->location ());
903873 }
@@ -913,8 +883,7 @@ void GlobalHandles::MarkYoungWeakUnmodifiedObjectsPending(
913883 WeakSlotCallbackWithHeap is_dead) {
914884 for (Node* node : young_nodes_) {
915885 DCHECK (node->is_in_young_list ());
916- if ((node->is_independent () || !node->is_active ()) && node->IsWeak () &&
917- is_dead (isolate_->heap (), node->location ())) {
886+ if (node->IsWeak () && is_dead (isolate_->heap (), node->location ())) {
918887 if (!node->IsPhantomCallback () && !node->IsPhantomResetHandle ()) {
919888 node->MarkPending ();
920889 }
@@ -926,8 +895,7 @@ void GlobalHandles::IterateYoungWeakUnmodifiedRootsForFinalizers(
926895 RootVisitor* v) {
927896 for (Node* node : young_nodes_) {
928897 DCHECK (node->is_in_young_list ());
929- if ((node->is_independent () || !node->is_active ()) &&
930- node->IsWeakRetainer () && (node->state () == Node::PENDING)) {
898+ if (node->IsWeakRetainer () && (node->state () == Node::PENDING)) {
931899 DCHECK (!node->IsPhantomCallback ());
932900 DCHECK (!node->IsPhantomResetHandle ());
933901 // Finalizers need to survive.
@@ -941,8 +909,7 @@ void GlobalHandles::IterateYoungWeakUnmodifiedRootsForPhantomHandles(
941909 RootVisitor* v, WeakSlotCallbackWithHeap should_reset_handle) {
942910 for (Node* node : young_nodes_) {
943911 DCHECK (node->is_in_young_list ());
944- if ((node->is_independent () || !node->is_active ()) &&
945- node->IsWeakRetainer () && (node->state () != Node::PENDING)) {
912+ if (node->IsWeakRetainer () && (node->state () != Node::PENDING)) {
946913 if (should_reset_handle (isolate_->heap (), node->location ())) {
947914 DCHECK (node->IsPhantomResetHandle () || node->IsPhantomCallback ());
948915 if (node->IsPhantomResetHandle ()) {
@@ -1008,9 +975,6 @@ size_t GlobalHandles::PostScavengeProcessing(unsigned post_processing_count) {
1008975 // Filter free nodes.
1009976 if (!node->IsRetainer ()) continue ;
1010977
1011- // Reset active state for all affected nodes.
1012- node->set_active (false );
1013-
1014978 if (node->IsPending ()) {
1015979 DCHECK (node->has_callback ());
1016980 DCHECK (node->IsPendingFinalizer ());
@@ -1029,9 +993,6 @@ size_t GlobalHandles::PostMarkSweepProcessing(unsigned post_processing_count) {
1029993 // Filter free nodes.
1030994 if (!node->IsRetainer ()) continue ;
1031995
1032- // Reset active state for all affected nodes.
1033- node->set_active (false );
1034-
1035996 if (node->IsPending ()) {
1036997 DCHECK (node->has_callback ());
1037998 DCHECK (node->IsPendingFinalizer ());
0 commit comments