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

Unified Diff: src/compiler/load-elimination.cc

Issue 2510843002: [turbofan] Improve handling of TransitionElementsKind in load elimination. (Closed)
Patch Set: Address reviewer's comment Created 4 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/load-elimination.cc
diff --git a/src/compiler/load-elimination.cc b/src/compiler/load-elimination.cc
index e50ebe19190c0313cd5c38f190199bf675655b76..5ea1635441a5669a59e56439f8058817d733e6ab 100644
--- a/src/compiler/load-elimination.cc
+++ b/src/compiler/load-elimination.cc
@@ -866,10 +866,15 @@ LoadElimination::AbstractState const* LoadElimination::ComputeLoopState(
}
case IrOpcode::kTransitionElementsKind: {
Node* const object = NodeProperties::GetValueInput(current, 0);
- state = state->KillField(
- object, FieldIndexOf(HeapObject::kMapOffset), zone());
- state = state->KillField(
- object, FieldIndexOf(JSObject::kElementsOffset), zone());
+ Node* const target_map = NodeProperties::GetValueInput(current, 2);
+ Node* const object_map = state->LookupField(
+ object, FieldIndexOf(HeapObject::kMapOffset));
+ if (target_map != object_map) {
+ state = state->KillField(
+ object, FieldIndexOf(HeapObject::kMapOffset), zone());
+ state = state->KillField(
+ object, FieldIndexOf(JSObject::kElementsOffset), zone());
+ }
break;
}
case IrOpcode::kStoreField: {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698