| 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 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1335 | 1335 |
| 1336 DISALLOW_COPY_AND_ASSIGN(AllocateObjectWithBoundsCheckComp); | 1336 DISALLOW_COPY_AND_ASSIGN(AllocateObjectWithBoundsCheckComp); |
| 1337 }; | 1337 }; |
| 1338 | 1338 |
| 1339 | 1339 |
| 1340 class CreateArrayComp : public TemplateComputation<1> { | 1340 class CreateArrayComp : public TemplateComputation<1> { |
| 1341 public: | 1341 public: |
| 1342 CreateArrayComp(intptr_t token_pos, | 1342 CreateArrayComp(intptr_t token_pos, |
| 1343 intptr_t try_index, | 1343 intptr_t try_index, |
| 1344 ZoneGrowableArray<PushArgumentInstr*>* arguments, | 1344 ZoneGrowableArray<PushArgumentInstr*>* arguments, |
| 1345 const AbstractType& type, |
| 1345 Value* element_type) | 1346 Value* element_type) |
| 1346 : token_pos_(token_pos), | 1347 : token_pos_(token_pos), |
| 1347 try_index_(try_index), | 1348 try_index_(try_index), |
| 1348 arguments_(arguments) { | 1349 arguments_(arguments), |
| 1350 type_(type) { |
| 1349 #if defined(DEBUG) | 1351 #if defined(DEBUG) |
| 1350 for (int i = 0; i < ArgumentCount(); ++i) { | 1352 for (int i = 0; i < ArgumentCount(); ++i) { |
| 1351 ASSERT(ArgumentAt(i) != NULL); | 1353 ASSERT(ArgumentAt(i) != NULL); |
| 1352 } | 1354 } |
| 1353 ASSERT(element_type != NULL); | 1355 ASSERT(element_type != NULL); |
| 1356 ASSERT(type_.IsZoneHandle()); |
| 1357 ASSERT(!type_.IsNull()); |
| 1358 ASSERT(type_.IsFinalized()); |
| 1354 #endif | 1359 #endif |
| 1355 inputs_[0] = element_type; | 1360 inputs_[0] = element_type; |
| 1356 } | 1361 } |
| 1357 | 1362 |
| 1358 DECLARE_CALL_COMPUTATION(CreateArray) | 1363 DECLARE_CALL_COMPUTATION(CreateArray) |
| 1359 | 1364 |
| 1360 virtual intptr_t ArgumentCount() const { return arguments_->length(); } | 1365 virtual intptr_t ArgumentCount() const { return arguments_->length(); } |
| 1361 | 1366 |
| 1362 intptr_t token_pos() const { return token_pos_; } | 1367 intptr_t token_pos() const { return token_pos_; } |
| 1363 intptr_t try_index() const { return try_index_; } | 1368 intptr_t try_index() const { return try_index_; } |
| 1364 PushArgumentInstr* ArgumentAt(intptr_t i) const { return (*arguments_)[i]; } | 1369 PushArgumentInstr* ArgumentAt(intptr_t i) const { return (*arguments_)[i]; } |
| 1370 const AbstractType& type() const { return type_; } |
| 1365 Value* element_type() const { return inputs_[0]; } | 1371 Value* element_type() const { return inputs_[0]; } |
| 1366 | 1372 |
| 1367 virtual void PrintOperandsTo(BufferFormatter* f) const; | 1373 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 1368 | 1374 |
| 1369 virtual bool CanDeoptimize() const { return false; } | 1375 virtual bool CanDeoptimize() const { return false; } |
| 1370 | 1376 |
| 1371 private: | 1377 private: |
| 1372 const intptr_t token_pos_; | 1378 const intptr_t token_pos_; |
| 1373 const intptr_t try_index_; | 1379 const intptr_t try_index_; |
| 1374 ZoneGrowableArray<PushArgumentInstr*>* const arguments_; | 1380 ZoneGrowableArray<PushArgumentInstr*>* const arguments_; |
| 1381 const AbstractType& type_; |
| 1375 | 1382 |
| 1376 DISALLOW_COPY_AND_ASSIGN(CreateArrayComp); | 1383 DISALLOW_COPY_AND_ASSIGN(CreateArrayComp); |
| 1377 }; | 1384 }; |
| 1378 | 1385 |
| 1379 | 1386 |
| 1380 class CreateClosureComp : public TemplateComputation<0> { | 1387 class CreateClosureComp : public TemplateComputation<0> { |
| 1381 public: | 1388 public: |
| 1382 CreateClosureComp(ClosureNode* node, | 1389 CreateClosureComp(ClosureNode* node, |
| 1383 intptr_t try_index, | 1390 intptr_t try_index, |
| 1384 ZoneGrowableArray<PushArgumentInstr*>* arguments) | 1391 ZoneGrowableArray<PushArgumentInstr*>* arguments) |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1484 | 1491 |
| 1485 class InstantiateTypeArgumentsComp : public TemplateComputation<1> { | 1492 class InstantiateTypeArgumentsComp : public TemplateComputation<1> { |
| 1486 public: | 1493 public: |
| 1487 InstantiateTypeArgumentsComp(intptr_t token_pos, | 1494 InstantiateTypeArgumentsComp(intptr_t token_pos, |
| 1488 intptr_t try_index, | 1495 intptr_t try_index, |
| 1489 const AbstractTypeArguments& type_arguments, | 1496 const AbstractTypeArguments& type_arguments, |
| 1490 Value* instantiator) | 1497 Value* instantiator) |
| 1491 : token_pos_(token_pos), | 1498 : token_pos_(token_pos), |
| 1492 try_index_(try_index), | 1499 try_index_(try_index), |
| 1493 type_arguments_(type_arguments) { | 1500 type_arguments_(type_arguments) { |
| 1501 ASSERT(type_arguments.IsZoneHandle()); |
| 1494 ASSERT(instantiator != NULL); | 1502 ASSERT(instantiator != NULL); |
| 1495 inputs_[0] = instantiator; | 1503 inputs_[0] = instantiator; |
| 1496 } | 1504 } |
| 1497 | 1505 |
| 1498 DECLARE_COMPUTATION(InstantiateTypeArguments) | 1506 DECLARE_COMPUTATION(InstantiateTypeArguments) |
| 1499 | 1507 |
| 1500 Value* instantiator() const { return inputs_[0]; } | 1508 Value* instantiator() const { return inputs_[0]; } |
| 1501 const AbstractTypeArguments& type_arguments() const { | 1509 const AbstractTypeArguments& type_arguments() const { |
| 1502 return type_arguments_; | 1510 return type_arguments_; |
| 1503 } | 1511 } |
| (...skipping 1773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3277 ForwardInstructionIterator* current_iterator_; | 3285 ForwardInstructionIterator* current_iterator_; |
| 3278 | 3286 |
| 3279 private: | 3287 private: |
| 3280 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 3288 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 3281 }; | 3289 }; |
| 3282 | 3290 |
| 3283 | 3291 |
| 3284 } // namespace dart | 3292 } // namespace dart |
| 3285 | 3293 |
| 3286 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 3294 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |