| 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 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1321 | 1321 |
| 1322 DISALLOW_COPY_AND_ASSIGN(AllocateObjectWithBoundsCheckComp); | 1322 DISALLOW_COPY_AND_ASSIGN(AllocateObjectWithBoundsCheckComp); |
| 1323 }; | 1323 }; |
| 1324 | 1324 |
| 1325 | 1325 |
| 1326 class CreateArrayComp : public TemplateComputation<1> { | 1326 class CreateArrayComp : public TemplateComputation<1> { |
| 1327 public: | 1327 public: |
| 1328 CreateArrayComp(intptr_t token_pos, | 1328 CreateArrayComp(intptr_t token_pos, |
| 1329 intptr_t try_index, | 1329 intptr_t try_index, |
| 1330 ZoneGrowableArray<PushArgumentInstr*>* arguments, | 1330 ZoneGrowableArray<PushArgumentInstr*>* arguments, |
| 1331 const AbstractType& type, |
| 1331 Value* element_type) | 1332 Value* element_type) |
| 1332 : token_pos_(token_pos), | 1333 : token_pos_(token_pos), |
| 1333 try_index_(try_index), | 1334 try_index_(try_index), |
| 1334 arguments_(arguments) { | 1335 arguments_(arguments), |
| 1336 type_(type) { |
| 1335 #if defined(DEBUG) | 1337 #if defined(DEBUG) |
| 1336 for (int i = 0; i < ArgumentCount(); ++i) { | 1338 for (int i = 0; i < ArgumentCount(); ++i) { |
| 1337 ASSERT(ArgumentAt(i) != NULL); | 1339 ASSERT(ArgumentAt(i) != NULL); |
| 1338 } | 1340 } |
| 1339 ASSERT(element_type != NULL); | 1341 ASSERT(element_type != NULL); |
| 1342 ASSERT(type_.IsZoneHandle()); |
| 1343 ASSERT(!type_.IsNull()); |
| 1344 ASSERT(type_.IsFinalized()); |
| 1340 #endif | 1345 #endif |
| 1341 inputs_[0] = element_type; | 1346 inputs_[0] = element_type; |
| 1342 } | 1347 } |
| 1343 | 1348 |
| 1344 DECLARE_CALL_COMPUTATION(CreateArray) | 1349 DECLARE_CALL_COMPUTATION(CreateArray) |
| 1345 | 1350 |
| 1346 virtual intptr_t ArgumentCount() const { return arguments_->length(); } | 1351 virtual intptr_t ArgumentCount() const { return arguments_->length(); } |
| 1347 | 1352 |
| 1348 intptr_t token_pos() const { return token_pos_; } | 1353 intptr_t token_pos() const { return token_pos_; } |
| 1349 intptr_t try_index() const { return try_index_; } | 1354 intptr_t try_index() const { return try_index_; } |
| 1350 PushArgumentInstr* ArgumentAt(intptr_t i) const { return (*arguments_)[i]; } | 1355 PushArgumentInstr* ArgumentAt(intptr_t i) const { return (*arguments_)[i]; } |
| 1356 const AbstractType& type() const { return type_; } |
| 1351 Value* element_type() const { return inputs_[0]; } | 1357 Value* element_type() const { return inputs_[0]; } |
| 1352 | 1358 |
| 1353 virtual void PrintOperandsTo(BufferFormatter* f) const; | 1359 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 1354 | 1360 |
| 1355 virtual bool CanDeoptimize() const { return false; } | 1361 virtual bool CanDeoptimize() const { return false; } |
| 1356 | 1362 |
| 1357 private: | 1363 private: |
| 1358 const intptr_t token_pos_; | 1364 const intptr_t token_pos_; |
| 1359 const intptr_t try_index_; | 1365 const intptr_t try_index_; |
| 1360 ZoneGrowableArray<PushArgumentInstr*>* const arguments_; | 1366 ZoneGrowableArray<PushArgumentInstr*>* const arguments_; |
| 1367 const AbstractType& type_; |
| 1361 | 1368 |
| 1362 DISALLOW_COPY_AND_ASSIGN(CreateArrayComp); | 1369 DISALLOW_COPY_AND_ASSIGN(CreateArrayComp); |
| 1363 }; | 1370 }; |
| 1364 | 1371 |
| 1365 | 1372 |
| 1366 class CreateClosureComp : public TemplateComputation<0> { | 1373 class CreateClosureComp : public TemplateComputation<0> { |
| 1367 public: | 1374 public: |
| 1368 CreateClosureComp(ClosureNode* node, | 1375 CreateClosureComp(ClosureNode* node, |
| 1369 intptr_t try_index, | 1376 intptr_t try_index, |
| 1370 ZoneGrowableArray<PushArgumentInstr*>* arguments) | 1377 ZoneGrowableArray<PushArgumentInstr*>* arguments) |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1470 | 1477 |
| 1471 class InstantiateTypeArgumentsComp : public TemplateComputation<1> { | 1478 class InstantiateTypeArgumentsComp : public TemplateComputation<1> { |
| 1472 public: | 1479 public: |
| 1473 InstantiateTypeArgumentsComp(intptr_t token_pos, | 1480 InstantiateTypeArgumentsComp(intptr_t token_pos, |
| 1474 intptr_t try_index, | 1481 intptr_t try_index, |
| 1475 const AbstractTypeArguments& type_arguments, | 1482 const AbstractTypeArguments& type_arguments, |
| 1476 Value* instantiator) | 1483 Value* instantiator) |
| 1477 : token_pos_(token_pos), | 1484 : token_pos_(token_pos), |
| 1478 try_index_(try_index), | 1485 try_index_(try_index), |
| 1479 type_arguments_(type_arguments) { | 1486 type_arguments_(type_arguments) { |
| 1487 ASSERT(type_arguments.IsZoneHandle()); |
| 1480 ASSERT(instantiator != NULL); | 1488 ASSERT(instantiator != NULL); |
| 1481 inputs_[0] = instantiator; | 1489 inputs_[0] = instantiator; |
| 1482 } | 1490 } |
| 1483 | 1491 |
| 1484 DECLARE_COMPUTATION(InstantiateTypeArguments) | 1492 DECLARE_COMPUTATION(InstantiateTypeArguments) |
| 1485 | 1493 |
| 1486 Value* instantiator() const { return inputs_[0]; } | 1494 Value* instantiator() const { return inputs_[0]; } |
| 1487 const AbstractTypeArguments& type_arguments() const { | 1495 const AbstractTypeArguments& type_arguments() const { |
| 1488 return type_arguments_; | 1496 return type_arguments_; |
| 1489 } | 1497 } |
| (...skipping 1645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3135 ForwardInstructionIterator* current_iterator_; | 3143 ForwardInstructionIterator* current_iterator_; |
| 3136 | 3144 |
| 3137 private: | 3145 private: |
| 3138 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 3146 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 3139 }; | 3147 }; |
| 3140 | 3148 |
| 3141 | 3149 |
| 3142 } // namespace dart | 3150 } // namespace dart |
| 3143 | 3151 |
| 3144 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 3152 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |