The objective of this CL is to allow the incremental compiler to track which dill input libraries it actually used (in order to - in a modular context - be able to ignore changes to dependencies we didn't really use). This is done by: * Making the dill library builder lazy (and mark if it has been used). * Making kernels class hierarchy record which classes it has been asked questions about. * Add special handling to redirecting factory constructors as they bypass the fasta-builders and directly use the kernel ast. Please note that: * This has to be enabled, but kernels class hierarchy always records which classes it was asked about (even if disabled, or not running though the incremental compiler). There might potentially be some overhead to this (though setting a bool to true is probably comparably cheap - we did just do a map lookup). * This was designed to be used together with modules (e.g. setModulesToLoadOnNextComputeDelta) - as used via for instance api_unstable/bazel_worker.dart. It might not function the way you'd expect in other circumstances. * The incremental compiler (potentially) gives you the full kernel tree despite not having marked all of those libraries as 'used'. If a client use such libraries it is the clients responsibility to take that into account when answering any questions about this libraries/dill files was used. * This feature works on the library level. In practice it is most likely needed at the dill-filename level. A translation from library to dill-filename is up to the client. * This is a new feature, and we cannot promise that 100% of actually used libraries are marked. If you find used but un-marked libraries please report a bug. Change-Id: I01d7ff95b9baac9550b77d8e09ea772d43173641 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107280 Commit-Queue: Jens Johansen <jensj@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>
Front end for Dart
This package provides a low-level API for use by compiler back ends that wish to implement the Dart language. It is intended for eventual use by dev_compiler, dart2js, and the Dart VM. In addition, it will share implementation details with the analyzer package--this will be accomplished by having the analyzer package import (and re-export) parts of this package's private implementation.
End-users should use the [dartanalyzer][analyzercli] command-line tool to analyze their Dart code.
Integrators that want to write tools that analyze Dart code should use the [analyzer] package.
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.