Chromium Code Reviews| 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 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1172 virtual bool CanDeoptimize() const { return false; } | 1172 virtual bool CanDeoptimize() const { return false; } |
| 1173 | 1173 |
| 1174 private: | 1174 private: |
| 1175 const ConstructorCallNode& ast_node_; | 1175 const ConstructorCallNode& ast_node_; |
| 1176 const intptr_t try_index_; | 1176 const intptr_t try_index_; |
| 1177 ZoneGrowableArray<Value*>* const arguments_; | 1177 ZoneGrowableArray<Value*>* const arguments_; |
| 1178 DISALLOW_COPY_AND_ASSIGN(AllocateObjectWithBoundsCheckComp); | 1178 DISALLOW_COPY_AND_ASSIGN(AllocateObjectWithBoundsCheckComp); |
| 1179 }; | 1179 }; |
| 1180 | 1180 |
| 1181 | 1181 |
| 1182 class CreateArrayComp : public TemplateComputation<1> { | 1182 class CreateArrayComp : public Computation { |
| 1183 public: | 1183 public: |
| 1184 CreateArrayComp(intptr_t token_pos, | 1184 CreateArrayComp(intptr_t token_pos, |
| 1185 intptr_t try_index, | 1185 intptr_t try_index, |
| 1186 ZoneGrowableArray<Value*>* elements, | 1186 ZoneGrowableArray<Value*>* elements, |
| 1187 Value* element_type) | 1187 Value* element_type) |
| 1188 : token_pos_(token_pos), | 1188 : token_pos_(token_pos), |
| 1189 try_index_(try_index), | 1189 try_index_(try_index), |
| 1190 elements_(elements) { | 1190 elements_(elements) { |
| 1191 #if defined(DEBUG) | 1191 #if defined(DEBUG) |
| 1192 for (int i = 0; i < ElementCount(); ++i) { | 1192 for (int i = 0; i < ElementCount(); ++i) { |
| 1193 ASSERT(ElementAt(i) != NULL); | 1193 ASSERT(ElementAt(i) != NULL); |
| 1194 } | 1194 } |
| 1195 ASSERT(element_type != NULL); | 1195 ASSERT(element_type != NULL); |
| 1196 #endif | 1196 #endif |
|
srdjan
2012/08/06 16:31:25
This CL causes crashes as element_type is never se
Florian Schneider
2012/08/07 08:56:18
Oh, thanks. It worked because elements_type_ seems
| |
| 1197 inputs_[0] = element_type; | |
| 1198 } | 1197 } |
| 1199 | 1198 |
| 1200 DECLARE_COMPUTATION(CreateArray) | 1199 DECLARE_CALL_COMPUTATION(CreateArray) |
| 1200 | |
| 1201 virtual intptr_t ArgumentCount() const { return ElementCount() + 1; } | |
| 1201 | 1202 |
| 1202 intptr_t token_pos() const { return token_pos_; } | 1203 intptr_t token_pos() const { return token_pos_; } |
| 1203 intptr_t try_index() const { return try_index_; } | 1204 intptr_t try_index() const { return try_index_; } |
| 1204 intptr_t ElementCount() const { return elements_->length(); } | 1205 intptr_t ElementCount() const { return elements_->length(); } |
| 1205 Value* ElementAt(intptr_t i) const { return (*elements_)[i]; } | 1206 Value* ElementAt(intptr_t i) const { return (*elements_)[i]; } |
| 1206 Value* element_type() const { return inputs_[0]; } | 1207 Value* element_type() const { return element_type_; } |
| 1207 | |
| 1208 virtual intptr_t InputCount() const; | |
| 1209 virtual Value* InputAt(intptr_t i) const; | |
| 1210 virtual void SetInputAt(intptr_t i, Value* value); | |
| 1211 | 1208 |
| 1212 virtual void PrintOperandsTo(BufferFormatter* f) const; | 1209 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 1213 | 1210 |
| 1214 virtual bool CanDeoptimize() const { return false; } | 1211 virtual bool CanDeoptimize() const { return false; } |
| 1215 | 1212 |
| 1216 private: | 1213 private: |
| 1217 const intptr_t token_pos_; | 1214 const intptr_t token_pos_; |
| 1218 const intptr_t try_index_; | 1215 const intptr_t try_index_; |
| 1219 ZoneGrowableArray<Value*>* const elements_; | 1216 ZoneGrowableArray<Value*>* const elements_; |
| 1217 Value* element_type_; | |
| 1220 | 1218 |
| 1221 DISALLOW_COPY_AND_ASSIGN(CreateArrayComp); | 1219 DISALLOW_COPY_AND_ASSIGN(CreateArrayComp); |
| 1222 }; | 1220 }; |
| 1223 | 1221 |
| 1224 | 1222 |
| 1225 class CreateClosureComp : public Computation { | 1223 class CreateClosureComp : public Computation { |
| 1226 public: | 1224 public: |
| 1227 CreateClosureComp(ClosureNode* node, | 1225 CreateClosureComp(ClosureNode* node, |
| 1228 intptr_t try_index, | 1226 intptr_t try_index, |
| 1229 ZoneGrowableArray<PushArgumentInstr*>* arguments) | 1227 ZoneGrowableArray<PushArgumentInstr*>* arguments) |
| (...skipping 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2752 const GrowableArray<BlockEntryInstr*>& block_order_; | 2750 const GrowableArray<BlockEntryInstr*>& block_order_; |
| 2753 | 2751 |
| 2754 private: | 2752 private: |
| 2755 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 2753 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 2756 }; | 2754 }; |
| 2757 | 2755 |
| 2758 | 2756 |
| 2759 } // namespace dart | 2757 } // namespace dart |
| 2760 | 2758 |
| 2761 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 2759 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |