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

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

Issue 143263010: Implement simple dead store elimination. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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') | tests/language/vm/store_elimination_vm_test.dart » ('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/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/bit_vector.h" 8 #include "vm/bit_vector.h"
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 while (!result->IsBlockEntry()) result = result->previous(); 636 while (!result->IsBlockEntry()) result = result->previous();
637 return result->AsBlockEntry(); 637 return result->AsBlockEntry();
638 } 638 }
639 639
640 640
641 void ForwardInstructionIterator::RemoveCurrentFromGraph() { 641 void ForwardInstructionIterator::RemoveCurrentFromGraph() {
642 current_ = current_->RemoveFromGraph(true); // Set current_ to previous. 642 current_ = current_->RemoveFromGraph(true); // Set current_ to previous.
643 } 643 }
644 644
645 645
646 void BackwardInstructionIterator::RemoveCurrentFromGraph() {
647 current_ = current_->RemoveFromGraph(false); // Set current_ to next.
648 }
649
650
646 // Default implementation of visiting basic blocks. Can be overridden. 651 // Default implementation of visiting basic blocks. Can be overridden.
647 void FlowGraphVisitor::VisitBlocks() { 652 void FlowGraphVisitor::VisitBlocks() {
648 ASSERT(current_iterator_ == NULL); 653 ASSERT(current_iterator_ == NULL);
649 for (intptr_t i = 0; i < block_order_.length(); ++i) { 654 for (intptr_t i = 0; i < block_order_.length(); ++i) {
650 BlockEntryInstr* entry = block_order_[i]; 655 BlockEntryInstr* entry = block_order_[i];
651 entry->Accept(this); 656 entry->Accept(this);
652 ForwardInstructionIterator it(entry); 657 ForwardInstructionIterator it(entry);
653 current_iterator_ = &it; 658 current_iterator_ = &it;
654 for (; !it.Done(); it.Advance()) { 659 for (; !it.Done(); it.Advance()) {
655 it.Current()->Accept(this); 660 it.Current()->Accept(this);
(...skipping 2740 matching lines...) Expand 10 before | Expand all | Expand 10 after
3396 case Token::kTRUNCDIV: return 0; 3401 case Token::kTRUNCDIV: return 0;
3397 case Token::kMOD: return 1; 3402 case Token::kMOD: return 1;
3398 default: UNIMPLEMENTED(); return -1; 3403 default: UNIMPLEMENTED(); return -1;
3399 } 3404 }
3400 } 3405 }
3401 3406
3402 3407
3403 #undef __ 3408 #undef __
3404 3409
3405 } // namespace dart 3410 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | tests/language/vm/store_elimination_vm_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698