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 @@ -1031,14 +1031,21 @@ MapUpdater::State MapUpdater::ConstructNewMap() {
10311031 Handle<Map> new_map =
10321032 Map::AddMissingTransitions (isolate_, split_map, new_descriptors);
10331033
1034+ bool had_any_enum_cache =
1035+ split_map->instance_descriptors (isolate_)
1036+ .enum_cache ()
1037+ .keys ()
1038+ .length () > 0 ||
1039+ old_descriptors_->enum_cache ().keys ().length () > 0 ;
1040+
10341041 // Deprecated part of the transition tree is no longer reachable, so replace
10351042 // current instance descriptors in the "survived" part of the tree with
10361043 // the new descriptors to maintain descriptors sharing invariant.
10371044 split_map->ReplaceDescriptors (isolate_, *new_descriptors);
10381045
1039- // If the old descriptors had an enum cache, make sure the new ones do too.
1040- if (old_descriptors_-> enum_cache (). keys (). length () > 0 &&
1041- new_map->NumberOfEnumerableProperties () > 0 ) {
1046+ // If the old descriptors had an enum cache (or if {split_map}'s descriptors
1047+ // had one), make sure the new ones do too.
1048+ if (had_any_enum_cache && new_map->NumberOfEnumerableProperties () > 0 ) {
10421049 FastKeyAccumulator::InitializeFastPropertyEnumCache (
10431050 isolate_, new_map, new_map->NumberOfEnumerableProperties ());
10441051 }
You can’t perform that action at this time.
0 commit comments