| 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 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1071 MoveOperands* AddMove(Location dest, Location src) { | 1071 MoveOperands* AddMove(Location dest, Location src) { |
| 1072 MoveOperands* move = new MoveOperands(dest, src); | 1072 MoveOperands* move = new MoveOperands(dest, src); |
| 1073 moves_.Add(move); | 1073 moves_.Add(move); |
| 1074 return move; | 1074 return move; |
| 1075 } | 1075 } |
| 1076 | 1076 |
| 1077 MoveOperands* MoveOperandsAt(intptr_t index) const { return moves_[index]; } | 1077 MoveOperands* MoveOperandsAt(intptr_t index) const { return moves_[index]; } |
| 1078 | 1078 |
| 1079 intptr_t NumMoves() const { return moves_.length(); } | 1079 intptr_t NumMoves() const { return moves_.length(); } |
| 1080 | 1080 |
| 1081 bool IsRedundant() const; |
| 1082 |
| 1081 virtual void PrintTo(BufferFormatter* f) const; | 1083 virtual void PrintTo(BufferFormatter* f) const; |
| 1082 | 1084 |
| 1083 virtual bool MayThrow() const { return false; } | 1085 virtual bool MayThrow() const { return false; } |
| 1084 | 1086 |
| 1085 private: | 1087 private: |
| 1086 GrowableArray<MoveOperands*> moves_; // Elements cannot be null. | 1088 GrowableArray<MoveOperands*> moves_; // Elements cannot be null. |
| 1087 | 1089 |
| 1088 DISALLOW_COPY_AND_ASSIGN(ParallelMoveInstr); | 1090 DISALLOW_COPY_AND_ASSIGN(ParallelMoveInstr); |
| 1089 }; | 1091 }; |
| 1090 | 1092 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1131 void set_last_instruction(Instruction* instr) { last_instruction_ = instr; } | 1133 void set_last_instruction(Instruction* instr) { last_instruction_ = instr; } |
| 1132 | 1134 |
| 1133 ParallelMoveInstr* parallel_move() const { | 1135 ParallelMoveInstr* parallel_move() const { |
| 1134 return parallel_move_; | 1136 return parallel_move_; |
| 1135 } | 1137 } |
| 1136 | 1138 |
| 1137 bool HasParallelMove() const { | 1139 bool HasParallelMove() const { |
| 1138 return parallel_move_ != NULL; | 1140 return parallel_move_ != NULL; |
| 1139 } | 1141 } |
| 1140 | 1142 |
| 1143 bool HasNonRedundantParallelMove() const { |
| 1144 return HasParallelMove() && !parallel_move()->IsRedundant(); |
| 1145 } |
| 1146 |
| 1141 ParallelMoveInstr* GetParallelMove() { | 1147 ParallelMoveInstr* GetParallelMove() { |
| 1142 if (parallel_move_ == NULL) { | 1148 if (parallel_move_ == NULL) { |
| 1143 parallel_move_ = new ParallelMoveInstr(); | 1149 parallel_move_ = new ParallelMoveInstr(); |
| 1144 } | 1150 } |
| 1145 return parallel_move_; | 1151 return parallel_move_; |
| 1146 } | 1152 } |
| 1147 | 1153 |
| 1148 // Discover basic-block structure of the current block. Must be called | 1154 // Discover basic-block structure of the current block. Must be called |
| 1149 // on all graph blocks in preorder to yield valid results. As a side effect, | 1155 // on all graph blocks in preorder to yield valid results. As a side effect, |
| 1150 // the block entry instructions in the graph are assigned preorder numbers. | 1156 // the block entry instructions in the graph are assigned preorder numbers. |
| (...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2160 virtual EffectSet Effects() const { return EffectSet::None(); } | 2166 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 2161 | 2167 |
| 2162 ParallelMoveInstr* parallel_move() const { | 2168 ParallelMoveInstr* parallel_move() const { |
| 2163 return parallel_move_; | 2169 return parallel_move_; |
| 2164 } | 2170 } |
| 2165 | 2171 |
| 2166 bool HasParallelMove() const { | 2172 bool HasParallelMove() const { |
| 2167 return parallel_move_ != NULL; | 2173 return parallel_move_ != NULL; |
| 2168 } | 2174 } |
| 2169 | 2175 |
| 2176 bool HasNonRedundantParallelMove() const { |
| 2177 return HasParallelMove() && !parallel_move()->IsRedundant(); |
| 2178 } |
| 2179 |
| 2170 ParallelMoveInstr* GetParallelMove() { | 2180 ParallelMoveInstr* GetParallelMove() { |
| 2171 if (parallel_move_ == NULL) { | 2181 if (parallel_move_ == NULL) { |
| 2172 parallel_move_ = new ParallelMoveInstr(); | 2182 parallel_move_ = new ParallelMoveInstr(); |
| 2173 } | 2183 } |
| 2174 return parallel_move_; | 2184 return parallel_move_; |
| 2175 } | 2185 } |
| 2176 | 2186 |
| 2177 virtual void PrintTo(BufferFormatter* f) const; | 2187 virtual void PrintTo(BufferFormatter* f) const; |
| 2178 | 2188 |
| 2179 virtual bool MayThrow() const { return false; } | 2189 virtual bool MayThrow() const { return false; } |
| (...skipping 6260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8440 Isolate* isolate, bool opt) const { \ | 8450 Isolate* isolate, bool opt) const { \ |
| 8441 UNIMPLEMENTED(); \ | 8451 UNIMPLEMENTED(); \ |
| 8442 return NULL; \ | 8452 return NULL; \ |
| 8443 } \ | 8453 } \ |
| 8444 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } | 8454 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } |
| 8445 | 8455 |
| 8446 | 8456 |
| 8447 } // namespace dart | 8457 } // namespace dart |
| 8448 | 8458 |
| 8449 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 8459 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |