Chromium Code Reviews| 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 /** | 5 /** |
| 6 * This file is an "idl" style description of the summary format. It | 6 * This file is an "idl" style description of the summary format. It |
| 7 * contains abstract classes which declare the interface for reading data from | 7 * contains abstract classes which declare the interface for reading data from |
| 8 * summaries. It is parsed and transformed into code that implements the | 8 * summaries. It is parsed and transformed into code that implements the |
| 9 * summary format. | 9 * summary format. |
| 10 * | 10 * |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 509 * potentially constant expression. | 509 * potentially constant expression. |
| 510 * | 510 * |
| 511 * Constant expressions are represented using a simple stack-based language | 511 * Constant expressions are represented using a simple stack-based language |
| 512 * where [operations] is a sequence of operations to execute starting with an | 512 * where [operations] is a sequence of operations to execute starting with an |
| 513 * empty stack. Once all operations have been executed, the stack should | 513 * empty stack. Once all operations have been executed, the stack should |
| 514 * contain a single value which is the value of the constant. Note that some | 514 * contain a single value which is the value of the constant. Note that some |
| 515 * operations consume additional data from the other fields of this class. | 515 * operations consume additional data from the other fields of this class. |
| 516 */ | 516 */ |
| 517 abstract class UnlinkedConst extends base.SummaryClass { | 517 abstract class UnlinkedConst extends base.SummaryClass { |
| 518 /** | 518 /** |
| 519 * Indicates whether the expression is a valid potentially constant | |
| 520 * expression. | |
| 521 */ | |
| 522 bool get isValid; | |
|
Paul Berry
2016/02/08 15:02:23
Change this to `isInvalid`. That way in the norma
scheglov
2016/02/08 17:01:42
Done.
| |
| 523 | |
| 524 /** | |
| 519 * Sequence of operations to execute (starting with an empty stack) to form | 525 * Sequence of operations to execute (starting with an empty stack) to form |
| 520 * the constant value. | 526 * the constant value. |
| 521 */ | 527 */ |
| 522 List<UnlinkedConstOperation> get operations; | 528 List<UnlinkedConstOperation> get operations; |
| 523 | 529 |
| 524 /** | 530 /** |
| 525 * Sequence of unsigned 32-bit integers consumed by the operations | 531 * Sequence of unsigned 32-bit integers consumed by the operations |
| 526 * `pushArgument`, `pushInt`, `shiftOr`, `concatenate`, `invokeConstructor`, | 532 * `pushArgument`, `pushInt`, `shiftOr`, `concatenate`, `invokeConstructor`, |
| 527 * `makeList`, and `makeMap`. | 533 * `makeList`, and `makeMap`. |
| 528 */ | 534 */ |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1178 * this variable, so its static type is `dynamic`. | 1184 * this variable, so its static type is `dynamic`. |
| 1179 * | 1185 * |
| 1180 * Note that although strong mode considers initializing formals to be | 1186 * Note that although strong mode considers initializing formals to be |
| 1181 * inferable, they are not marked as such in the summary; if their type is | 1187 * inferable, they are not marked as such in the summary; if their type is |
| 1182 * not specified, they always inherit the static type of the corresponding | 1188 * not specified, they always inherit the static type of the corresponding |
| 1183 * field. | 1189 * field. |
| 1184 */ | 1190 */ |
| 1185 int get inferredTypeSlot; | 1191 int get inferredTypeSlot; |
| 1186 | 1192 |
| 1187 /** | 1193 /** |
| 1188 * If the parameter has a default value the constant expression in the | 1194 * If the parameter has a default value, the constant expression in the |
| 1189 * default value. | 1195 * default value. Note that the presence of this expression does not mean |
| 1196 * that it is a valid , check [UnlinkedConst.isValid]. | |
| 1190 */ | 1197 */ |
| 1191 UnlinkedConst get defaultValue; | 1198 UnlinkedConst get defaultValue; |
| 1192 } | 1199 } |
| 1193 | 1200 |
| 1194 /** | 1201 /** |
| 1195 * Enum used to indicate the kind of a parameter. | 1202 * Enum used to indicate the kind of a parameter. |
| 1196 */ | 1203 */ |
| 1197 enum UnlinkedParamKind { | 1204 enum UnlinkedParamKind { |
| 1198 /** | 1205 /** |
| 1199 * Parameter is required. | 1206 * Parameter is required. |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1487 @informative | 1494 @informative |
| 1488 UnlinkedDocumentationComment get documentationComment; | 1495 UnlinkedDocumentationComment get documentationComment; |
| 1489 | 1496 |
| 1490 /** | 1497 /** |
| 1491 * Declared type of the variable. Absent if the type is implicit. | 1498 * Declared type of the variable. Absent if the type is implicit. |
| 1492 */ | 1499 */ |
| 1493 EntityRef get type; | 1500 EntityRef get type; |
| 1494 | 1501 |
| 1495 /** | 1502 /** |
| 1496 * If [isConst] is true, and the variable has an initializer, the constant | 1503 * If [isConst] is true, and the variable has an initializer, the constant |
| 1497 * expression in the initializer. | 1504 * expression in the initializer. Note that the presence of this expression |
| 1505 * does not mean that it is a valid, check [UnlinkedConst.isValid]. | |
| 1498 */ | 1506 */ |
| 1499 UnlinkedConst get constExpr; | 1507 UnlinkedConst get constExpr; |
| 1500 | 1508 |
| 1501 /** | 1509 /** |
| 1502 * Indicates whether the variable is declared using the `static` keyword. | 1510 * Indicates whether the variable is declared using the `static` keyword. |
| 1503 * | 1511 * |
| 1504 * Note that for top level variables, this flag is false, since they are not | 1512 * Note that for top level variables, this flag is false, since they are not |
| 1505 * declared using the `static` keyword (even though they are considered | 1513 * declared using the `static` keyword (even though they are considered |
| 1506 * static for semantic purposes). | 1514 * static for semantic purposes). |
| 1507 */ | 1515 */ |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 1528 int get propagatedTypeSlot; | 1536 int get propagatedTypeSlot; |
| 1529 | 1537 |
| 1530 /** | 1538 /** |
| 1531 * If this variable is inferable, nonzero slot id identifying which entry in | 1539 * If this variable is inferable, nonzero slot id identifying which entry in |
| 1532 * [LinkedLibrary.types] contains the inferred type for this variable. If | 1540 * [LinkedLibrary.types] contains the inferred type for this variable. If |
| 1533 * there is no matching entry in [LinkedLibrary.types], then no type was | 1541 * there is no matching entry in [LinkedLibrary.types], then no type was |
| 1534 * inferred for this variable, so its static type is `dynamic`. | 1542 * inferred for this variable, so its static type is `dynamic`. |
| 1535 */ | 1543 */ |
| 1536 int get inferredTypeSlot; | 1544 int get inferredTypeSlot; |
| 1537 } | 1545 } |
| OLD | NEW |