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

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

Issue 11280230: Optimize checked mode asserts with uninstantiated types and known constant type-arguments. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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 | « runtime/vm/flow_graph_compiler_x64.cc ('k') | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/flow_graph_builder.h" 9 #include "vm/flow_graph_builder.h"
10 #include "vm/flow_graph_compiler.h" 10 #include "vm/flow_graph_compiler.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 it->RemoveCurrentFromGraph(); 145 it->RemoveCurrentFromGraph();
146 } 146 }
147 147
148 148
149 void FlowGraphOptimizer::OptimizeComputations() { 149 void FlowGraphOptimizer::OptimizeComputations() {
150 for (intptr_t i = 0; i < block_order_.length(); ++i) { 150 for (intptr_t i = 0; i < block_order_.length(); ++i) {
151 BlockEntryInstr* entry = block_order_[i]; 151 BlockEntryInstr* entry = block_order_[i];
152 entry->Accept(this); 152 entry->Accept(this);
153 for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) { 153 for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) {
154 Instruction* current = it.Current(); 154 Instruction* current = it.Current();
155 Instruction* replacement = current->Canonicalize(); 155 Instruction* replacement = current->Canonicalize(this);
156 if (replacement != current) { 156 if (replacement != current) {
157 // For non-definitions Canonicalize should return either NULL or 157 // For non-definitions Canonicalize should return either NULL or
158 // this. 158 // this.
159 ASSERT((replacement == NULL) || current->IsDefinition()); 159 ASSERT((replacement == NULL) || current->IsDefinition());
160 ReplaceCurrentInstruction(&it, current, replacement); 160 ReplaceCurrentInstruction(&it, current, replacement);
161 } 161 }
162 } 162 }
163 } 163 }
164 } 164 }
165 165
(...skipping 3740 matching lines...) Expand 10 before | Expand all | Expand 10 after
3906 3906
3907 if (FLAG_trace_constant_propagation) { 3907 if (FLAG_trace_constant_propagation) {
3908 OS::Print("\n==== After constant propagation ====\n"); 3908 OS::Print("\n==== After constant propagation ====\n");
3909 FlowGraphPrinter printer(*graph_); 3909 FlowGraphPrinter printer(*graph_);
3910 printer.PrintBlocks(); 3910 printer.PrintBlocks();
3911 } 3911 }
3912 } 3912 }
3913 3913
3914 3914
3915 } // namespace dart 3915 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698