Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1103 intptr_t phi_count_; | 1103 intptr_t phi_count_; |
| 1104 | 1104 |
| 1105 DISALLOW_COPY_AND_ASSIGN(JoinEntryInstr); | 1105 DISALLOW_COPY_AND_ASSIGN(JoinEntryInstr); |
| 1106 }; | 1106 }; |
| 1107 | 1107 |
| 1108 | 1108 |
| 1109 class PhiIterator : public ValueObject { | 1109 class PhiIterator : public ValueObject { |
| 1110 public: | 1110 public: |
| 1111 explicit PhiIterator(JoinEntryInstr* join) | 1111 explicit PhiIterator(JoinEntryInstr* join) |
| 1112 : phis_(join->phis()), index_(-1) { | 1112 : phis_(join->phis()), index_(-1) { |
| 1113 if (!Done()) Advance(); // Advance to the first smi. | 1113 if (!Done()) Advance(); // Advance to the first phi. |
|
Vyacheslav Egorov (Google)
2013/02/20 16:05:37
nice!
| |
| 1114 } | 1114 } |
| 1115 | 1115 |
| 1116 void Advance() { | 1116 void Advance() { |
| 1117 ASSERT(!Done()); | 1117 ASSERT(!Done()); |
| 1118 do { | 1118 do { |
| 1119 index_++; | 1119 index_++; |
| 1120 } while (!Done() && (Current() == NULL)); | 1120 } while (!Done() && (Current() == NULL)); |
| 1121 } | 1121 } |
| 1122 | 1122 |
| 1123 bool Done() const { | 1123 bool Done() const { |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1351 | 1351 |
| 1352 void SetInputAt(intptr_t i, Value* value) { inputs_[i] = value; } | 1352 void SetInputAt(intptr_t i, Value* value) { inputs_[i] = value; } |
| 1353 | 1353 |
| 1354 virtual bool CanDeoptimize() const { return false; } | 1354 virtual bool CanDeoptimize() const { return false; } |
| 1355 | 1355 |
| 1356 virtual bool HasSideEffect() const { return false; } | 1356 virtual bool HasSideEffect() const { return false; } |
| 1357 | 1357 |
| 1358 // Phi is alive if it reaches a non-environment use. | 1358 // Phi is alive if it reaches a non-environment use. |
| 1359 bool is_alive() const { return is_alive_; } | 1359 bool is_alive() const { return is_alive_; } |
| 1360 void mark_alive() { is_alive_ = true; } | 1360 void mark_alive() { is_alive_ = true; } |
| 1361 void mark_dead() { is_alive_ = false; } | |
| 1362 | 1361 |
| 1363 virtual Representation RequiredInputRepresentation(intptr_t i) const { | 1362 virtual Representation RequiredInputRepresentation(intptr_t i) const { |
| 1364 return representation_; | 1363 return representation_; |
| 1365 } | 1364 } |
| 1366 | 1365 |
| 1367 virtual Representation representation() const { | 1366 virtual Representation representation() const { |
| 1368 return representation_; | 1367 return representation_; |
| 1369 } | 1368 } |
| 1370 | 1369 |
| 1371 virtual void set_representation(Representation r) { | 1370 virtual void set_representation(Representation r) { |
| (...skipping 3098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4470 ForwardInstructionIterator* current_iterator_; | 4469 ForwardInstructionIterator* current_iterator_; |
| 4471 | 4470 |
| 4472 private: | 4471 private: |
| 4473 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 4472 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 4474 }; | 4473 }; |
| 4475 | 4474 |
| 4476 | 4475 |
| 4477 } // namespace dart | 4476 } // namespace dart |
| 4478 | 4477 |
| 4479 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 4478 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |