| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 // This file has been automatically generated. Please do not edit it manually. | 5 // This file has been automatically generated. Please do not edit it manually. |
| 6 // To regenerate the file, use the script "pkg/analyzer/tool/generate_files". | 6 // To regenerate the file, use the script "pkg/analyzer/tool/generate_files". |
| 7 | 7 |
| 8 library analyzer.src.summary.format; | 8 library analyzer.src.summary.format; |
| 9 | 9 |
| 10 import 'base.dart' as base; | 10 import 'base.dart' as base; |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 }; | 428 }; |
| 429 } | 429 } |
| 430 | 430 |
| 431 class LinkedLibraryBuilder extends Object with _LinkedLibraryMixin implements Li
nkedLibrary { | 431 class LinkedLibraryBuilder extends Object with _LinkedLibraryMixin implements Li
nkedLibrary { |
| 432 bool _finished = false; | 432 bool _finished = false; |
| 433 | 433 |
| 434 List<LinkedUnitBuilder> _units; | 434 List<LinkedUnitBuilder> _units; |
| 435 List<LinkedDependencyBuilder> _dependencies; | 435 List<LinkedDependencyBuilder> _dependencies; |
| 436 List<int> _importDependencies; | 436 List<int> _importDependencies; |
| 437 List<LinkedExportNameBuilder> _exportNames; | 437 List<LinkedExportNameBuilder> _exportNames; |
| 438 int _numPrelinkedDependencies; |
| 438 | 439 |
| 439 @override | 440 @override |
| 440 List<LinkedUnit> get units => _units ?? const <LinkedUnit>[]; | 441 List<LinkedUnit> get units => _units ?? const <LinkedUnit>[]; |
| 441 | 442 |
| 442 /** | 443 /** |
| 443 * The linked summary of all the compilation units constituting the | 444 * The linked summary of all the compilation units constituting the |
| 444 * library. The summary of the defining compilation unit is listed first, | 445 * library. The summary of the defining compilation unit is listed first, |
| 445 * followed by the summary of each part, in the order of the `part` | 446 * followed by the summary of each part, in the order of the `part` |
| 446 * declarations in the defining compilation unit. | 447 * declarations in the defining compilation unit. |
| 447 */ | 448 */ |
| 448 void set units(List<LinkedUnitBuilder> _value) { | 449 void set units(List<LinkedUnitBuilder> _value) { |
| 449 assert(!_finished); | 450 assert(!_finished); |
| 450 _units = _value; | 451 _units = _value; |
| 451 } | 452 } |
| 452 | 453 |
| 453 @override | 454 @override |
| 454 List<LinkedDependency> get dependencies => _dependencies ?? const <LinkedDepen
dency>[]; | 455 List<LinkedDependency> get dependencies => _dependencies ?? const <LinkedDepen
dency>[]; |
| 455 | 456 |
| 456 /** | 457 /** |
| 457 * The libraries that this library depends on (either via an explicit import | 458 * The libraries that this library depends on (either via an explicit import |
| 458 * statement or via the implicit dependencies on `dart:core` and | 459 * statement or via the implicit dependencies on `dart:core` and |
| 459 * `dart:async`). The first element of this array is a pseudo-dependency | 460 * `dart:async`). The first element of this array is a pseudo-dependency |
| 460 * representing the library itself (it is also used for "dynamic"). | 461 * representing the library itself (it is also used for "dynamic"). This is |
| 462 * followed by elements representing "prelinked" dependencies (direct imports |
| 463 * and the transitive closure of exports). After the prelinked dependencies |
| 464 * are elements represent "linked" dependencies. |
| 461 * | 465 * |
| 462 * TODO(paulberry): consider removing this entirely and just using | 466 * A library is only included as a "linked" dependency if it is a true |
| 463 * [UnlinkedLibrary.imports]. | 467 * dependency (e.g. a propagated or inferred type or constant value |
| 468 * implicitly refers to an element declared in the library) or |
| 469 * anti-dependency (e.g. the result of type propagation or type inference |
| 470 * depends on the lack of a certain declaration in the library). |
| 464 */ | 471 */ |
| 465 void set dependencies(List<LinkedDependencyBuilder> _value) { | 472 void set dependencies(List<LinkedDependencyBuilder> _value) { |
| 466 assert(!_finished); | 473 assert(!_finished); |
| 467 _dependencies = _value; | 474 _dependencies = _value; |
| 468 } | 475 } |
| 469 | 476 |
| 470 @override | 477 @override |
| 471 List<int> get importDependencies => _importDependencies ?? const <int>[]; | 478 List<int> get importDependencies => _importDependencies ?? const <int>[]; |
| 472 | 479 |
| 473 /** | 480 /** |
| 474 * For each import in [UnlinkedUnit.imports], an index into [dependencies] | 481 * For each import in [UnlinkedUnit.imports], an index into [dependencies] |
| 475 * of the library being imported. | 482 * of the library being imported. |
| 476 * | |
| 477 * TODO(paulberry): if [dependencies] is removed, this can be removed as | |
| 478 * well, since there will effectively be a one-to-one mapping. | |
| 479 */ | 483 */ |
| 480 void set importDependencies(List<int> _value) { | 484 void set importDependencies(List<int> _value) { |
| 481 assert(!_finished); | 485 assert(!_finished); |
| 482 _importDependencies = _value; | 486 _importDependencies = _value; |
| 483 } | 487 } |
| 484 | 488 |
| 485 @override | 489 @override |
| 486 List<LinkedExportName> get exportNames => _exportNames ?? const <LinkedExportN
ame>[]; | 490 List<LinkedExportName> get exportNames => _exportNames ?? const <LinkedExportN
ame>[]; |
| 487 | 491 |
| 488 /** | 492 /** |
| 489 * Information about entities in the export namespace of the library that are | 493 * Information about entities in the export namespace of the library that are |
| 490 * not in the public namespace of the library (that is, entities that are | 494 * not in the public namespace of the library (that is, entities that are |
| 491 * brought into the namespace via `export` directives). | 495 * brought into the namespace via `export` directives). |
| 492 * | 496 * |
| 493 * Sorted by name. | 497 * Sorted by name. |
| 494 */ | 498 */ |
| 495 void set exportNames(List<LinkedExportNameBuilder> _value) { | 499 void set exportNames(List<LinkedExportNameBuilder> _value) { |
| 496 assert(!_finished); | 500 assert(!_finished); |
| 497 _exportNames = _value; | 501 _exportNames = _value; |
| 498 } | 502 } |
| 499 | 503 |
| 500 LinkedLibraryBuilder({List<LinkedUnitBuilder> units, List<LinkedDependencyBuil
der> dependencies, List<int> importDependencies, List<LinkedExportNameBuilder> e
xportNames}) | 504 @override |
| 505 int get numPrelinkedDependencies => _numPrelinkedDependencies ?? 0; |
| 506 |
| 507 /** |
| 508 * The number of elements in [dependencies] which are not "linked" |
| 509 * dependencies (that is, the number of libraries in the direct imports plus |
| 510 * the transitive closure of exports, plus the library itself). |
| 511 */ |
| 512 void set numPrelinkedDependencies(int _value) { |
| 513 assert(!_finished); |
| 514 _numPrelinkedDependencies = _value; |
| 515 } |
| 516 |
| 517 LinkedLibraryBuilder({List<LinkedUnitBuilder> units, List<LinkedDependencyBuil
der> dependencies, List<int> importDependencies, List<LinkedExportNameBuilder> e
xportNames, int numPrelinkedDependencies}) |
| 501 : _units = units, | 518 : _units = units, |
| 502 _dependencies = dependencies, | 519 _dependencies = dependencies, |
| 503 _importDependencies = importDependencies, | 520 _importDependencies = importDependencies, |
| 504 _exportNames = exportNames; | 521 _exportNames = exportNames, |
| 522 _numPrelinkedDependencies = numPrelinkedDependencies; |
| 505 | 523 |
| 506 List<int> toBuffer() { | 524 List<int> toBuffer() { |
| 507 fb.Builder fbBuilder = new fb.Builder(); | 525 fb.Builder fbBuilder = new fb.Builder(); |
| 508 return fbBuilder.finish(finish(fbBuilder)); | 526 return fbBuilder.finish(finish(fbBuilder)); |
| 509 } | 527 } |
| 510 | 528 |
| 511 fb.Offset finish(fb.Builder fbBuilder) { | 529 fb.Offset finish(fb.Builder fbBuilder) { |
| 512 assert(!_finished); | 530 assert(!_finished); |
| 513 _finished = true; | 531 _finished = true; |
| 514 fb.Offset offset_units; | 532 fb.Offset offset_units; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 533 } | 551 } |
| 534 if (offset_dependencies != null) { | 552 if (offset_dependencies != null) { |
| 535 fbBuilder.addOffset(1, offset_dependencies); | 553 fbBuilder.addOffset(1, offset_dependencies); |
| 536 } | 554 } |
| 537 if (offset_importDependencies != null) { | 555 if (offset_importDependencies != null) { |
| 538 fbBuilder.addOffset(2, offset_importDependencies); | 556 fbBuilder.addOffset(2, offset_importDependencies); |
| 539 } | 557 } |
| 540 if (offset_exportNames != null) { | 558 if (offset_exportNames != null) { |
| 541 fbBuilder.addOffset(3, offset_exportNames); | 559 fbBuilder.addOffset(3, offset_exportNames); |
| 542 } | 560 } |
| 561 if (_numPrelinkedDependencies != null && _numPrelinkedDependencies != 0) { |
| 562 fbBuilder.addInt32(4, _numPrelinkedDependencies); |
| 563 } |
| 543 return fbBuilder.endTable(); | 564 return fbBuilder.endTable(); |
| 544 } | 565 } |
| 545 } | 566 } |
| 546 | 567 |
| 547 /** | 568 /** |
| 548 * Linked summary of a library. | 569 * Linked summary of a library. |
| 549 */ | 570 */ |
| 550 abstract class LinkedLibrary extends base.SummaryClass { | 571 abstract class LinkedLibrary extends base.SummaryClass { |
| 551 factory LinkedLibrary.fromBuffer(List<int> buffer) { | 572 factory LinkedLibrary.fromBuffer(List<int> buffer) { |
| 552 fb.BufferPointer rootRef = new fb.BufferPointer.fromBytes(buffer); | 573 fb.BufferPointer rootRef = new fb.BufferPointer.fromBytes(buffer); |
| 553 return const _LinkedLibraryReader().read(rootRef); | 574 return const _LinkedLibraryReader().read(rootRef); |
| 554 } | 575 } |
| 555 | 576 |
| 556 /** | 577 /** |
| 557 * The linked summary of all the compilation units constituting the | 578 * The linked summary of all the compilation units constituting the |
| 558 * library. The summary of the defining compilation unit is listed first, | 579 * library. The summary of the defining compilation unit is listed first, |
| 559 * followed by the summary of each part, in the order of the `part` | 580 * followed by the summary of each part, in the order of the `part` |
| 560 * declarations in the defining compilation unit. | 581 * declarations in the defining compilation unit. |
| 561 */ | 582 */ |
| 562 List<LinkedUnit> get units; | 583 List<LinkedUnit> get units; |
| 563 | 584 |
| 564 /** | 585 /** |
| 565 * The libraries that this library depends on (either via an explicit import | 586 * The libraries that this library depends on (either via an explicit import |
| 566 * statement or via the implicit dependencies on `dart:core` and | 587 * statement or via the implicit dependencies on `dart:core` and |
| 567 * `dart:async`). The first element of this array is a pseudo-dependency | 588 * `dart:async`). The first element of this array is a pseudo-dependency |
| 568 * representing the library itself (it is also used for "dynamic"). | 589 * representing the library itself (it is also used for "dynamic"). This is |
| 590 * followed by elements representing "prelinked" dependencies (direct imports |
| 591 * and the transitive closure of exports). After the prelinked dependencies |
| 592 * are elements represent "linked" dependencies. |
| 569 * | 593 * |
| 570 * TODO(paulberry): consider removing this entirely and just using | 594 * A library is only included as a "linked" dependency if it is a true |
| 571 * [UnlinkedLibrary.imports]. | 595 * dependency (e.g. a propagated or inferred type or constant value |
| 596 * implicitly refers to an element declared in the library) or |
| 597 * anti-dependency (e.g. the result of type propagation or type inference |
| 598 * depends on the lack of a certain declaration in the library). |
| 572 */ | 599 */ |
| 573 List<LinkedDependency> get dependencies; | 600 List<LinkedDependency> get dependencies; |
| 574 | 601 |
| 575 /** | 602 /** |
| 576 * For each import in [UnlinkedUnit.imports], an index into [dependencies] | 603 * For each import in [UnlinkedUnit.imports], an index into [dependencies] |
| 577 * of the library being imported. | 604 * of the library being imported. |
| 578 * | |
| 579 * TODO(paulberry): if [dependencies] is removed, this can be removed as | |
| 580 * well, since there will effectively be a one-to-one mapping. | |
| 581 */ | 605 */ |
| 582 List<int> get importDependencies; | 606 List<int> get importDependencies; |
| 583 | 607 |
| 584 /** | 608 /** |
| 585 * Information about entities in the export namespace of the library that are | 609 * Information about entities in the export namespace of the library that are |
| 586 * not in the public namespace of the library (that is, entities that are | 610 * not in the public namespace of the library (that is, entities that are |
| 587 * brought into the namespace via `export` directives). | 611 * brought into the namespace via `export` directives). |
| 588 * | 612 * |
| 589 * Sorted by name. | 613 * Sorted by name. |
| 590 */ | 614 */ |
| 591 List<LinkedExportName> get exportNames; | 615 List<LinkedExportName> get exportNames; |
| 616 |
| 617 /** |
| 618 * The number of elements in [dependencies] which are not "linked" |
| 619 * dependencies (that is, the number of libraries in the direct imports plus |
| 620 * the transitive closure of exports, plus the library itself). |
| 621 */ |
| 622 int get numPrelinkedDependencies; |
| 592 } | 623 } |
| 593 | 624 |
| 594 class _LinkedLibraryReader extends fb.TableReader<_LinkedLibraryImpl> { | 625 class _LinkedLibraryReader extends fb.TableReader<_LinkedLibraryImpl> { |
| 595 const _LinkedLibraryReader(); | 626 const _LinkedLibraryReader(); |
| 596 | 627 |
| 597 @override | 628 @override |
| 598 _LinkedLibraryImpl createObject(fb.BufferPointer bp) => new _LinkedLibraryImpl
(bp); | 629 _LinkedLibraryImpl createObject(fb.BufferPointer bp) => new _LinkedLibraryImpl
(bp); |
| 599 } | 630 } |
| 600 | 631 |
| 601 class _LinkedLibraryImpl extends Object with _LinkedLibraryMixin implements Link
edLibrary { | 632 class _LinkedLibraryImpl extends Object with _LinkedLibraryMixin implements Link
edLibrary { |
| 602 final fb.BufferPointer _bp; | 633 final fb.BufferPointer _bp; |
| 603 | 634 |
| 604 _LinkedLibraryImpl(this._bp); | 635 _LinkedLibraryImpl(this._bp); |
| 605 | 636 |
| 606 List<LinkedUnit> _units; | 637 List<LinkedUnit> _units; |
| 607 List<LinkedDependency> _dependencies; | 638 List<LinkedDependency> _dependencies; |
| 608 List<int> _importDependencies; | 639 List<int> _importDependencies; |
| 609 List<LinkedExportName> _exportNames; | 640 List<LinkedExportName> _exportNames; |
| 641 int _numPrelinkedDependencies; |
| 610 | 642 |
| 611 @override | 643 @override |
| 612 List<LinkedUnit> get units { | 644 List<LinkedUnit> get units { |
| 613 _units ??= const fb.ListReader<LinkedUnit>(const _LinkedUnitReader()).vTable
Get(_bp, 0, const <LinkedUnit>[]); | 645 _units ??= const fb.ListReader<LinkedUnit>(const _LinkedUnitReader()).vTable
Get(_bp, 0, const <LinkedUnit>[]); |
| 614 return _units; | 646 return _units; |
| 615 } | 647 } |
| 616 | 648 |
| 617 @override | 649 @override |
| 618 List<LinkedDependency> get dependencies { | 650 List<LinkedDependency> get dependencies { |
| 619 _dependencies ??= const fb.ListReader<LinkedDependency>(const _LinkedDepende
ncyReader()).vTableGet(_bp, 1, const <LinkedDependency>[]); | 651 _dependencies ??= const fb.ListReader<LinkedDependency>(const _LinkedDepende
ncyReader()).vTableGet(_bp, 1, const <LinkedDependency>[]); |
| 620 return _dependencies; | 652 return _dependencies; |
| 621 } | 653 } |
| 622 | 654 |
| 623 @override | 655 @override |
| 624 List<int> get importDependencies { | 656 List<int> get importDependencies { |
| 625 _importDependencies ??= const fb.ListReader<int>(const fb.Int32Reader()).vTa
bleGet(_bp, 2, const <int>[]); | 657 _importDependencies ??= const fb.ListReader<int>(const fb.Int32Reader()).vTa
bleGet(_bp, 2, const <int>[]); |
| 626 return _importDependencies; | 658 return _importDependencies; |
| 627 } | 659 } |
| 628 | 660 |
| 629 @override | 661 @override |
| 630 List<LinkedExportName> get exportNames { | 662 List<LinkedExportName> get exportNames { |
| 631 _exportNames ??= const fb.ListReader<LinkedExportName>(const _LinkedExportNa
meReader()).vTableGet(_bp, 3, const <LinkedExportName>[]); | 663 _exportNames ??= const fb.ListReader<LinkedExportName>(const _LinkedExportNa
meReader()).vTableGet(_bp, 3, const <LinkedExportName>[]); |
| 632 return _exportNames; | 664 return _exportNames; |
| 633 } | 665 } |
| 666 |
| 667 @override |
| 668 int get numPrelinkedDependencies { |
| 669 _numPrelinkedDependencies ??= const fb.Int32Reader().vTableGet(_bp, 4, 0); |
| 670 return _numPrelinkedDependencies; |
| 671 } |
| 634 } | 672 } |
| 635 | 673 |
| 636 abstract class _LinkedLibraryMixin implements LinkedLibrary { | 674 abstract class _LinkedLibraryMixin implements LinkedLibrary { |
| 637 @override | 675 @override |
| 638 Map<String, Object> toMap() => { | 676 Map<String, Object> toMap() => { |
| 639 "units": units, | 677 "units": units, |
| 640 "dependencies": dependencies, | 678 "dependencies": dependencies, |
| 641 "importDependencies": importDependencies, | 679 "importDependencies": importDependencies, |
| 642 "exportNames": exportNames, | 680 "exportNames": exportNames, |
| 681 "numPrelinkedDependencies": numPrelinkedDependencies, |
| 643 }; | 682 }; |
| 644 } | 683 } |
| 645 | 684 |
| 646 class LinkedReferenceBuilder extends Object with _LinkedReferenceMixin implement
s LinkedReference { | 685 class LinkedReferenceBuilder extends Object with _LinkedReferenceMixin implement
s LinkedReference { |
| 647 bool _finished = false; | 686 bool _finished = false; |
| 648 | 687 |
| 649 int _dependency; | 688 int _dependency; |
| 650 ReferenceKind _kind; | 689 ReferenceKind _kind; |
| 651 int _unit; | 690 int _unit; |
| 652 int _numTypeParameters; | 691 int _numTypeParameters; |
| 692 String _name; |
| 653 | 693 |
| 654 @override | 694 @override |
| 655 int get dependency => _dependency ?? 0; | 695 int get dependency => _dependency ?? 0; |
| 656 | 696 |
| 657 /** | 697 /** |
| 658 * Index into [LinkedLibrary.dependencies] indicating which imported library | 698 * Index into [LinkedLibrary.dependencies] indicating which imported library |
| 659 * declares the entity being referred to. | 699 * declares the entity being referred to. |
| 660 */ | 700 */ |
| 661 void set dependency(int _value) { | 701 void set dependency(int _value) { |
| 662 assert(!_finished); | 702 assert(!_finished); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 | 734 |
| 695 /** | 735 /** |
| 696 * If the entity being referred to is generic, the number of type parameters | 736 * If the entity being referred to is generic, the number of type parameters |
| 697 * it accepts. Otherwise zero. | 737 * it accepts. Otherwise zero. |
| 698 */ | 738 */ |
| 699 void set numTypeParameters(int _value) { | 739 void set numTypeParameters(int _value) { |
| 700 assert(!_finished); | 740 assert(!_finished); |
| 701 _numTypeParameters = _value; | 741 _numTypeParameters = _value; |
| 702 } | 742 } |
| 703 | 743 |
| 704 LinkedReferenceBuilder({int dependency, ReferenceKind kind, int unit, int numT
ypeParameters}) | 744 @override |
| 745 String get name => _name ?? ''; |
| 746 |
| 747 /** |
| 748 * If this [LinkedReference] doesn't have an associated [UnlinkedReference], |
| 749 * name of the entity being referred to. The empty string refers to the |
| 750 * pseudo-type `dynamic`. |
| 751 */ |
| 752 void set name(String _value) { |
| 753 assert(!_finished); |
| 754 _name = _value; |
| 755 } |
| 756 |
| 757 LinkedReferenceBuilder({int dependency, ReferenceKind kind, int unit, int numT
ypeParameters, String name}) |
| 705 : _dependency = dependency, | 758 : _dependency = dependency, |
| 706 _kind = kind, | 759 _kind = kind, |
| 707 _unit = unit, | 760 _unit = unit, |
| 708 _numTypeParameters = numTypeParameters; | 761 _numTypeParameters = numTypeParameters, |
| 762 _name = name; |
| 709 | 763 |
| 710 fb.Offset finish(fb.Builder fbBuilder) { | 764 fb.Offset finish(fb.Builder fbBuilder) { |
| 711 assert(!_finished); | 765 assert(!_finished); |
| 712 _finished = true; | 766 _finished = true; |
| 767 fb.Offset offset_name; |
| 768 if (_name != null) { |
| 769 offset_name = fbBuilder.writeString(_name); |
| 770 } |
| 713 fbBuilder.startTable(); | 771 fbBuilder.startTable(); |
| 714 if (_dependency != null && _dependency != 0) { | 772 if (_dependency != null && _dependency != 0) { |
| 715 fbBuilder.addInt32(0, _dependency); | 773 fbBuilder.addInt32(0, _dependency); |
| 716 } | 774 } |
| 717 if (_kind != null && _kind != ReferenceKind.classOrEnum) { | 775 if (_kind != null && _kind != ReferenceKind.classOrEnum) { |
| 718 fbBuilder.addInt32(1, _kind.index); | 776 fbBuilder.addInt32(1, _kind.index); |
| 719 } | 777 } |
| 720 if (_unit != null && _unit != 0) { | 778 if (_unit != null && _unit != 0) { |
| 721 fbBuilder.addInt32(2, _unit); | 779 fbBuilder.addInt32(2, _unit); |
| 722 } | 780 } |
| 723 if (_numTypeParameters != null && _numTypeParameters != 0) { | 781 if (_numTypeParameters != null && _numTypeParameters != 0) { |
| 724 fbBuilder.addInt32(3, _numTypeParameters); | 782 fbBuilder.addInt32(3, _numTypeParameters); |
| 725 } | 783 } |
| 784 if (offset_name != null) { |
| 785 fbBuilder.addOffset(4, offset_name); |
| 786 } |
| 726 return fbBuilder.endTable(); | 787 return fbBuilder.endTable(); |
| 727 } | 788 } |
| 728 } | 789 } |
| 729 | 790 |
| 730 /** | 791 /** |
| 731 * Information about the resolution of an [UnlinkedReference]. | 792 * Information about the resolution of an [UnlinkedReference]. |
| 732 */ | 793 */ |
| 733 abstract class LinkedReference extends base.SummaryClass { | 794 abstract class LinkedReference extends base.SummaryClass { |
| 734 | 795 |
| 735 /** | 796 /** |
| (...skipping 14 matching lines...) Expand all Loading... |
| 750 * zero represents the defining compilation unit, and nonzero values | 811 * zero represents the defining compilation unit, and nonzero values |
| 751 * represent parts in the order of the corresponding `part` declarations. | 812 * represent parts in the order of the corresponding `part` declarations. |
| 752 */ | 813 */ |
| 753 int get unit; | 814 int get unit; |
| 754 | 815 |
| 755 /** | 816 /** |
| 756 * If the entity being referred to is generic, the number of type parameters | 817 * If the entity being referred to is generic, the number of type parameters |
| 757 * it accepts. Otherwise zero. | 818 * it accepts. Otherwise zero. |
| 758 */ | 819 */ |
| 759 int get numTypeParameters; | 820 int get numTypeParameters; |
| 821 |
| 822 /** |
| 823 * If this [LinkedReference] doesn't have an associated [UnlinkedReference], |
| 824 * name of the entity being referred to. The empty string refers to the |
| 825 * pseudo-type `dynamic`. |
| 826 */ |
| 827 String get name; |
| 760 } | 828 } |
| 761 | 829 |
| 762 class _LinkedReferenceReader extends fb.TableReader<_LinkedReferenceImpl> { | 830 class _LinkedReferenceReader extends fb.TableReader<_LinkedReferenceImpl> { |
| 763 const _LinkedReferenceReader(); | 831 const _LinkedReferenceReader(); |
| 764 | 832 |
| 765 @override | 833 @override |
| 766 _LinkedReferenceImpl createObject(fb.BufferPointer bp) => new _LinkedReference
Impl(bp); | 834 _LinkedReferenceImpl createObject(fb.BufferPointer bp) => new _LinkedReference
Impl(bp); |
| 767 } | 835 } |
| 768 | 836 |
| 769 class _LinkedReferenceImpl extends Object with _LinkedReferenceMixin implements
LinkedReference { | 837 class _LinkedReferenceImpl extends Object with _LinkedReferenceMixin implements
LinkedReference { |
| 770 final fb.BufferPointer _bp; | 838 final fb.BufferPointer _bp; |
| 771 | 839 |
| 772 _LinkedReferenceImpl(this._bp); | 840 _LinkedReferenceImpl(this._bp); |
| 773 | 841 |
| 774 int _dependency; | 842 int _dependency; |
| 775 ReferenceKind _kind; | 843 ReferenceKind _kind; |
| 776 int _unit; | 844 int _unit; |
| 777 int _numTypeParameters; | 845 int _numTypeParameters; |
| 846 String _name; |
| 778 | 847 |
| 779 @override | 848 @override |
| 780 int get dependency { | 849 int get dependency { |
| 781 _dependency ??= const fb.Int32Reader().vTableGet(_bp, 0, 0); | 850 _dependency ??= const fb.Int32Reader().vTableGet(_bp, 0, 0); |
| 782 return _dependency; | 851 return _dependency; |
| 783 } | 852 } |
| 784 | 853 |
| 785 @override | 854 @override |
| 786 ReferenceKind get kind { | 855 ReferenceKind get kind { |
| 787 _kind ??= const _ReferenceKindReader().vTableGet(_bp, 1, ReferenceKind.class
OrEnum); | 856 _kind ??= const _ReferenceKindReader().vTableGet(_bp, 1, ReferenceKind.class
OrEnum); |
| 788 return _kind; | 857 return _kind; |
| 789 } | 858 } |
| 790 | 859 |
| 791 @override | 860 @override |
| 792 int get unit { | 861 int get unit { |
| 793 _unit ??= const fb.Int32Reader().vTableGet(_bp, 2, 0); | 862 _unit ??= const fb.Int32Reader().vTableGet(_bp, 2, 0); |
| 794 return _unit; | 863 return _unit; |
| 795 } | 864 } |
| 796 | 865 |
| 797 @override | 866 @override |
| 798 int get numTypeParameters { | 867 int get numTypeParameters { |
| 799 _numTypeParameters ??= const fb.Int32Reader().vTableGet(_bp, 3, 0); | 868 _numTypeParameters ??= const fb.Int32Reader().vTableGet(_bp, 3, 0); |
| 800 return _numTypeParameters; | 869 return _numTypeParameters; |
| 801 } | 870 } |
| 871 |
| 872 @override |
| 873 String get name { |
| 874 _name ??= const fb.StringReader().vTableGet(_bp, 4, ''); |
| 875 return _name; |
| 876 } |
| 802 } | 877 } |
| 803 | 878 |
| 804 abstract class _LinkedReferenceMixin implements LinkedReference { | 879 abstract class _LinkedReferenceMixin implements LinkedReference { |
| 805 @override | 880 @override |
| 806 Map<String, Object> toMap() => { | 881 Map<String, Object> toMap() => { |
| 807 "dependency": dependency, | 882 "dependency": dependency, |
| 808 "kind": kind, | 883 "kind": kind, |
| 809 "unit": unit, | 884 "unit": unit, |
| 810 "numTypeParameters": numTypeParameters, | 885 "numTypeParameters": numTypeParameters, |
| 886 "name": name, |
| 811 }; | 887 }; |
| 812 } | 888 } |
| 813 | 889 |
| 814 class LinkedUnitBuilder extends Object with _LinkedUnitMixin implements LinkedUn
it { | 890 class LinkedUnitBuilder extends Object with _LinkedUnitMixin implements LinkedUn
it { |
| 815 bool _finished = false; | 891 bool _finished = false; |
| 816 | 892 |
| 817 List<LinkedReferenceBuilder> _references; | 893 List<LinkedReferenceBuilder> _references; |
| 894 List<TypeRefBuilder> _types; |
| 818 | 895 |
| 819 @override | 896 @override |
| 820 List<LinkedReference> get references => _references ?? const <LinkedReference>
[]; | 897 List<LinkedReference> get references => _references ?? const <LinkedReference>
[]; |
| 821 | 898 |
| 822 /** | 899 /** |
| 823 * For each reference in [UnlinkedUnit.references], information about how | 900 * Information about the resolution of references within the compilation |
| 824 * that reference is resolved. | 901 * unit. Each element of [UnlinkedUnit.references] has a corresponding |
| 902 * element in this list (at the same index). If this list has additional |
| 903 * elements beyond the number of elements in [UnlinkedUnit.references], those |
| 904 * additional elements are references that are only referred to implicitly |
| 905 * (e.g. elements involved in inferred or propagated types). |
| 825 */ | 906 */ |
| 826 void set references(List<LinkedReferenceBuilder> _value) { | 907 void set references(List<LinkedReferenceBuilder> _value) { |
| 827 assert(!_finished); | 908 assert(!_finished); |
| 828 _references = _value; | 909 _references = _value; |
| 829 } | 910 } |
| 830 | 911 |
| 831 LinkedUnitBuilder({List<LinkedReferenceBuilder> references}) | 912 @override |
| 832 : _references = references; | 913 List<TypeRef> get types => _types ?? const <TypeRef>[]; |
| 914 |
| 915 /** |
| 916 * List associating slot ids found inside the unlinked summary for the |
| 917 * compilation unit with propagated and inferred types. |
| 918 */ |
| 919 void set types(List<TypeRefBuilder> _value) { |
| 920 assert(!_finished); |
| 921 _types = _value; |
| 922 } |
| 923 |
| 924 LinkedUnitBuilder({List<LinkedReferenceBuilder> references, List<TypeRefBuilde
r> types}) |
| 925 : _references = references, |
| 926 _types = types; |
| 833 | 927 |
| 834 fb.Offset finish(fb.Builder fbBuilder) { | 928 fb.Offset finish(fb.Builder fbBuilder) { |
| 835 assert(!_finished); | 929 assert(!_finished); |
| 836 _finished = true; | 930 _finished = true; |
| 837 fb.Offset offset_references; | 931 fb.Offset offset_references; |
| 932 fb.Offset offset_types; |
| 838 if (!(_references == null || _references.isEmpty)) { | 933 if (!(_references == null || _references.isEmpty)) { |
| 839 offset_references = fbBuilder.writeList(_references.map((b) => b.finish(fb
Builder)).toList()); | 934 offset_references = fbBuilder.writeList(_references.map((b) => b.finish(fb
Builder)).toList()); |
| 840 } | 935 } |
| 936 if (!(_types == null || _types.isEmpty)) { |
| 937 offset_types = fbBuilder.writeList(_types.map((b) => b.finish(fbBuilder)).
toList()); |
| 938 } |
| 841 fbBuilder.startTable(); | 939 fbBuilder.startTable(); |
| 842 if (offset_references != null) { | 940 if (offset_references != null) { |
| 843 fbBuilder.addOffset(0, offset_references); | 941 fbBuilder.addOffset(0, offset_references); |
| 844 } | 942 } |
| 943 if (offset_types != null) { |
| 944 fbBuilder.addOffset(1, offset_types); |
| 945 } |
| 845 return fbBuilder.endTable(); | 946 return fbBuilder.endTable(); |
| 846 } | 947 } |
| 847 } | 948 } |
| 848 | 949 |
| 849 /** | 950 /** |
| 850 * Linked summary of a compilation unit. | 951 * Linked summary of a compilation unit. |
| 851 */ | 952 */ |
| 852 abstract class LinkedUnit extends base.SummaryClass { | 953 abstract class LinkedUnit extends base.SummaryClass { |
| 853 | 954 |
| 854 /** | 955 /** |
| 855 * For each reference in [UnlinkedUnit.references], information about how | 956 * Information about the resolution of references within the compilation |
| 856 * that reference is resolved. | 957 * unit. Each element of [UnlinkedUnit.references] has a corresponding |
| 958 * element in this list (at the same index). If this list has additional |
| 959 * elements beyond the number of elements in [UnlinkedUnit.references], those |
| 960 * additional elements are references that are only referred to implicitly |
| 961 * (e.g. elements involved in inferred or propagated types). |
| 857 */ | 962 */ |
| 858 List<LinkedReference> get references; | 963 List<LinkedReference> get references; |
| 964 |
| 965 /** |
| 966 * List associating slot ids found inside the unlinked summary for the |
| 967 * compilation unit with propagated and inferred types. |
| 968 */ |
| 969 List<TypeRef> get types; |
| 859 } | 970 } |
| 860 | 971 |
| 861 class _LinkedUnitReader extends fb.TableReader<_LinkedUnitImpl> { | 972 class _LinkedUnitReader extends fb.TableReader<_LinkedUnitImpl> { |
| 862 const _LinkedUnitReader(); | 973 const _LinkedUnitReader(); |
| 863 | 974 |
| 864 @override | 975 @override |
| 865 _LinkedUnitImpl createObject(fb.BufferPointer bp) => new _LinkedUnitImpl(bp); | 976 _LinkedUnitImpl createObject(fb.BufferPointer bp) => new _LinkedUnitImpl(bp); |
| 866 } | 977 } |
| 867 | 978 |
| 868 class _LinkedUnitImpl extends Object with _LinkedUnitMixin implements LinkedUnit
{ | 979 class _LinkedUnitImpl extends Object with _LinkedUnitMixin implements LinkedUnit
{ |
| 869 final fb.BufferPointer _bp; | 980 final fb.BufferPointer _bp; |
| 870 | 981 |
| 871 _LinkedUnitImpl(this._bp); | 982 _LinkedUnitImpl(this._bp); |
| 872 | 983 |
| 873 List<LinkedReference> _references; | 984 List<LinkedReference> _references; |
| 985 List<TypeRef> _types; |
| 874 | 986 |
| 875 @override | 987 @override |
| 876 List<LinkedReference> get references { | 988 List<LinkedReference> get references { |
| 877 _references ??= const fb.ListReader<LinkedReference>(const _LinkedReferenceR
eader()).vTableGet(_bp, 0, const <LinkedReference>[]); | 989 _references ??= const fb.ListReader<LinkedReference>(const _LinkedReferenceR
eader()).vTableGet(_bp, 0, const <LinkedReference>[]); |
| 878 return _references; | 990 return _references; |
| 879 } | 991 } |
| 992 |
| 993 @override |
| 994 List<TypeRef> get types { |
| 995 _types ??= const fb.ListReader<TypeRef>(const _TypeRefReader()).vTableGet(_b
p, 1, const <TypeRef>[]); |
| 996 return _types; |
| 997 } |
| 880 } | 998 } |
| 881 | 999 |
| 882 abstract class _LinkedUnitMixin implements LinkedUnit { | 1000 abstract class _LinkedUnitMixin implements LinkedUnit { |
| 883 @override | 1001 @override |
| 884 Map<String, Object> toMap() => { | 1002 Map<String, Object> toMap() => { |
| 885 "references": references, | 1003 "references": references, |
| 1004 "types": types, |
| 886 }; | 1005 }; |
| 887 } | 1006 } |
| 888 | 1007 |
| 889 class SdkBundleBuilder extends Object with _SdkBundleMixin implements SdkBundle
{ | 1008 class SdkBundleBuilder extends Object with _SdkBundleMixin implements SdkBundle
{ |
| 890 bool _finished = false; | 1009 bool _finished = false; |
| 891 | 1010 |
| 892 List<String> _linkedLibraryUris; | 1011 List<String> _linkedLibraryUris; |
| 893 List<LinkedLibraryBuilder> _linkedLibraries; | 1012 List<LinkedLibraryBuilder> _linkedLibraries; |
| 894 List<String> _unlinkedUnitUris; | 1013 List<String> _unlinkedUnitUris; |
| 895 List<UnlinkedUnitBuilder> _unlinkedUnits; | 1014 List<UnlinkedUnitBuilder> _unlinkedUnits; |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1063 "linkedLibraryUris": linkedLibraryUris, | 1182 "linkedLibraryUris": linkedLibraryUris, |
| 1064 "linkedLibraries": linkedLibraries, | 1183 "linkedLibraries": linkedLibraries, |
| 1065 "unlinkedUnitUris": unlinkedUnitUris, | 1184 "unlinkedUnitUris": unlinkedUnitUris, |
| 1066 "unlinkedUnits": unlinkedUnits, | 1185 "unlinkedUnits": unlinkedUnits, |
| 1067 }; | 1186 }; |
| 1068 } | 1187 } |
| 1069 | 1188 |
| 1070 class TypeRefBuilder extends Object with _TypeRefMixin implements TypeRef { | 1189 class TypeRefBuilder extends Object with _TypeRefMixin implements TypeRef { |
| 1071 bool _finished = false; | 1190 bool _finished = false; |
| 1072 | 1191 |
| 1192 int _slot; |
| 1073 int _reference; | 1193 int _reference; |
| 1074 int _paramReference; | 1194 int _paramReference; |
| 1075 List<TypeRefBuilder> _typeArguments; | 1195 List<TypeRefBuilder> _typeArguments; |
| 1076 | 1196 |
| 1077 @override | 1197 @override |
| 1198 int get slot => _slot ?? 0; |
| 1199 |
| 1200 /** |
| 1201 * If this [TypeRef] is contained within [LinkedUnit.types], slot id (which |
| 1202 * is unique within the compilation unit) identifying the target of type |
| 1203 * propagation or type inference with which this [TypeRef] is asociated. |
| 1204 * |
| 1205 * Otherwise zero. |
| 1206 */ |
| 1207 void set slot(int _value) { |
| 1208 assert(!_finished); |
| 1209 _slot = _value; |
| 1210 } |
| 1211 |
| 1212 @override |
| 1078 int get reference => _reference ?? 0; | 1213 int get reference => _reference ?? 0; |
| 1079 | 1214 |
| 1080 /** | 1215 /** |
| 1081 * Index into [UnlinkedUnit.references] for the type being referred to, or | 1216 * Index into [UnlinkedUnit.references] for the type being referred to, or |
| 1082 * zero if this is a reference to a type parameter. | 1217 * zero if this is a reference to a type parameter. |
| 1083 * | 1218 * |
| 1084 * Note that since zero is also a valid index into | 1219 * Note that since zero is also a valid index into |
| 1085 * [UnlinkedUnit.references], we cannot distinguish between references to | 1220 * [UnlinkedUnit.references], we cannot distinguish between references to |
| 1086 * type parameters and references to types by checking [reference] against | 1221 * type parameters and references to types by checking [reference] against |
| 1087 * zero. To distinguish between references to type parameters and references | 1222 * zero. To distinguish between references to type parameters and references |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1124 | 1259 |
| 1125 /** | 1260 /** |
| 1126 * If this is an instantiation of a generic type, the type arguments used to | 1261 * If this is an instantiation of a generic type, the type arguments used to |
| 1127 * instantiate it. Trailing type arguments of type `dynamic` are omitted. | 1262 * instantiate it. Trailing type arguments of type `dynamic` are omitted. |
| 1128 */ | 1263 */ |
| 1129 void set typeArguments(List<TypeRefBuilder> _value) { | 1264 void set typeArguments(List<TypeRefBuilder> _value) { |
| 1130 assert(!_finished); | 1265 assert(!_finished); |
| 1131 _typeArguments = _value; | 1266 _typeArguments = _value; |
| 1132 } | 1267 } |
| 1133 | 1268 |
| 1134 TypeRefBuilder({int reference, int paramReference, List<TypeRefBuilder> typeAr
guments}) | 1269 TypeRefBuilder({int slot, int reference, int paramReference, List<TypeRefBuild
er> typeArguments}) |
| 1135 : _reference = reference, | 1270 : _slot = slot, |
| 1271 _reference = reference, |
| 1136 _paramReference = paramReference, | 1272 _paramReference = paramReference, |
| 1137 _typeArguments = typeArguments; | 1273 _typeArguments = typeArguments; |
| 1138 | 1274 |
| 1139 fb.Offset finish(fb.Builder fbBuilder) { | 1275 fb.Offset finish(fb.Builder fbBuilder) { |
| 1140 assert(!_finished); | 1276 assert(!_finished); |
| 1141 _finished = true; | 1277 _finished = true; |
| 1142 fb.Offset offset_typeArguments; | 1278 fb.Offset offset_typeArguments; |
| 1143 if (!(_typeArguments == null || _typeArguments.isEmpty)) { | 1279 if (!(_typeArguments == null || _typeArguments.isEmpty)) { |
| 1144 offset_typeArguments = fbBuilder.writeList(_typeArguments.map((b) => b.fin
ish(fbBuilder)).toList()); | 1280 offset_typeArguments = fbBuilder.writeList(_typeArguments.map((b) => b.fin
ish(fbBuilder)).toList()); |
| 1145 } | 1281 } |
| 1146 fbBuilder.startTable(); | 1282 fbBuilder.startTable(); |
| 1283 if (_slot != null && _slot != 0) { |
| 1284 fbBuilder.addInt32(0, _slot); |
| 1285 } |
| 1147 if (_reference != null && _reference != 0) { | 1286 if (_reference != null && _reference != 0) { |
| 1148 fbBuilder.addInt32(0, _reference); | 1287 fbBuilder.addInt32(1, _reference); |
| 1149 } | 1288 } |
| 1150 if (_paramReference != null && _paramReference != 0) { | 1289 if (_paramReference != null && _paramReference != 0) { |
| 1151 fbBuilder.addInt32(1, _paramReference); | 1290 fbBuilder.addInt32(2, _paramReference); |
| 1152 } | 1291 } |
| 1153 if (offset_typeArguments != null) { | 1292 if (offset_typeArguments != null) { |
| 1154 fbBuilder.addOffset(2, offset_typeArguments); | 1293 fbBuilder.addOffset(3, offset_typeArguments); |
| 1155 } | 1294 } |
| 1156 return fbBuilder.endTable(); | 1295 return fbBuilder.endTable(); |
| 1157 } | 1296 } |
| 1158 } | 1297 } |
| 1159 | 1298 |
| 1160 /** | 1299 /** |
| 1161 * Summary information about a reference to a type. | 1300 * Summary information about a reference to a type. |
| 1162 */ | 1301 */ |
| 1163 abstract class TypeRef extends base.SummaryClass { | 1302 abstract class TypeRef extends base.SummaryClass { |
| 1164 | 1303 |
| 1165 /** | 1304 /** |
| 1305 * If this [TypeRef] is contained within [LinkedUnit.types], slot id (which |
| 1306 * is unique within the compilation unit) identifying the target of type |
| 1307 * propagation or type inference with which this [TypeRef] is asociated. |
| 1308 * |
| 1309 * Otherwise zero. |
| 1310 */ |
| 1311 int get slot; |
| 1312 |
| 1313 /** |
| 1166 * Index into [UnlinkedUnit.references] for the type being referred to, or | 1314 * Index into [UnlinkedUnit.references] for the type being referred to, or |
| 1167 * zero if this is a reference to a type parameter. | 1315 * zero if this is a reference to a type parameter. |
| 1168 * | 1316 * |
| 1169 * Note that since zero is also a valid index into | 1317 * Note that since zero is also a valid index into |
| 1170 * [UnlinkedUnit.references], we cannot distinguish between references to | 1318 * [UnlinkedUnit.references], we cannot distinguish between references to |
| 1171 * type parameters and references to types by checking [reference] against | 1319 * type parameters and references to types by checking [reference] against |
| 1172 * zero. To distinguish between references to type parameters and references | 1320 * zero. To distinguish between references to type parameters and references |
| 1173 * to types, check whether [paramReference] is zero. | 1321 * to types, check whether [paramReference] is zero. |
| 1174 */ | 1322 */ |
| 1175 int get reference; | 1323 int get reference; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 | 1355 |
| 1208 @override | 1356 @override |
| 1209 _TypeRefImpl createObject(fb.BufferPointer bp) => new _TypeRefImpl(bp); | 1357 _TypeRefImpl createObject(fb.BufferPointer bp) => new _TypeRefImpl(bp); |
| 1210 } | 1358 } |
| 1211 | 1359 |
| 1212 class _TypeRefImpl extends Object with _TypeRefMixin implements TypeRef { | 1360 class _TypeRefImpl extends Object with _TypeRefMixin implements TypeRef { |
| 1213 final fb.BufferPointer _bp; | 1361 final fb.BufferPointer _bp; |
| 1214 | 1362 |
| 1215 _TypeRefImpl(this._bp); | 1363 _TypeRefImpl(this._bp); |
| 1216 | 1364 |
| 1365 int _slot; |
| 1217 int _reference; | 1366 int _reference; |
| 1218 int _paramReference; | 1367 int _paramReference; |
| 1219 List<TypeRef> _typeArguments; | 1368 List<TypeRef> _typeArguments; |
| 1220 | 1369 |
| 1221 @override | 1370 @override |
| 1371 int get slot { |
| 1372 _slot ??= const fb.Int32Reader().vTableGet(_bp, 0, 0); |
| 1373 return _slot; |
| 1374 } |
| 1375 |
| 1376 @override |
| 1222 int get reference { | 1377 int get reference { |
| 1223 _reference ??= const fb.Int32Reader().vTableGet(_bp, 0, 0); | 1378 _reference ??= const fb.Int32Reader().vTableGet(_bp, 1, 0); |
| 1224 return _reference; | 1379 return _reference; |
| 1225 } | 1380 } |
| 1226 | 1381 |
| 1227 @override | 1382 @override |
| 1228 int get paramReference { | 1383 int get paramReference { |
| 1229 _paramReference ??= const fb.Int32Reader().vTableGet(_bp, 1, 0); | 1384 _paramReference ??= const fb.Int32Reader().vTableGet(_bp, 2, 0); |
| 1230 return _paramReference; | 1385 return _paramReference; |
| 1231 } | 1386 } |
| 1232 | 1387 |
| 1233 @override | 1388 @override |
| 1234 List<TypeRef> get typeArguments { | 1389 List<TypeRef> get typeArguments { |
| 1235 _typeArguments ??= const fb.ListReader<TypeRef>(const _TypeRefReader()).vTab
leGet(_bp, 2, const <TypeRef>[]); | 1390 _typeArguments ??= const fb.ListReader<TypeRef>(const _TypeRefReader()).vTab
leGet(_bp, 3, const <TypeRef>[]); |
| 1236 return _typeArguments; | 1391 return _typeArguments; |
| 1237 } | 1392 } |
| 1238 } | 1393 } |
| 1239 | 1394 |
| 1240 abstract class _TypeRefMixin implements TypeRef { | 1395 abstract class _TypeRefMixin implements TypeRef { |
| 1241 @override | 1396 @override |
| 1242 Map<String, Object> toMap() => { | 1397 Map<String, Object> toMap() => { |
| 1398 "slot": slot, |
| 1243 "reference": reference, | 1399 "reference": reference, |
| 1244 "paramReference": paramReference, | 1400 "paramReference": paramReference, |
| 1245 "typeArguments": typeArguments, | 1401 "typeArguments": typeArguments, |
| 1246 }; | 1402 }; |
| 1247 } | 1403 } |
| 1248 | 1404 |
| 1249 class UnlinkedClassBuilder extends Object with _UnlinkedClassMixin implements Un
linkedClass { | 1405 class UnlinkedClassBuilder extends Object with _UnlinkedClassMixin implements Un
linkedClass { |
| 1250 bool _finished = false; | 1406 bool _finished = false; |
| 1251 | 1407 |
| 1252 String _name; | 1408 String _name; |
| (...skipping 3941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5194 | 5350 |
| 5195 String _name; | 5351 String _name; |
| 5196 int _nameOffset; | 5352 int _nameOffset; |
| 5197 UnlinkedDocumentationCommentBuilder _documentationComment; | 5353 UnlinkedDocumentationCommentBuilder _documentationComment; |
| 5198 TypeRefBuilder _type; | 5354 TypeRefBuilder _type; |
| 5199 UnlinkedConstBuilder _constExpr; | 5355 UnlinkedConstBuilder _constExpr; |
| 5200 bool _isStatic; | 5356 bool _isStatic; |
| 5201 bool _isFinal; | 5357 bool _isFinal; |
| 5202 bool _isConst; | 5358 bool _isConst; |
| 5203 bool _hasImplicitType; | 5359 bool _hasImplicitType; |
| 5360 int _propagatedTypeSlot; |
| 5204 | 5361 |
| 5205 @override | 5362 @override |
| 5206 String get name => _name ?? ''; | 5363 String get name => _name ?? ''; |
| 5207 | 5364 |
| 5208 /** | 5365 /** |
| 5209 * Name of the variable. | 5366 * Name of the variable. |
| 5210 */ | 5367 */ |
| 5211 void set name(String _value) { | 5368 void set name(String _value) { |
| 5212 assert(!_finished); | 5369 assert(!_finished); |
| 5213 _name = _value; | 5370 _name = _value; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5301 bool get hasImplicitType => _hasImplicitType ?? false; | 5458 bool get hasImplicitType => _hasImplicitType ?? false; |
| 5302 | 5459 |
| 5303 /** | 5460 /** |
| 5304 * Indicates whether this variable lacks an explicit type declaration. | 5461 * Indicates whether this variable lacks an explicit type declaration. |
| 5305 */ | 5462 */ |
| 5306 void set hasImplicitType(bool _value) { | 5463 void set hasImplicitType(bool _value) { |
| 5307 assert(!_finished); | 5464 assert(!_finished); |
| 5308 _hasImplicitType = _value; | 5465 _hasImplicitType = _value; |
| 5309 } | 5466 } |
| 5310 | 5467 |
| 5311 UnlinkedVariableBuilder({String name, int nameOffset, UnlinkedDocumentationCom
mentBuilder documentationComment, TypeRefBuilder type, UnlinkedConstBuilder cons
tExpr, bool isStatic, bool isFinal, bool isConst, bool hasImplicitType}) | 5468 @override |
| 5469 int get propagatedTypeSlot => _propagatedTypeSlot ?? 0; |
| 5470 |
| 5471 /** |
| 5472 * If this variable is propagable, nonzero slot id identifying which entry in |
| 5473 * [LinkedLibrary.types] contains the propagated type for this variable. If |
| 5474 * there is no matching entry in [LinkedLibrary.types], then this variable's |
| 5475 * propagated type is the same as its declared type. |
| 5476 * |
| 5477 * Non-propagable variables have a [propagatedTypeSlot] of zero. |
| 5478 */ |
| 5479 void set propagatedTypeSlot(int _value) { |
| 5480 assert(!_finished); |
| 5481 _propagatedTypeSlot = _value; |
| 5482 } |
| 5483 |
| 5484 UnlinkedVariableBuilder({String name, int nameOffset, UnlinkedDocumentationCom
mentBuilder documentationComment, TypeRefBuilder type, UnlinkedConstBuilder cons
tExpr, bool isStatic, bool isFinal, bool isConst, bool hasImplicitType, int prop
agatedTypeSlot}) |
| 5312 : _name = name, | 5485 : _name = name, |
| 5313 _nameOffset = nameOffset, | 5486 _nameOffset = nameOffset, |
| 5314 _documentationComment = documentationComment, | 5487 _documentationComment = documentationComment, |
| 5315 _type = type, | 5488 _type = type, |
| 5316 _constExpr = constExpr, | 5489 _constExpr = constExpr, |
| 5317 _isStatic = isStatic, | 5490 _isStatic = isStatic, |
| 5318 _isFinal = isFinal, | 5491 _isFinal = isFinal, |
| 5319 _isConst = isConst, | 5492 _isConst = isConst, |
| 5320 _hasImplicitType = hasImplicitType; | 5493 _hasImplicitType = hasImplicitType, |
| 5494 _propagatedTypeSlot = propagatedTypeSlot; |
| 5321 | 5495 |
| 5322 fb.Offset finish(fb.Builder fbBuilder) { | 5496 fb.Offset finish(fb.Builder fbBuilder) { |
| 5323 assert(!_finished); | 5497 assert(!_finished); |
| 5324 _finished = true; | 5498 _finished = true; |
| 5325 fb.Offset offset_name; | 5499 fb.Offset offset_name; |
| 5326 fb.Offset offset_documentationComment; | 5500 fb.Offset offset_documentationComment; |
| 5327 fb.Offset offset_type; | 5501 fb.Offset offset_type; |
| 5328 fb.Offset offset_constExpr; | 5502 fb.Offset offset_constExpr; |
| 5329 if (_name != null) { | 5503 if (_name != null) { |
| 5330 offset_name = fbBuilder.writeString(_name); | 5504 offset_name = fbBuilder.writeString(_name); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 5359 } | 5533 } |
| 5360 if (_isFinal == true) { | 5534 if (_isFinal == true) { |
| 5361 fbBuilder.addBool(6, true); | 5535 fbBuilder.addBool(6, true); |
| 5362 } | 5536 } |
| 5363 if (_isConst == true) { | 5537 if (_isConst == true) { |
| 5364 fbBuilder.addBool(7, true); | 5538 fbBuilder.addBool(7, true); |
| 5365 } | 5539 } |
| 5366 if (_hasImplicitType == true) { | 5540 if (_hasImplicitType == true) { |
| 5367 fbBuilder.addBool(8, true); | 5541 fbBuilder.addBool(8, true); |
| 5368 } | 5542 } |
| 5543 if (_propagatedTypeSlot != null && _propagatedTypeSlot != 0) { |
| 5544 fbBuilder.addInt32(9, _propagatedTypeSlot); |
| 5545 } |
| 5369 return fbBuilder.endTable(); | 5546 return fbBuilder.endTable(); |
| 5370 } | 5547 } |
| 5371 } | 5548 } |
| 5372 | 5549 |
| 5373 /** | 5550 /** |
| 5374 * Unlinked summary information about a top level variable, local variable, or | 5551 * Unlinked summary information about a top level variable, local variable, or |
| 5375 * a field. | 5552 * a field. |
| 5376 */ | 5553 */ |
| 5377 abstract class UnlinkedVariable extends base.SummaryClass { | 5554 abstract class UnlinkedVariable extends base.SummaryClass { |
| 5378 | 5555 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5420 | 5597 |
| 5421 /** | 5598 /** |
| 5422 * Indicates whether the variable is declared using the `const` keyword. | 5599 * Indicates whether the variable is declared using the `const` keyword. |
| 5423 */ | 5600 */ |
| 5424 bool get isConst; | 5601 bool get isConst; |
| 5425 | 5602 |
| 5426 /** | 5603 /** |
| 5427 * Indicates whether this variable lacks an explicit type declaration. | 5604 * Indicates whether this variable lacks an explicit type declaration. |
| 5428 */ | 5605 */ |
| 5429 bool get hasImplicitType; | 5606 bool get hasImplicitType; |
| 5607 |
| 5608 /** |
| 5609 * If this variable is propagable, nonzero slot id identifying which entry in |
| 5610 * [LinkedLibrary.types] contains the propagated type for this variable. If |
| 5611 * there is no matching entry in [LinkedLibrary.types], then this variable's |
| 5612 * propagated type is the same as its declared type. |
| 5613 * |
| 5614 * Non-propagable variables have a [propagatedTypeSlot] of zero. |
| 5615 */ |
| 5616 int get propagatedTypeSlot; |
| 5430 } | 5617 } |
| 5431 | 5618 |
| 5432 class _UnlinkedVariableReader extends fb.TableReader<_UnlinkedVariableImpl> { | 5619 class _UnlinkedVariableReader extends fb.TableReader<_UnlinkedVariableImpl> { |
| 5433 const _UnlinkedVariableReader(); | 5620 const _UnlinkedVariableReader(); |
| 5434 | 5621 |
| 5435 @override | 5622 @override |
| 5436 _UnlinkedVariableImpl createObject(fb.BufferPointer bp) => new _UnlinkedVariab
leImpl(bp); | 5623 _UnlinkedVariableImpl createObject(fb.BufferPointer bp) => new _UnlinkedVariab
leImpl(bp); |
| 5437 } | 5624 } |
| 5438 | 5625 |
| 5439 class _UnlinkedVariableImpl extends Object with _UnlinkedVariableMixin implement
s UnlinkedVariable { | 5626 class _UnlinkedVariableImpl extends Object with _UnlinkedVariableMixin implement
s UnlinkedVariable { |
| 5440 final fb.BufferPointer _bp; | 5627 final fb.BufferPointer _bp; |
| 5441 | 5628 |
| 5442 _UnlinkedVariableImpl(this._bp); | 5629 _UnlinkedVariableImpl(this._bp); |
| 5443 | 5630 |
| 5444 String _name; | 5631 String _name; |
| 5445 int _nameOffset; | 5632 int _nameOffset; |
| 5446 UnlinkedDocumentationComment _documentationComment; | 5633 UnlinkedDocumentationComment _documentationComment; |
| 5447 TypeRef _type; | 5634 TypeRef _type; |
| 5448 UnlinkedConst _constExpr; | 5635 UnlinkedConst _constExpr; |
| 5449 bool _isStatic; | 5636 bool _isStatic; |
| 5450 bool _isFinal; | 5637 bool _isFinal; |
| 5451 bool _isConst; | 5638 bool _isConst; |
| 5452 bool _hasImplicitType; | 5639 bool _hasImplicitType; |
| 5640 int _propagatedTypeSlot; |
| 5453 | 5641 |
| 5454 @override | 5642 @override |
| 5455 String get name { | 5643 String get name { |
| 5456 _name ??= const fb.StringReader().vTableGet(_bp, 0, ''); | 5644 _name ??= const fb.StringReader().vTableGet(_bp, 0, ''); |
| 5457 return _name; | 5645 return _name; |
| 5458 } | 5646 } |
| 5459 | 5647 |
| 5460 @override | 5648 @override |
| 5461 int get nameOffset { | 5649 int get nameOffset { |
| 5462 _nameOffset ??= const fb.Int32Reader().vTableGet(_bp, 1, 0); | 5650 _nameOffset ??= const fb.Int32Reader().vTableGet(_bp, 1, 0); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5497 bool get isConst { | 5685 bool get isConst { |
| 5498 _isConst ??= const fb.BoolReader().vTableGet(_bp, 7, false); | 5686 _isConst ??= const fb.BoolReader().vTableGet(_bp, 7, false); |
| 5499 return _isConst; | 5687 return _isConst; |
| 5500 } | 5688 } |
| 5501 | 5689 |
| 5502 @override | 5690 @override |
| 5503 bool get hasImplicitType { | 5691 bool get hasImplicitType { |
| 5504 _hasImplicitType ??= const fb.BoolReader().vTableGet(_bp, 8, false); | 5692 _hasImplicitType ??= const fb.BoolReader().vTableGet(_bp, 8, false); |
| 5505 return _hasImplicitType; | 5693 return _hasImplicitType; |
| 5506 } | 5694 } |
| 5695 |
| 5696 @override |
| 5697 int get propagatedTypeSlot { |
| 5698 _propagatedTypeSlot ??= const fb.Int32Reader().vTableGet(_bp, 9, 0); |
| 5699 return _propagatedTypeSlot; |
| 5700 } |
| 5507 } | 5701 } |
| 5508 | 5702 |
| 5509 abstract class _UnlinkedVariableMixin implements UnlinkedVariable { | 5703 abstract class _UnlinkedVariableMixin implements UnlinkedVariable { |
| 5510 @override | 5704 @override |
| 5511 Map<String, Object> toMap() => { | 5705 Map<String, Object> toMap() => { |
| 5512 "name": name, | 5706 "name": name, |
| 5513 "nameOffset": nameOffset, | 5707 "nameOffset": nameOffset, |
| 5514 "documentationComment": documentationComment, | 5708 "documentationComment": documentationComment, |
| 5515 "type": type, | 5709 "type": type, |
| 5516 "constExpr": constExpr, | 5710 "constExpr": constExpr, |
| 5517 "isStatic": isStatic, | 5711 "isStatic": isStatic, |
| 5518 "isFinal": isFinal, | 5712 "isFinal": isFinal, |
| 5519 "isConst": isConst, | 5713 "isConst": isConst, |
| 5520 "hasImplicitType": hasImplicitType, | 5714 "hasImplicitType": hasImplicitType, |
| 5715 "propagatedTypeSlot": propagatedTypeSlot, |
| 5521 }; | 5716 }; |
| 5522 } | 5717 } |
| 5523 | 5718 |
| OLD | NEW |