This CL changes the way dart: libraries are considered supported when used in conditional imports or bool.fromEnvironment constant using the "dart.library.*" values. Library nodes now has an isUnsupported flag which is set according to the "supported" property in the libraries specification. Furthermore the Target now supplies a DartLibrarySupport interface that allows targets to override whether dart: libraries are unsupported. This allows the JIT/AOT to use the same platform file but still consider dart:mirrors unsupported in AOT mode, and dart2js to consider the internal library `dart:_dart2js_runtime_metrics` supported. Furthermore, the internal handling is changed so that condition imports and bool.fromEnvironments constants are computed through the same logic for "dart.library.*" values, avoiding the need for passing these values through the environment. TEST=pkg/front_end/testcases/general/supported_libraries/main Closes https://github.com/dart-lang/sdk/issues/48057 Closes https://github.com/dart-lang/sdk/issues/47814 Closes https://github.com/dart-lang/sdk/issues/47243 Closes https://github.com/dart-lang/sdk/issues/32657 Closes https://github.com/dart-lang/sdk/issues/36460 Change-Id: Ie8f8dff99167de64ced51b71d89918bf0f3bbd13 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/227020 Reviewed-by: Sigmund Cherem <sigmund@google.com> Reviewed-by: Alexander Markov <alexmarkov@google.com> Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Dart Kernel
Dart Kernel is a small high-level language derived from Dart. It is designed for use as an intermediate format for whole-program analysis and transformations, and to be consumed by codegen and execution backends.
The kernel language has an in-memory representation in Dart and can be serialized as binary or text.
Both the kernel language and its implementations are unstable and are under development.
This package contains the Dart part of the implementation and contains:
- A transformable IR for the kernel language
- Serialization of kernel code
Note: The APIs in this package are in an early state; developers should be careful about depending on this package. In particular, there is no semver contract for release versions of this package. Please depend directly on individual versions.
See ast.dart for the in-memory IR, or binary.md for a description of the binary format. For now, the textual format is very ad-hoc and cannot be parsed back in.