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

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

Issue 10916082: Make register allocator to disregard constant computation with no uses. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_ia32.cc » ('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/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/flow_graph_allocator.h" 9 #include "vm/flow_graph_allocator.h"
10 #include "vm/flow_graph_builder.h" 10 #include "vm/flow_graph_builder.h"
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 void Definition::InsertAfter(Instruction* prev) { 212 void Definition::InsertAfter(Instruction* prev) {
213 ASSERT(previous_ == NULL); 213 ASSERT(previous_ == NULL);
214 ASSERT(next_ == NULL); 214 ASSERT(next_ == NULL);
215 previous_ = prev; 215 previous_ = prev;
216 next_ = prev->next_; 216 next_ = prev->next_;
217 next_->previous_ = this; 217 next_->previous_ = this;
218 previous_->next_ = this; 218 previous_->next_ = this;
219 } 219 }
220 220
221 221
222 ConstantComp* Definition::AsConstant() {
223 BindInstr* bind = AsBind();
224 return (bind != NULL) ? bind->computation()->AsConstant() : NULL;
225 }
226
227
222 void ForwardInstructionIterator::RemoveCurrentFromGraph() { 228 void ForwardInstructionIterator::RemoveCurrentFromGraph() {
223 current_ = current_->RemoveFromGraph(true); // Set current_ to previous. 229 current_ = current_->RemoveFromGraph(true); // Set current_ to previous.
224 } 230 }
225 231
226 232
227 // Default implementation of visiting basic blocks. Can be overridden. 233 // Default implementation of visiting basic blocks. Can be overridden.
228 void FlowGraphVisitor::VisitBlocks() { 234 void FlowGraphVisitor::VisitBlocks() {
229 ASSERT(current_iterator_ == NULL); 235 ASSERT(current_iterator_ == NULL);
230 for (intptr_t i = 0; i < block_order_.length(); ++i) { 236 for (intptr_t i = 0; i < block_order_.length(); ++i) {
231 BlockEntryInstr* entry = block_order_[i]; 237 BlockEntryInstr* entry = block_order_[i];
(...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 value->set_use_index(i); 1527 value->set_use_index(i);
1522 value->AddToEnvUseList(); 1528 value->AddToEnvUseList();
1523 } 1529 }
1524 instr->set_env(copy); 1530 instr->set_env(copy);
1525 } 1531 }
1526 1532
1527 1533
1528 #undef __ 1534 #undef __
1529 1535
1530 } // namespace dart 1536 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698