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() {
1031
1031
Handle<Map> new_map =
1032
1032
Map::AddMissingTransitions (isolate_, split_map, new_descriptors);
1033
1033
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
+
1034
1041
// Deprecated part of the transition tree is no longer reachable, so replace
1035
1042
// current instance descriptors in the "survived" part of the tree with
1036
1043
// the new descriptors to maintain descriptors sharing invariant.
1037
1044
split_map->ReplaceDescriptors (isolate_, *new_descriptors);
1038
1045
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 ) {
1042
1049
FastKeyAccumulator::InitializeFastPropertyEnumCache (
1043
1050
isolate_, new_map, new_map->NumberOfEnumerableProperties ());
1044
1051
}
You can’t perform that action at this time.
0 commit comments