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

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

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/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.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) 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 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_
6 #define VM_INTERMEDIATE_LANGUAGE_H_ 6 #define VM_INTERMEDIATE_LANGUAGE_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/ast.h" 9 #include "vm/ast.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 1455 matching lines...) Expand 10 before | Expand all | Expand 10 after
1466 ASSERT(block_entry_->previous() == NULL); 1466 ASSERT(block_entry_->previous() == NULL);
1467 } 1467 }
1468 1468
1469 void Advance() { 1469 void Advance() {
1470 ASSERT(!Done()); 1470 ASSERT(!Done());
1471 current_ = current_->previous(); 1471 current_ = current_->previous();
1472 } 1472 }
1473 1473
1474 bool Done() const { return current_ == block_entry_; } 1474 bool Done() const { return current_ == block_entry_; }
1475 1475
1476 void RemoveCurrentFromGraph();
1477
1476 Instruction* Current() const { return current_; } 1478 Instruction* Current() const { return current_; }
1477 1479
1478 private: 1480 private:
1479 BlockEntryInstr* block_entry_; 1481 BlockEntryInstr* block_entry_;
1480 Instruction* current_; 1482 Instruction* current_;
1481 }; 1483 };
1482 1484
1483 1485
1484 class GraphEntryInstr : public BlockEntryInstr { 1486 class GraphEntryInstr : public BlockEntryInstr {
1485 public: 1487 public:
(...skipping 2265 matching lines...) Expand 10 before | Expand all | Expand 10 after
3751 3753
3752 void set_is_initialization(bool value) { is_initialization_ = value; } 3754 void set_is_initialization(bool value) { is_initialization_ = value; }
3753 3755
3754 enum { 3756 enum {
3755 kInstancePos = 0, 3757 kInstancePos = 0,
3756 kValuePos = 1 3758 kValuePos = 1
3757 }; 3759 };
3758 3760
3759 Value* instance() const { return inputs_[kInstancePos]; } 3761 Value* instance() const { return inputs_[kInstancePos]; }
3760 Value* value() const { return inputs_[kValuePos]; } 3762 Value* value() const { return inputs_[kValuePos]; }
3763 bool is_initialization() const { return is_initialization_; }
3761 virtual intptr_t token_pos() const { return token_pos_; } 3764 virtual intptr_t token_pos() const { return token_pos_; }
3762 3765
3763 virtual CompileType* ComputeInitialType() const; 3766 virtual CompileType* ComputeInitialType() const;
3764 3767
3765 const Field& field() const { return field_; } 3768 const Field& field() const { return field_; }
3766 intptr_t offset_in_bytes() const { return offset_in_bytes_; } 3769 intptr_t offset_in_bytes() const { return offset_in_bytes_; }
3767 3770
3768 bool ShouldEmitStoreBarrier() const { 3771 bool ShouldEmitStoreBarrier() const {
3769 return value()->NeedsStoreBuffer() 3772 return value()->NeedsStoreBuffer()
3770 && (emit_store_barrier_ == kEmitStoreBarrier); 3773 && (emit_store_barrier_ == kEmitStoreBarrier);
(...skipping 4182 matching lines...) Expand 10 before | Expand all | Expand 10 after
7953 ForwardInstructionIterator* current_iterator_; 7956 ForwardInstructionIterator* current_iterator_;
7954 7957
7955 private: 7958 private:
7956 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 7959 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
7957 }; 7960 };
7958 7961
7959 7962
7960 } // namespace dart 7963 } // namespace dart
7961 7964
7962 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 7965 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698