| 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 }; | 249 }; |
| 250 | 250 |
| 251 #undef DECLARE_VALUE | 251 #undef DECLARE_VALUE |
| 252 | 252 |
| 253 | 253 |
| 254 class AssertAssignableComp : public Computation { | 254 class AssertAssignableComp : public Computation { |
| 255 public: | 255 public: |
| 256 AssertAssignableComp(intptr_t token_index, | 256 AssertAssignableComp(intptr_t token_index, |
| 257 intptr_t try_index, | 257 intptr_t try_index, |
| 258 Value* value, | 258 Value* value, |
| 259 Value* instantiator, // Can be NULL. |
| 259 Value* instantiator_type_arguments, // Can be NULL. | 260 Value* instantiator_type_arguments, // Can be NULL. |
| 260 const AbstractType& dst_type, | 261 const AbstractType& dst_type, |
| 261 const String& dst_name) | 262 const String& dst_name) |
| 262 : token_index_(token_index), | 263 : token_index_(token_index), |
| 263 try_index_(try_index), | 264 try_index_(try_index), |
| 264 value_(value), | 265 value_(value), |
| 266 instantiator_(instantiator), |
| 265 instantiator_type_arguments_(instantiator_type_arguments), | 267 instantiator_type_arguments_(instantiator_type_arguments), |
| 266 dst_type_(dst_type), | 268 dst_type_(dst_type), |
| 267 dst_name_(dst_name) { | 269 dst_name_(dst_name) { |
| 268 ASSERT(value_ != NULL); | 270 ASSERT(value_ != NULL); |
| 269 ASSERT(!dst_type.IsNull()); | 271 ASSERT(!dst_type.IsNull()); |
| 270 ASSERT(!dst_name.IsNull()); | 272 ASSERT(!dst_name.IsNull()); |
| 271 } | 273 } |
| 272 | 274 |
| 273 DECLARE_COMPUTATION(AssertAssignable) | 275 DECLARE_COMPUTATION(AssertAssignable) |
| 274 | 276 |
| 275 intptr_t token_index() const { return token_index_; } | 277 intptr_t token_index() const { return token_index_; } |
| 276 intptr_t try_index() const { return try_index_; } | 278 intptr_t try_index() const { return try_index_; } |
| 277 Value* value() const { return value_; } | 279 Value* value() const { return value_; } |
| 280 Value* instantiator() const { return instantiator_; } |
| 278 Value* instantiator_type_arguments() const { | 281 Value* instantiator_type_arguments() const { |
| 279 return instantiator_type_arguments_; | 282 return instantiator_type_arguments_; |
| 280 } | 283 } |
| 281 const AbstractType& dst_type() const { return dst_type_; } | 284 const AbstractType& dst_type() const { return dst_type_; } |
| 282 const String& dst_name() const { return dst_name_; } | 285 const String& dst_name() const { return dst_name_; } |
| 283 | 286 |
| 284 virtual intptr_t InputCount() const; | 287 virtual intptr_t InputCount() const; |
| 285 virtual Value* InputAt(intptr_t i) const { | 288 virtual Value* InputAt(intptr_t i) const { |
| 286 if (i == 0) return value(); | 289 if (i == 0) return value(); |
| 287 if (i == 1) return instantiator_type_arguments(); | 290 if (i == 1) return instantiator_type_arguments(); |
| 288 return NULL; | 291 return NULL; |
| 289 } | 292 } |
| 290 | 293 |
| 291 virtual void PrintOperandsTo(BufferFormatter* f) const; | 294 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 292 | 295 |
| 293 private: | 296 private: |
| 294 const intptr_t token_index_; | 297 const intptr_t token_index_; |
| 295 const intptr_t try_index_; | 298 const intptr_t try_index_; |
| 296 Value* value_; | 299 Value* value_; |
| 300 Value* instantiator_; |
| 297 Value* instantiator_type_arguments_; | 301 Value* instantiator_type_arguments_; |
| 298 const AbstractType& dst_type_; | 302 const AbstractType& dst_type_; |
| 299 const String& dst_name_; | 303 const String& dst_name_; |
| 300 | 304 |
| 301 DISALLOW_COPY_AND_ASSIGN(AssertAssignableComp); | 305 DISALLOW_COPY_AND_ASSIGN(AssertAssignableComp); |
| 302 }; | 306 }; |
| 303 | 307 |
| 304 | 308 |
| 305 class AssertBooleanComp : public TemplateComputation<1> { | 309 class AssertBooleanComp : public TemplateComputation<1> { |
| 306 public: | 310 public: |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 private: | 826 private: |
| 823 DISALLOW_COPY_AND_ASSIGN(BooleanNegateComp); | 827 DISALLOW_COPY_AND_ASSIGN(BooleanNegateComp); |
| 824 }; | 828 }; |
| 825 | 829 |
| 826 | 830 |
| 827 class InstanceOfComp : public Computation { | 831 class InstanceOfComp : public Computation { |
| 828 public: | 832 public: |
| 829 InstanceOfComp(intptr_t token_index, | 833 InstanceOfComp(intptr_t token_index, |
| 830 intptr_t try_index, | 834 intptr_t try_index, |
| 831 Value* value, | 835 Value* value, |
| 836 Value* instantiator, // Can be NULL. |
| 832 Value* type_arguments, // Can be NULL. | 837 Value* type_arguments, // Can be NULL. |
| 833 const AbstractType& type, | 838 const AbstractType& type, |
| 834 bool negate_result) | 839 bool negate_result) |
| 835 : token_index_(token_index), | 840 : token_index_(token_index), |
| 836 try_index_(try_index), | 841 try_index_(try_index), |
| 837 value_(value), | 842 value_(value), |
| 843 instantiator_(instantiator), |
| 838 type_arguments_(type_arguments), | 844 type_arguments_(type_arguments), |
| 839 type_(type), | 845 type_(type), |
| 840 negate_result_(negate_result) { | 846 negate_result_(negate_result) { |
| 841 ASSERT(value_ != NULL); | 847 ASSERT(value_ != NULL); |
| 842 ASSERT(!type.IsNull()); | 848 ASSERT(!type.IsNull()); |
| 843 } | 849 } |
| 844 | 850 |
| 845 DECLARE_COMPUTATION(InstanceOf) | 851 DECLARE_COMPUTATION(InstanceOf) |
| 846 | 852 |
| 847 Value* value() const { return value_; } | 853 Value* value() const { return value_; } |
| 854 Value* instantiator() const { return instantiator_; } |
| 848 Value* type_arguments() const { return type_arguments_; } | 855 Value* type_arguments() const { return type_arguments_; } |
| 849 bool negate_result() const { return negate_result_; } | 856 bool negate_result() const { return negate_result_; } |
| 850 const AbstractType& type() const { return type_; } | 857 const AbstractType& type() const { return type_; } |
| 851 intptr_t token_index() const { return token_index_; } | 858 intptr_t token_index() const { return token_index_; } |
| 852 intptr_t try_index() const { return try_index_; } | 859 intptr_t try_index() const { return try_index_; } |
| 853 | 860 |
| 854 virtual intptr_t InputCount() const; | 861 virtual intptr_t InputCount() const; |
| 855 virtual Value* InputAt(intptr_t i) const { | 862 virtual Value* InputAt(intptr_t i) const { |
| 856 if (i == 0) return value(); | 863 if (i == 0) return value(); |
| 857 if (i == 1) return type_arguments(); | 864 if (i == 1) return type_arguments(); |
| 858 return NULL; | 865 return NULL; |
| 859 } | 866 } |
| 860 | 867 |
| 861 virtual void PrintOperandsTo(BufferFormatter* f) const; | 868 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 862 | 869 |
| 863 private: | 870 private: |
| 864 const intptr_t token_index_; | 871 const intptr_t token_index_; |
| 865 const intptr_t try_index_; | 872 const intptr_t try_index_; |
| 866 Value* value_; | 873 Value* value_; |
| 874 Value* instantiator_; |
| 867 Value* type_arguments_; | 875 Value* type_arguments_; |
| 868 const AbstractType& type_; | 876 const AbstractType& type_; |
| 869 const bool negate_result_; | 877 const bool negate_result_; |
| 870 | 878 |
| 871 DISALLOW_COPY_AND_ASSIGN(InstanceOfComp); | 879 DISALLOW_COPY_AND_ASSIGN(InstanceOfComp); |
| 872 }; | 880 }; |
| 873 | 881 |
| 874 | 882 |
| 875 class AllocateObjectComp : public Computation { | 883 class AllocateObjectComp : public Computation { |
| 876 public: | 884 public: |
| (...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1798 const GrowableArray<BlockEntryInstr*>& block_order_; | 1806 const GrowableArray<BlockEntryInstr*>& block_order_; |
| 1799 | 1807 |
| 1800 private: | 1808 private: |
| 1801 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 1809 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 1802 }; | 1810 }; |
| 1803 | 1811 |
| 1804 | 1812 |
| 1805 } // namespace dart | 1813 } // namespace dart |
| 1806 | 1814 |
| 1807 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 1815 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |