Index: pkg/kernel/binary.md |
diff --git a/pkg/kernel/binary.md b/pkg/kernel/binary.md |
index f9f415f7e062b2a31dad79916011e57737c898d3..3261f139c739422108e3b4afcb5a894a10788dcc 100644 |
--- a/pkg/kernel/binary.md |
+++ b/pkg/kernel/binary.md |
@@ -346,6 +346,7 @@ type InvalidExpression extends Expression { |
type VariableGet extends Expression { |
Byte tag = 20; |
FileOffset fileOffset; |
+ UInt variableDeclarationPosition; // Byte offset in the binary for the variable declaration. |
VariableReference variable; |
} |
@@ -353,11 +354,13 @@ type SpecializedVariableGet extends Expression { |
Byte tag = 128 + N; // Where 0 <= N < 8. |
// Equivalent to a VariableGet with index N. |
FileOffset fileOffset; |
+ UInt variableDeclarationPosition; // Byte offset in the binary for the variable declaration. |
} |
type VariableSet extends Expression { |
Byte tag = 21; |
FileOffset fileOffset; |
+ UInt variableDeclarationPosition; // Byte offset in the binary for the variable declaration. |
VariableReference variable; |
Expression value; |
} |
@@ -365,6 +368,7 @@ type VariableSet extends Expression { |
type SpecializedVariableSet extends Expression { |
Byte tag = 136 + N; // Where 0 <= N < 8. |
FileOffset fileOffset; |
+ UInt variableDeclarationPosition; // Byte offset in the binary for the variable declaration. |
Expression value; |
// Equivalent to VariableSet with index N. |
} |
@@ -429,6 +433,7 @@ type StaticSet extends Expression { |
type Arguments { |
// Note: there is no tag on Arguments. |
+ UInt numArguments; // equals positional.length + named.length |
List<DartType> types; |
List<Expression> positional; |
List<NamedExpression> named; |
@@ -780,10 +785,14 @@ type SwitchStatement extends Statement { |
List<SwitchCase> cases; |
} |
+type FileOffsetAndExpressionPair { |
Kevin Millikin (Google)
2017/05/11 10:38:35
I'd just add at the top of the spec (maybe just be
jensj
2017/05/11 12:59:24
Done.
|
+ FileOffset offset; |
+ Expression expression; |
+} |
+ |
type SwitchCase { |
// Note: there is no tag on SwitchCase |
- List<Expression> expressions; |
- FileOffset[expressions.length] expressionOffsets; // 1-to-1 with expressions. |
+ List<FileOffsetAndExpressionPair> expressions; |
Byte isDefault; // 1 if default, 0 is not default. |
Statement body; |
} |
@@ -819,6 +828,7 @@ type ReturnStatement extends Statement { |
type TryCatch extends Statement { |
Byte tag = 75; |
Statement body; |
+ Byte anyCatchNeedsStackTrace; // 1 if any catch needs a stacktrace (have a stacktrace variable). |
List<Catch> catches; |
} |
@@ -910,6 +920,7 @@ type FunctionType extends DartType { |
Byte tag = 94; |
List<TypeParameter> typeParameters; |
UInt requiredParameterCount; |
+ UInt totalParameterCount; // positionalParameters.length + namedParameters.length |
List<DartType> positionalParameters; |
List<NamedDartType> namedParameters; |
DartType returnType; |
@@ -949,6 +960,10 @@ type TypeParameterType extends DartType { |
// the class type parameters in a constructor refer to those declared on the |
// class. |
UInt index; |
+ |
+ // Byte offset in the binary for the type declaration. |
+ // Note: This can also be 0, which is a 'forward reference' and is not to be used. |
+ UInt typeParameterPosition; |
} |
type VectorType extends DartType { |