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

Side by Side Diff: runtime/vm/flow_graph_optimizer.cc

Issue 722793002: Revert "Suppress canonicalization of Unbox() instruction that can deoptimize." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/flow_graph_optimizer.h" 5 #include "vm/flow_graph_optimizer.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/cha.h" 8 #include "vm/cha.h"
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 iterator->RemoveCurrentFromGraph(); 582 iterator->RemoveCurrentFromGraph();
583 } 583 }
584 584
585 585
586 bool FlowGraphOptimizer::Canonicalize() { 586 bool FlowGraphOptimizer::Canonicalize() {
587 bool changed = false; 587 bool changed = false;
588 for (intptr_t i = 0; i < block_order_.length(); ++i) { 588 for (intptr_t i = 0; i < block_order_.length(); ++i) {
589 BlockEntryInstr* entry = block_order_[i]; 589 BlockEntryInstr* entry = block_order_[i];
590 for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) { 590 for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) {
591 Instruction* current = it.Current(); 591 Instruction* current = it.Current();
592 if (current->HasUnmatchedInputRepresentations()) {
593 // Can't canonicalize this instruction until all conversions for its
594 // inputs are inserted.
595 continue;
596 }
597
598 Instruction* replacement = current->Canonicalize(flow_graph()); 592 Instruction* replacement = current->Canonicalize(flow_graph());
599
600 if (replacement != current) { 593 if (replacement != current) {
601 // For non-definitions Canonicalize should return either NULL or 594 // For non-definitions Canonicalize should return either NULL or
602 // this. 595 // this.
603 ASSERT((replacement == NULL) || current->IsDefinition()); 596 ASSERT((replacement == NULL) || current->IsDefinition());
604 ReplaceCurrentInstruction(&it, current, replacement, flow_graph_); 597 ReplaceCurrentInstruction(&it, current, replacement, flow_graph_);
605 changed = true; 598 changed = true;
606 } 599 }
607 } 600 }
608 } 601 }
609 return changed; 602 return changed;
(...skipping 9376 matching lines...) Expand 10 before | Expand all | Expand 10 after
9986 9979
9987 // Insert materializations at environment uses. 9980 // Insert materializations at environment uses.
9988 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { 9981 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) {
9989 CreateMaterializationAt( 9982 CreateMaterializationAt(
9990 exits_collector_.exits()[i], alloc, alloc->cls(), *slots); 9983 exits_collector_.exits()[i], alloc, alloc->cls(), *slots);
9991 } 9984 }
9992 } 9985 }
9993 9986
9994 9987
9995 } // namespace dart 9988 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698