@@ -758,7 +758,7 @@ void AccessorAssembler::HandleStoreICProtoHandler(
758758
759759 // IC dispatchers rely on these assumptions to be held.
760760 STATIC_ASSERT (FixedArray::kLengthOffset ==
761- StoreHandler::kTransitionCellOffset );
761+ StoreHandler::kTransitionOrHolderCellOffset );
762762 DCHECK_EQ (FixedArray::OffsetOfElementAt (StoreHandler::kSmiHandlerIndex ),
763763 StoreHandler::kSmiHandlerOffset );
764764 DCHECK_EQ (FixedArray::OffsetOfElementAt (StoreHandler::kValidityCellIndex ),
@@ -779,18 +779,16 @@ void AccessorAssembler::HandleStoreICProtoHandler(
779779 Node* smi_or_code = LoadObjectField (handler, StoreHandler::kSmiHandlerOffset );
780780
781781 Node* maybe_transition_cell =
782- LoadObjectField (handler, StoreHandler::kTransitionCellOffset );
782+ LoadObjectField (handler, StoreHandler::kTransitionOrHolderCellOffset );
783783 Label array_handler (this ), tuple_handler (this );
784784 Branch (TaggedIsSmi (maybe_transition_cell), &array_handler, &tuple_handler);
785785
786- VARIABLE (var_transition, MachineRepresentation::kTagged );
787- Label if_transition (this ), if_transition_to_constant (this ),
788- if_store_normal (this ), if_store_global_proxy (this ), if_proxy (this ),
789- do_store (this );
786+ VARIABLE (var_transition_map_or_holder, MachineRepresentation::kTagged );
787+ Label do_store (this ), if_transition_map (this ), if_holder_object (this );
790788 BIND (&tuple_handler);
791789 {
792790 Node* transition = LoadWeakCellValue (maybe_transition_cell, miss);
793- var_transition .Bind (transition);
791+ var_transition_map_or_holder .Bind (transition);
794792 Goto (&do_store);
795793 }
796794
@@ -831,32 +829,27 @@ void AccessorAssembler::HandleStoreICProtoHandler(
831829 },
832830 1 , INTPTR_PARAMETERS, IndexAdvanceMode::kPost );
833831
834- Node* maybe_transition_cell =
835- LoadFixedArrayElement ( handler, StoreHandler::kTransitionCellIndex );
832+ Node* maybe_transition_cell = LoadFixedArrayElement (
833+ handler, StoreHandler::kTransitionMapOrHolderCellIndex );
836834 Node* transition = LoadWeakCellValue (maybe_transition_cell, miss);
837- var_transition .Bind (transition);
835+ var_transition_map_or_holder .Bind (transition);
838836 Goto (&do_store);
839837 }
840838
841839 BIND (&do_store);
842840 {
843- Branch ( SmiEqual (smi_or_code, SmiConstant (StoreHandler:: kProxy )), &if_proxy,
844- &if_transition );
841+ Node* transition = var_transition_map_or_holder. value ();
842+ Branch ( IsMap (transition), &if_transition_map, &if_holder_object );
845843 }
846844
847- BIND (&if_proxy );
845+ BIND (&if_transition_map );
848846 {
849- Node* proxy = var_transition.value ();
850- HandleStoreToProxy (p, proxy, miss, support_elements);
851- }
847+ Label if_transition_to_constant (this ), if_store_normal (this );
852848
853- BIND (&if_transition);
854- {
855849 Node* holder = p->receiver ;
856- Node* transition = var_transition .value ();
850+ Node* transition_map = var_transition_map_or_holder .value ();
857851
858- GotoIfNot (IsMap (transition), &if_store_global_proxy);
859- GotoIf (IsDeprecatedMap (transition), miss);
852+ GotoIf (IsDeprecatedMap (transition_map), miss);
860853
861854 if (support_elements == kSupportElements ) {
862855 Label if_smi_handler (this );
@@ -867,7 +860,7 @@ void AccessorAssembler::HandleStoreICProtoHandler(
867860
868861 StoreTransitionDescriptor descriptor (isolate ());
869862 TailCallStub (descriptor, code_handler, p->context , p->receiver , p->name ,
870- transition , p->value , p->slot , p->vector );
863+ transition_map , p->value , p->slot , p->vector );
871864
872865 BIND (&if_smi_handler);
873866 }
@@ -882,13 +875,12 @@ void AccessorAssembler::HandleStoreICProtoHandler(
882875 GotoIf (WordEqual (handler_kind,
883876 IntPtrConstant (StoreHandler::kTransitionToConstant )),
884877 &if_transition_to_constant);
885- // This case is already handled above.
886878 CSA_ASSERT (this ,
887- WordNotEqual (handler_kind,
888- IntPtrConstant (StoreHandler::kStoreGlobalProxy )));
879+ WordEqual (handler_kind,
880+ IntPtrConstant (StoreHandler::kTransitionToField )));
889881
890882 // Handle transitioning field stores.
891- HandleStoreICSmiHandlerCase (handler_word, holder, p->value , transition ,
883+ HandleStoreICSmiHandlerCase (handler_word, holder, p->value , transition_map ,
892884 miss);
893885
894886 BIND (&if_transition_to_constant);
@@ -901,15 +893,15 @@ void AccessorAssembler::HandleStoreICProtoHandler(
901893 IntPtrAdd (scaled_descriptor,
902894 IntPtrConstant (DescriptorArray::kFirstIndex +
903895 DescriptorArray::kEntryValueIndex ));
904- Node* descriptors = LoadMapDescriptors (transition );
896+ Node* descriptors = LoadMapDescriptors (transition_map );
905897 CSA_ASSERT (
906898 this , UintPtrLessThan (descriptor,
907899 LoadAndUntagFixedArrayBaseLength (descriptors)));
908900
909901 Node* constant = LoadFixedArrayElement (descriptors, value_index);
910902 GotoIf (WordNotEqual (p->value , constant), miss);
911903
912- StoreMap (p->receiver , transition );
904+ StoreMap (p->receiver , transition_map );
913905 Return (p->value );
914906 }
915907
@@ -948,10 +940,28 @@ void AccessorAssembler::HandleStoreICProtoHandler(
948940 p->receiver , p->name , p->value );
949941 }
950942 }
943+ }
944+ BIND (&if_holder_object);
945+ {
946+ Label if_store_global_proxy (this );
947+ Node* holder = var_transition_map_or_holder.value ();
948+
949+ Node* smi_handler = smi_or_code;
950+ CSA_ASSERT (this , TaggedIsSmi (smi_handler));
951+ Node* handler_word = SmiUntag (smi_handler);
952+
953+ Node* handler_kind = DecodeWord<StoreHandler::KindBits>(handler_word);
954+ GotoIf (WordEqual (handler_kind,
955+ IntPtrConstant (StoreHandler::kStoreGlobalProxy )),
956+ &if_store_global_proxy);
957+ CSA_ASSERT (this ,
958+ WordEqual (handler_kind, IntPtrConstant (StoreHandler::kProxy )));
959+ HandleStoreToProxy (p, holder, miss, support_elements);
960+
951961 BIND (&if_store_global_proxy);
952962 {
953963 ExitPoint direct_exit (this );
954- StoreGlobalIC_PropertyCellCase (transition , p->value , &direct_exit, miss);
964+ StoreGlobalIC_PropertyCellCase (holder , p->value , &direct_exit, miss);
955965 }
956966 }
957967}
0 commit comments