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

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

Issue 2233403003: [turbofan] Eliminate redundant elements kind transitions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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
« 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 c579673ba8c1ca9176d86aaeef5c3340e3b83ea8..d922d3268e42344018b77e5b9708f78cecde23fc 100644
--- a/src/compiler/load-elimination.cc
+++ b/src/compiler/load-elimination.cc
@@ -393,6 +393,11 @@ Reduction LoadElimination::ReduceTransitionElementsKind(Node* node) {
AbstractState const* state = node_states_.Get(effect);
if (state == nullptr) return NoChange();
if (Node* const object_map = state->LookupField(object, 0)) {
+ if (target_map == object_map) {
+ // The {object} already has the {target_map}, so this TransitionElements
+ // {node} is fully redundant (independent of what {source_map} is).
+ return Replace(effect);
+ }
state = state->KillField(object, 0, zone());
if (source_map == object_map) {
state = state->AddField(object, 0, target_map, zone());
« 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