Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 This file describes the binary format of Dart Kernel. | 1 This file describes the binary format of Dart Kernel. |
| 2 | 2 |
| 3 Notation | 3 Notation |
| 4 -------- | 4 -------- |
| 5 Bitmasks are described with the syntax: | 5 Bitmasks are described with the syntax: |
| 6 ```scala | 6 ```scala |
| 7 Byte flags (flag1, flag2, ..., flagN) | 7 Byte flags (flag1, flag2, ..., flagN) |
| 8 ``` | 8 ``` |
| 9 where 'flag<N>' is the N-th least significant bit, | 9 where 'flag<N>' is the N-th least significant bit, |
| 10 (so flag1 is the least significant bit). | 10 (so flag1 is the least significant bit). |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 428 } | 428 } |
| 429 | 429 |
| 430 type StaticGet extends Expression { | 430 type StaticGet extends Expression { |
| 431 Byte tag = 26; | 431 Byte tag = 26; |
| 432 FileOffset fileOffset; | 432 FileOffset fileOffset; |
| 433 MemberReference target; | 433 MemberReference target; |
| 434 } | 434 } |
| 435 | 435 |
| 436 type StaticSet extends Expression { | 436 type StaticSet extends Expression { |
| 437 Byte tag = 27; | 437 Byte tag = 27; |
| 438 FileOffset fileOffset; | |
| 438 MemberReference target; | 439 MemberReference target; |
| 439 Expression value; | 440 Expression value; |
| 440 } | 441 } |
| 441 | 442 |
| 442 type Arguments { | 443 type Arguments { |
| 443 // Note: there is no tag on Arguments. | 444 // Note: there is no tag on Arguments. |
| 444 List<DartType> types; | 445 List<DartType> types; |
| 445 List<Expression> positional; | 446 List<Expression> positional; |
| 446 List<NamedExpression> named; | 447 List<NamedExpression> named; |
| 447 } | 448 } |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 538 | 539 |
| 539 type IsExpression extends Expression { | 540 type IsExpression extends Expression { |
| 540 Byte tag = 37; | 541 Byte tag = 37; |
| 541 FileOffset fileOffset; | 542 FileOffset fileOffset; |
| 542 Expression operand; | 543 Expression operand; |
| 543 DartType type; | 544 DartType type; |
| 544 } | 545 } |
| 545 | 546 |
| 546 type AsExpression extends Expression { | 547 type AsExpression extends Expression { |
| 547 Byte tag = 38; | 548 Byte tag = 38; |
| 549 FileOffset fileOffset; | |
| 548 Expression operand; | 550 Expression operand; |
| 549 DartType type; | 551 DartType type; |
| 550 } | 552 } |
| 551 | 553 |
| 552 type StringLiteral extends Expression { | 554 type StringLiteral extends Expression { |
| 553 Byte tag = 39; | 555 Byte tag = 39; |
| 554 StringReference value; | 556 StringReference value; |
| 555 } | 557 } |
| 556 | 558 |
| 557 type SpecializedIntLiteral extends Expression { | 559 type SpecializedIntLiteral extends Expression { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 610 } | 612 } |
| 611 | 613 |
| 612 type Throw extends Expression { | 614 type Throw extends Expression { |
| 613 Byte tag = 48; | 615 Byte tag = 48; |
| 614 FileOffset fileOffset; | 616 FileOffset fileOffset; |
| 615 Expression value; | 617 Expression value; |
| 616 } | 618 } |
| 617 | 619 |
| 618 type ListLiteral extends Expression { | 620 type ListLiteral extends Expression { |
| 619 Byte tag = 49; | 621 Byte tag = 49; |
| 622 FileOffset fileOffset; | |
| 620 DartType typeArgument; | 623 DartType typeArgument; |
| 621 List<Expression> values; | 624 List<Expression> values; |
| 622 } | 625 } |
| 623 | 626 |
| 624 type ConstListLiteral extends Expression { | 627 type ConstListLiteral extends Expression { |
| 625 Byte tag = 58; // Note: tag is out of order. | 628 Byte tag = 58; // Note: tag is out of order. |
| 629 FileOffset fileOffset; | |
| 626 DartType typeArgument; | 630 DartType typeArgument; |
| 627 List<Expression> values; | 631 List<Expression> values; |
| 628 } | 632 } |
| 629 | 633 |
| 630 type MapLiteral extends Expression { | 634 type MapLiteral extends Expression { |
| 631 Byte tag = 50; | 635 Byte tag = 50; |
| 632 FileOffset fileOffset; | 636 FileOffset fileOffset; |
| 633 DartType keyType; | 637 DartType keyType; |
| 634 DartType valueType; | 638 DartType valueType; |
| 635 List<MapEntry> entries; | 639 List<MapEntry> entries; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 690 Option<Expression> message; | 694 Option<Expression> message; |
| 691 } | 695 } |
| 692 | 696 |
| 693 type LabeledStatement extends Statement { | 697 type LabeledStatement extends Statement { |
| 694 Byte tag = 65; | 698 Byte tag = 65; |
| 695 Statement body; | 699 Statement body; |
| 696 } | 700 } |
| 697 | 701 |
| 698 type BreakStatement extends Statement { | 702 type BreakStatement extends Statement { |
| 699 Byte tag = 66; | 703 Byte tag = 66; |
| 704 FileOffset fileOffset; | |
| 700 | 705 |
| 701 // Reference to the Nth LabeledStatement in scope, with 0 being the | 706 // Reference to the Nth LabeledStatement in scope, with 0 being the |
| 702 // outermost enclosing labeled statement within the same FunctionNode. | 707 // outermost enclosing labeled statement within the same FunctionNode. |
| 703 // | 708 // |
| 704 // Labels are not in scope across function boundaries. | 709 // Labels are not in scope across function boundaries. |
| 705 UInt labelIndex; | 710 UInt labelIndex; |
| 706 } | 711 } |
| 707 | 712 |
| 708 type WhileStatement extends Statement { | 713 type WhileStatement extends Statement { |
| 709 Byte tag = 67; | 714 Byte tag = 67; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 805 Byte flags (isYieldStar); | 810 Byte flags (isYieldStar); |
| 806 Expression expression; | 811 Expression expression; |
| 807 } | 812 } |
| 808 | 813 |
| 809 type VariableDeclarationStatement extends Statement { | 814 type VariableDeclarationStatement extends Statement { |
| 810 Byte tag = 78; | 815 Byte tag = 78; |
| 811 VariableDeclaration variable; | 816 VariableDeclaration variable; |
| 812 } | 817 } |
| 813 | 818 |
| 814 type VariableDeclaration { | 819 type VariableDeclaration { |
| 815 FileOffset fileOffset; | 820 FileOffset fileOffset; |
|
Kevin Millikin (Google)
2017/02/08 15:37:51
Document these two offsets here.
jensj
2017/02/13 14:04:15
Done.
| |
| 821 FileOffset fileEqualsOffset; | |
| 816 Byte flags (isFinal, isConst); | 822 Byte flags (isFinal, isConst); |
| 817 // For named parameters, this is the parameter name. | 823 // For named parameters, this is the parameter name. |
| 818 // For other variables, the name is cosmetic, may be empty, | 824 // For other variables, the name is cosmetic, may be empty, |
| 819 // and is not necessarily unique. | 825 // and is not necessarily unique. |
| 820 StringReference name; | 826 StringReference name; |
| 821 DartType type; | 827 DartType type; |
| 822 Option<InferredValue> inferredValue; | 828 Option<InferredValue> inferredValue; |
| 823 | 829 |
| 824 // For statements and for-loops, this is the initial value. | 830 // For statements and for-loops, this is the initial value. |
| 825 // For optional parameters, this is the default value (if given). | 831 // For optional parameters, this is the default value (if given). |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 917 | 923 |
| 918 /* enum BaseClassKind { None, Exact, Subclass, Subtype, } */ | 924 /* enum BaseClassKind { None, Exact, Subclass, Subtype, } */ |
| 919 | 925 |
| 920 type InferredValue { | 926 type InferredValue { |
| 921 ClassReference baseClass; // May be NullReference if kind = None. | 927 ClassReference baseClass; // May be NullReference if kind = None. |
| 922 Byte kind; // Index into BaseClassKind. | 928 Byte kind; // Index into BaseClassKind. |
| 923 Byte valueBits; // See lib/type_propagation/type_propagation.dart | 929 Byte valueBits; // See lib/type_propagation/type_propagation.dart |
| 924 } | 930 } |
| 925 | 931 |
| 926 ``` | 932 ``` |
| OLD | NEW |