| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 136 |
| 137 #undef DECLARE_VALUE | 137 #undef DECLARE_VALUE |
| 138 | 138 |
| 139 | 139 |
| 140 class AssertAssignableComp : public Computation { | 140 class AssertAssignableComp : public Computation { |
| 141 public: | 141 public: |
| 142 AssertAssignableComp(intptr_t node_id, | 142 AssertAssignableComp(intptr_t node_id, |
| 143 intptr_t token_index, | 143 intptr_t token_index, |
| 144 intptr_t try_index, | 144 intptr_t try_index, |
| 145 Value* value, | 145 Value* value, |
| 146 Value* type_arguments, // Can be NULL. | 146 Value* instantiator_type_arguments, // Can be NULL. |
| 147 const AbstractType& dst_type, | 147 const AbstractType& dst_type, |
| 148 const String& dst_name) | 148 const String& dst_name) |
| 149 : node_id_(node_id), | 149 : node_id_(node_id), |
| 150 token_index_(token_index), | 150 token_index_(token_index), |
| 151 try_index_(try_index), | 151 try_index_(try_index), |
| 152 value_(value), | 152 value_(value), |
| 153 type_arguments_(type_arguments), | 153 instantiator_type_arguments_(instantiator_type_arguments), |
| 154 dst_type_(dst_type), | 154 dst_type_(dst_type), |
| 155 dst_name_(dst_name) { | 155 dst_name_(dst_name) { |
| 156 ASSERT(value_ != NULL); | 156 ASSERT(value_ != NULL); |
| 157 ASSERT(!dst_type.IsNull()); | 157 ASSERT(!dst_type.IsNull()); |
| 158 ASSERT(!dst_name.IsNull()); | 158 ASSERT(!dst_name.IsNull()); |
| 159 } | 159 } |
| 160 | 160 |
| 161 DECLARE_COMPUTATION(AssertAssignable) | 161 DECLARE_COMPUTATION(AssertAssignable) |
| 162 | 162 |
| 163 intptr_t node_id() const { return node_id_; } | 163 intptr_t node_id() const { return node_id_; } |
| 164 intptr_t token_index() const { return token_index_; } | 164 intptr_t token_index() const { return token_index_; } |
| 165 intptr_t try_index() const { return try_index_; } | 165 intptr_t try_index() const { return try_index_; } |
| 166 Value* value() const { return value_; } | 166 Value* value() const { return value_; } |
| 167 Value* type_arguments() const { return type_arguments_; } | 167 Value* instantiator_type_arguments() const { |
| 168 return instantiator_type_arguments_; |
| 169 } |
| 168 const AbstractType& dst_type() const { return dst_type_; } | 170 const AbstractType& dst_type() const { return dst_type_; } |
| 169 const String& dst_name() const { return dst_name_; } | 171 const String& dst_name() const { return dst_name_; } |
| 170 | 172 |
| 171 private: | 173 private: |
| 172 const intptr_t node_id_; | 174 const intptr_t node_id_; |
| 173 const intptr_t token_index_; | 175 const intptr_t token_index_; |
| 174 const intptr_t try_index_; | 176 const intptr_t try_index_; |
| 175 Value* value_; | 177 Value* value_; |
| 176 Value* type_arguments_; | 178 Value* instantiator_type_arguments_; |
| 177 const AbstractType& dst_type_; | 179 const AbstractType& dst_type_; |
| 178 const String& dst_name_; | 180 const String& dst_name_; |
| 179 | 181 |
| 180 DISALLOW_COPY_AND_ASSIGN(AssertAssignableComp); | 182 DISALLOW_COPY_AND_ASSIGN(AssertAssignableComp); |
| 181 }; | 183 }; |
| 182 | 184 |
| 183 | 185 |
| 184 class AssertBooleanComp : public Computation { | 186 class AssertBooleanComp : public Computation { |
| 185 public: | 187 public: |
| 186 AssertBooleanComp(intptr_t node_id, | 188 AssertBooleanComp(intptr_t node_id, |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 ZoneGrowableArray<Value*>* const arguments_; | 762 ZoneGrowableArray<Value*>* const arguments_; |
| 761 DISALLOW_COPY_AND_ASSIGN(AllocateObjectComp); | 763 DISALLOW_COPY_AND_ASSIGN(AllocateObjectComp); |
| 762 }; | 764 }; |
| 763 | 765 |
| 764 | 766 |
| 765 class CreateArrayComp : public Computation { | 767 class CreateArrayComp : public Computation { |
| 766 public: | 768 public: |
| 767 CreateArrayComp(ArrayNode* node, | 769 CreateArrayComp(ArrayNode* node, |
| 768 intptr_t try_index, | 770 intptr_t try_index, |
| 769 ZoneGrowableArray<Value*>* elements) | 771 ZoneGrowableArray<Value*>* elements) |
| 770 : ast_node_(*node), try_index_(try_index), elements_(elements) { } | 772 : ast_node_(*node), try_index_(try_index), elements_(elements) { |
| 773 #if defined(DEBUG) |
| 774 for (int i = 0; i < ElementCount(); ++i) { |
| 775 ASSERT(ElementAt(i) != NULL); |
| 776 } |
| 777 #endif |
| 778 } |
| 771 | 779 |
| 772 DECLARE_COMPUTATION(CreateArray) | 780 DECLARE_COMPUTATION(CreateArray) |
| 773 | 781 |
| 774 intptr_t token_index() const { return ast_node_.token_index(); } | 782 intptr_t token_index() const { return ast_node_.token_index(); } |
| 775 intptr_t try_index() const { return try_index_; } | 783 intptr_t try_index() const { return try_index_; } |
| 776 const AbstractTypeArguments& type_arguments() const { | 784 const AbstractTypeArguments& type_arguments() const { |
| 777 return ast_node_.type_arguments(); | 785 return ast_node_.type_arguments(); |
| 778 } | 786 } |
| 779 intptr_t ElementCount() const { return elements_->length(); } | 787 intptr_t ElementCount() const { return elements_->length(); } |
| 780 Value* ElementAt(intptr_t i) const { return (*elements_)[i]; } | 788 Value* ElementAt(intptr_t i) const { return (*elements_)[i]; } |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1543 const GrowableArray<BlockEntryInstr*>& block_order_; | 1551 const GrowableArray<BlockEntryInstr*>& block_order_; |
| 1544 | 1552 |
| 1545 private: | 1553 private: |
| 1546 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 1554 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 1547 }; | 1555 }; |
| 1548 | 1556 |
| 1549 | 1557 |
| 1550 } // namespace dart | 1558 } // namespace dart |
| 1551 | 1559 |
| 1552 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 1560 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |