File tree 1 file changed +10
-3
lines changed 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() {
1036
1036
Handle <Map> new_map =
1037
1037
Map::AddMissingTransitions (isolate_, split_map, new_descriptors);
1038
1038
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
+
1039
1046
// Deprecated part of the transition tree is no longer reachable, so replace
1040
1047
// current instance descriptors in the "survived" part of the tree with
1041
1048
// the new descriptors to maintain descriptors sharing invariant.
1042
1049
split_map->ReplaceDescriptors (isolate_, *new_descriptors);
1043
1050
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 ) {
1047
1054
FastKeyAccumulator::InitializeFastPropertyEnumCache (
1048
1055
isolate_, new_map, new_map->NumberOfEnumerableProperties ());
1049
1056
}
You can’t perform that action at this time.
0 commit comments