Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Unified Diff: src/compiler/js-native-context-specialization.cc

Issue 2621423006: [turbofan] Add support for (deferred) instance migration. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/compiler/js-native-context-specialization.cc
diff --git a/src/compiler/js-native-context-specialization.cc b/src/compiler/js-native-context-specialization.cc
index ccae14d118ed8dcd7da20cf0ba68802518dfea75..aa5db2a398a54429fa6111be386777ca7f861a60 100644
--- a/src/compiler/js-native-context-specialization.cc
+++ b/src/compiler/js-native-context-specialization.cc
@@ -1197,8 +1197,9 @@ JSNativeContextSpecialization::BuildPropertyAccess(
if (access_info.field_map().ToHandle(&field_map)) {
// Emit a map check for the value.
effect = graph()->NewNode(
- simplified()->CheckMaps(ZoneHandleSet<Map>(field_map)), value,
- effect, control);
+ simplified()->CheckMaps(CheckMapsFlag::kNone,
+ ZoneHandleSet<Map>(field_map)),
+ value, effect, control);
}
field_access.write_barrier_kind = kPointerWriteBarrier;
break;
@@ -1519,9 +1520,11 @@ JSNativeContextSpecialization::BuildElementAccess(
if (access_mode == AccessMode::kStore &&
IsFastSmiOrObjectElementsKind(elements_kind) &&
store_mode != STORE_NO_TRANSITION_HANDLE_COW) {
- effect = graph()->NewNode(simplified()->CheckMaps(ZoneHandleSet<Map>(
- factory()->fixed_array_map())),
- elements, effect, control);
+ effect = graph()->NewNode(
+ simplified()->CheckMaps(
+ CheckMapsFlag::kNone,
+ ZoneHandleSet<Map>(factory()->fixed_array_map())),
+ elements, effect, control);
}
// Check if the {receiver} is a JSArray.
@@ -1748,11 +1751,15 @@ Node* JSNativeContextSpecialization::BuildCheckMaps(
}
}
ZoneHandleSet<Map> maps;
+ CheckMapsFlags flags = CheckMapsFlag::kNone;
for (Handle<Map> map : receiver_maps) {
maps.insert(map, graph()->zone());
+ if (map->is_migration_target()) {
+ flags |= CheckMapsFlag::kTryMigrateInstance;
+ }
}
- return graph()->NewNode(simplified()->CheckMaps(maps), receiver, effect,
- control);
+ return graph()->NewNode(simplified()->CheckMaps(flags, maps), receiver,
+ effect, control);
}
void JSNativeContextSpecialization::AssumePrototypesStable(

Powered by Google App Engine
This is Rietveld 408576698