OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_ | 5 #ifndef RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_ |
6 #define RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_ | 6 #define RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_ |
7 | 7 |
8 #if !defined(DART_PRECOMPILED_RUNTIME) | 8 #if !defined(DART_PRECOMPILED_RUNTIME) |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 void SkipListOfVariableDeclarations(); | 407 void SkipListOfVariableDeclarations(); |
408 void SkipTypeParametersList(); | 408 void SkipTypeParametersList(); |
409 void SkipExpression(); | 409 void SkipExpression(); |
410 void SkipStatement(); | 410 void SkipStatement(); |
411 void SkipFunctionNode(); | 411 void SkipFunctionNode(); |
412 void SkipName(); | 412 void SkipName(); |
413 void SkipArguments(); | 413 void SkipArguments(); |
414 void SkipVariableDeclaration(); | 414 void SkipVariableDeclaration(); |
415 void SkipLibraryCombinator(); | 415 void SkipLibraryCombinator(); |
416 void SkipLibraryDependency(); | 416 void SkipLibraryDependency(); |
| 417 void SkipLibraryPart(); |
417 void SkipLibraryTypedef(); | 418 void SkipLibraryTypedef(); |
418 TokenPosition ReadPosition(bool record = true); | 419 TokenPosition ReadPosition(bool record = true); |
419 void record_token_position(TokenPosition position); | 420 void record_token_position(TokenPosition position); |
420 void record_yield_position(TokenPosition position); | 421 void record_yield_position(TokenPosition position); |
421 Tag ReadTag(uint8_t* payload = NULL); | 422 Tag ReadTag(uint8_t* payload = NULL); |
422 Tag PeekTag(uint8_t* payload = NULL); | 423 Tag PeekTag(uint8_t* payload = NULL); |
423 word ReadFlags(); | 424 word ReadFlags(); |
424 | 425 |
425 void loop_depth_inc(); | 426 void loop_depth_inc(); |
426 void loop_depth_dec(); | 427 void loop_depth_dec(); |
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1439 // If asked to read a "non-dumb" field (e.g. an expression) it will be skipped. | 1440 // If asked to read a "non-dumb" field (e.g. an expression) it will be skipped. |
1440 class LibraryHelper { | 1441 class LibraryHelper { |
1441 public: | 1442 public: |
1442 enum Fields { | 1443 enum Fields { |
1443 kFlags, | 1444 kFlags, |
1444 kCanonicalName, | 1445 kCanonicalName, |
1445 kName, | 1446 kName, |
1446 kSourceUriIndex, | 1447 kSourceUriIndex, |
1447 kAnnotations, | 1448 kAnnotations, |
1448 kDependencies, | 1449 kDependencies, |
| 1450 kParts, |
1449 kTypedefs, | 1451 kTypedefs, |
1450 kClasses, | 1452 kClasses, |
1451 kToplevelField, | 1453 kToplevelField, |
1452 kToplevelProcedures, | 1454 kToplevelProcedures, |
1453 kEnd | 1455 kEnd |
1454 }; | 1456 }; |
1455 | 1457 |
1456 explicit LibraryHelper(StreamingFlowGraphBuilder* builder) { | 1458 explicit LibraryHelper(StreamingFlowGraphBuilder* builder) { |
1457 builder_ = builder; | 1459 builder_ = builder; |
1458 next_read_ = kFlags; | 1460 next_read_ = kFlags; |
(...skipping 27 matching lines...) Expand all Loading... |
1486 case kAnnotations: | 1488 case kAnnotations: |
1487 builder_->SkipListOfExpressions(); // read annotations. | 1489 builder_->SkipListOfExpressions(); // read annotations. |
1488 if (++next_read_ == field) return; | 1490 if (++next_read_ == field) return; |
1489 case kDependencies: { | 1491 case kDependencies: { |
1490 intptr_t dependency_count = builder_->ReadUInt(); // read list length. | 1492 intptr_t dependency_count = builder_->ReadUInt(); // read list length. |
1491 for (intptr_t i = 0; i < dependency_count; ++i) { | 1493 for (intptr_t i = 0; i < dependency_count; ++i) { |
1492 builder_->SkipLibraryDependency(); | 1494 builder_->SkipLibraryDependency(); |
1493 } | 1495 } |
1494 if (++next_read_ == field) return; | 1496 if (++next_read_ == field) return; |
1495 } | 1497 } |
| 1498 case kParts: { |
| 1499 intptr_t part_count = builder_->ReadUInt(); // read list length. |
| 1500 for (intptr_t i = 0; i < part_count; ++i) { |
| 1501 builder_->SkipLibraryPart(); |
| 1502 } |
| 1503 if (++next_read_ == field) return; |
| 1504 } |
1496 case kTypedefs: { | 1505 case kTypedefs: { |
1497 intptr_t typedef_count = | 1506 intptr_t typedef_count = |
1498 builder_->ReadListLength(); // read list length. | 1507 builder_->ReadListLength(); // read list length. |
1499 for (intptr_t i = 0; i < typedef_count; i++) { | 1508 for (intptr_t i = 0; i < typedef_count; i++) { |
1500 builder_->SkipLibraryTypedef(); | 1509 builder_->SkipLibraryTypedef(); |
1501 } | 1510 } |
1502 if (++next_read_ == field) return; | 1511 if (++next_read_ == field) return; |
1503 } | 1512 } |
1504 case kClasses: { | 1513 case kClasses: { |
1505 int class_count = builder_->ReadListLength(); // read list length. | 1514 int class_count = builder_->ReadListLength(); // read list length. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1544 private: | 1553 private: |
1545 StreamingFlowGraphBuilder* builder_; | 1554 StreamingFlowGraphBuilder* builder_; |
1546 intptr_t next_read_; | 1555 intptr_t next_read_; |
1547 }; | 1556 }; |
1548 | 1557 |
1549 } // namespace kernel | 1558 } // namespace kernel |
1550 } // namespace dart | 1559 } // namespace dart |
1551 | 1560 |
1552 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 1561 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
1553 #endif // RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_ | 1562 #endif // RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_ |
OLD | NEW |