OLD | NEW |
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 #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 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 DISALLOW_COPY_AND_ASSIGN(Definition); | 1155 DISALLOW_COPY_AND_ASSIGN(Definition); |
1156 }; | 1156 }; |
1157 | 1157 |
1158 | 1158 |
1159 class PhiInstr : public Definition { | 1159 class PhiInstr : public Definition { |
1160 public: | 1160 public: |
1161 explicit PhiInstr(JoinEntryInstr* block, intptr_t num_inputs) | 1161 explicit PhiInstr(JoinEntryInstr* block, intptr_t num_inputs) |
1162 : block_(block), | 1162 : block_(block), |
1163 inputs_(num_inputs), | 1163 inputs_(num_inputs), |
1164 is_alive_(false), | 1164 is_alive_(false), |
1165 representation_(kTagged) { | 1165 representation_(kTagged), |
| 1166 reaching_defs_(NULL) { |
1166 for (intptr_t i = 0; i < num_inputs; ++i) { | 1167 for (intptr_t i = 0; i < num_inputs; ++i) { |
1167 inputs_.Add(NULL); | 1168 inputs_.Add(NULL); |
1168 } | 1169 } |
1169 } | 1170 } |
1170 | 1171 |
1171 // Get the block entry for that instruction. | 1172 // Get the block entry for that instruction. |
1172 virtual BlockEntryInstr* GetBlock() const { return block(); } | 1173 virtual BlockEntryInstr* GetBlock() const { return block(); } |
1173 JoinEntryInstr* block() const { return block_; } | 1174 JoinEntryInstr* block() const { return block_; } |
1174 | 1175 |
1175 virtual RawAbstractType* CompileType() const; | 1176 virtual RawAbstractType* CompileType() const; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1216 UNREACHABLE(); | 1217 UNREACHABLE(); |
1217 return kIllegalCid; | 1218 return kIllegalCid; |
1218 } | 1219 } |
1219 | 1220 |
1220 DECLARE_INSTRUCTION(Phi) | 1221 DECLARE_INSTRUCTION(Phi) |
1221 | 1222 |
1222 virtual void PrintTo(BufferFormatter* f) const; | 1223 virtual void PrintTo(BufferFormatter* f) const; |
1223 | 1224 |
1224 virtual void InferRange(); | 1225 virtual void InferRange(); |
1225 | 1226 |
| 1227 BitVector* reaching_defs() const { |
| 1228 return reaching_defs_; |
| 1229 } |
| 1230 |
| 1231 void set_reaching_defs(BitVector* reaching_defs) { |
| 1232 reaching_defs_ = reaching_defs; |
| 1233 } |
| 1234 |
1226 private: | 1235 private: |
1227 friend class ConstantPropagator; // Direct access to inputs_. | 1236 friend class ConstantPropagator; // Direct access to inputs_. |
1228 | 1237 |
1229 JoinEntryInstr* block_; | 1238 JoinEntryInstr* block_; |
1230 GrowableArray<Value*> inputs_; | 1239 GrowableArray<Value*> inputs_; |
1231 bool is_alive_; | 1240 bool is_alive_; |
1232 Representation representation_; | 1241 Representation representation_; |
1233 | 1242 |
| 1243 BitVector* reaching_defs_; |
| 1244 |
1234 DISALLOW_COPY_AND_ASSIGN(PhiInstr); | 1245 DISALLOW_COPY_AND_ASSIGN(PhiInstr); |
1235 }; | 1246 }; |
1236 | 1247 |
1237 | 1248 |
1238 class ParameterInstr : public Definition { | 1249 class ParameterInstr : public Definition { |
1239 public: | 1250 public: |
1240 explicit ParameterInstr(intptr_t index, GraphEntryInstr* block) | 1251 explicit ParameterInstr(intptr_t index, GraphEntryInstr* block) |
1241 : index_(index), block_(block) { } | 1252 : index_(index), block_(block) { } |
1242 | 1253 |
1243 DECLARE_INSTRUCTION(Parameter) | 1254 DECLARE_INSTRUCTION(Parameter) |
(...skipping 2997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4241 ForwardInstructionIterator* current_iterator_; | 4252 ForwardInstructionIterator* current_iterator_; |
4242 | 4253 |
4243 private: | 4254 private: |
4244 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 4255 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
4245 }; | 4256 }; |
4246 | 4257 |
4247 | 4258 |
4248 } // namespace dart | 4259 } // namespace dart |
4249 | 4260 |
4250 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 4261 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
OLD | NEW |