Before this CL the verifiers `visitInterfaceType` would start by calling `node.visitChildren(this);` and finish by calling `defaultDartType(node);` which calls `defaultNode(node)` which calls `node.visitChildren(this);`. This means that we call `visitChildren` twice which means exponential --- e.g. the added test with nested Lists (List mentioned 40 times) the innermost type would have been visited 549,755,813,888 times (that's 500+ billion times) (for a total of 1 trillion+ visits to types for that alone). Fixes https://github.com/dart-lang/sdk/issues/49780. PS: We don't want to run the formatter on that either. It doesn't exhibit bad speed-wise behavior but the output isn't exactly pretty. Change-Id: Ibb2f0d2669511934badb562cb96ee439bd44bebd Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256121 Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Jens Johansen <jensj@google.com> Reviewed-by: Aske Simon Christensen <askesc@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.