diff --git a/pkg/front_end/testcases/old_dills/dart2js.version.32.compile.1.dill b/pkg/front_end/testcases/old_dills/dart2js.version.32.compile.1.dill new file mode 100644 index 00000000000..ce5e225e5fa Binary files /dev/null and b/pkg/front_end/testcases/old_dills/dart2js.version.32.compile.1.dill differ diff --git a/pkg/kernel/binary.md b/pkg/kernel/binary.md index cad20ee8ace..472c73e7799 100644 --- a/pkg/kernel/binary.md +++ b/pkg/kernel/binary.md @@ -143,7 +143,7 @@ type CanonicalName { type ComponentFile { UInt32 magic = 0x90ABCDEF; - UInt32 formatVersion = 31; + UInt32 formatVersion = 32; List problemsAsJson; // Described in problems.md. Library[] libraries; UriSource sourceMap; @@ -228,7 +228,7 @@ type Name { } type Library { - Byte flags (isExternal, isSynthetic); + Byte flags (isExternal, isSynthetic, isNonNullableOptedIn); UInt languageVersionMajor; UInt languageVersionMinor; CanonicalNameReference canonicalName; diff --git a/pkg/kernel/lib/ast.dart b/pkg/kernel/lib/ast.dart index 3a8463ec6e7..cb04d5887a4 100644 --- a/pkg/kernel/lib/ast.dart +++ b/pkg/kernel/lib/ast.dart @@ -330,6 +330,7 @@ class Library extends NamedNode static const int ExternalFlag = 1 << 0; static const int SyntheticFlag = 1 << 1; + static const int NonNullableOptedInFlag = 1 << 2; int flags = 0; @@ -354,6 +355,13 @@ class Library extends NamedNode flags = value ? (flags | SyntheticFlag) : (flags & ~SyntheticFlag); } + bool get isNonNullableOptedIn => (flags & NonNullableOptedInFlag) != 0; + void set isNonNullableOptedIn(bool value) { + flags = value + ? (flags | NonNullableOptedInFlag) + : (flags & ~NonNullableOptedInFlag); + } + String name; /// Problems in this [Library] encoded as json objects. diff --git a/pkg/kernel/lib/binary/tag.dart b/pkg/kernel/lib/binary/tag.dart index dc930734319..0645cb934ce 100644 --- a/pkg/kernel/lib/binary/tag.dart +++ b/pkg/kernel/lib/binary/tag.dart @@ -146,7 +146,7 @@ class Tag { /// Internal version of kernel binary format. /// Bump it when making incompatible changes in kernel binaries. /// Keep in sync with runtime/vm/kernel_binary.h, pkg/kernel/binary.md. - static const int BinaryFormatVersion = 31; + static const int BinaryFormatVersion = 32; } abstract class ConstantTag { diff --git a/runtime/vm/kernel_binary.h b/runtime/vm/kernel_binary.h index 009cab20aa1..2a9d614a163 100644 --- a/runtime/vm/kernel_binary.h +++ b/runtime/vm/kernel_binary.h @@ -20,7 +20,7 @@ static const uint32_t kMagicProgramFile = 0x90ABCDEFu; // Both version numbers are inclusive. static const uint32_t kMinSupportedKernelFormatVersion = 18; -static const uint32_t kMaxSupportedKernelFormatVersion = 31; +static const uint32_t kMaxSupportedKernelFormatVersion = 32; // Keep in sync with package:kernel/lib/binary/tag.dart #define KERNEL_TAG_LIST(V) \