summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chromium/v8/src/objects/map-updater.cc12
-rw-r--r--chromium/v8/src/objects/map.cc1
2 files changed, 12 insertions, 1 deletions
diff --git a/chromium/v8/src/objects/map-updater.cc b/chromium/v8/src/objects/map-updater.cc
index 8c9b94014f8..4ea69120d14 100644
--- a/chromium/v8/src/objects/map-updater.cc
+++ b/chromium/v8/src/objects/map-updater.cc
@@ -401,7 +401,17 @@ MapUpdater::State MapUpdater::FindTargetMap() {
}
Representation tmp_representation = tmp_details.representation();
if (!old_details.representation().fits_into(tmp_representation)) {
- break;
+ // Try updating the field in-place to a generalized type.
+ Representation generalized =
+ tmp_representation.generalize(old_details.representation());
+ if (!tmp_representation.CanBeInPlaceChangedTo(generalized)) {
+ break;
+ }
+ Handle<Map> field_owner(tmp_map->FindFieldOwner(isolate_, i), isolate_);
+ tmp_representation = generalized;
+ GeneralizeField(field_owner, i, tmp_details.constness(),
+ tmp_representation,
+ handle(tmp_descriptors->GetFieldType(i), isolate_));
}
if (tmp_details.location() == kField) {
diff --git a/chromium/v8/src/objects/map.cc b/chromium/v8/src/objects/map.cc
index 2dc288628c8..1799cff1a22 100644
--- a/chromium/v8/src/objects/map.cc
+++ b/chromium/v8/src/objects/map.cc
@@ -609,6 +609,7 @@ void Map::DeprecateTransitionTree(Isolate* isolate) {
transitions.GetTarget(i).DeprecateTransitionTree(isolate);
}
DCHECK(!constructor_or_backpointer().IsFunctionTemplateInfo());
+ DCHECK(CanBeDeprecated());
set_is_deprecated(true);
if (FLAG_trace_maps) {
LOG(isolate, MapEvent("Deprecate", handle(*this, isolate), Handle<Map>()));