File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -1036,14 +1036,21 @@ MapUpdater::State MapUpdater::ConstructNewMap() {
10361036 Handle<Map> new_map =
10371037 Map::AddMissingTransitions (isolate_, split_map, new_descriptors);
10381038
1039+ bool had_any_enum_cache =
1040+ split_map->instance_descriptors (isolate_)
1041+ ->enum_cache ()
1042+ ->keys ()
1043+ ->length () > 0 ||
1044+ old_descriptors_->enum_cache ()->keys ()->length () > 0 ;
1045+
10391046 // Deprecated part of the transition tree is no longer reachable, so replace
10401047 // current instance descriptors in the "survived" part of the tree with
10411048 // the new descriptors to maintain descriptors sharing invariant.
10421049 split_map->ReplaceDescriptors (isolate_, *new_descriptors);
10431050
1044- // If the old descriptors had an enum cache, make sure the new ones do too.
1045- if (old_descriptors_-> enum_cache ()-> keys ()-> length () > 0 &&
1046- new_map->NumberOfEnumerableProperties () > 0 ) {
1051+ // If the old descriptors had an enum cache (or if {split_map}'s descriptors
1052+ // had one), make sure the new ones do too.
1053+ if (had_any_enum_cache && new_map->NumberOfEnumerableProperties () > 0 ) {
10471054 FastKeyAccumulator::InitializeFastPropertyEnumCache (
10481055 isolate_, new_map, new_map->NumberOfEnumerableProperties ());
10491056 }
You can’t perform that action at this time.
0 commit comments