79fa199a2b
To support internal compilations, dart2wasm must be able to run in phases. There are a few reasons for this: 1) Kernel transforms are run on the program after the CFE has run. We must emit a dill that frameworks can transform and then pass the transformed dill back to dart2wasm. 2) This allows us to avoid forge limits by running each phase of the compiler in separate blaze actions. TFA has the chance of running long on large programs and so it might be beneficial to run it as its own action. This implementation currently supports 3 phases: "cfe", "tfa", "codegen" They can be run collectively or in any consecutive combination. Phases are specified via a '--phases' multi-option. Any data that needs to be passed between the phases is encoded directly into the serialized dill. This also opens up the opportunity to make "opt" its own phase that runs wasm-opt on the wasm emitted from the codegen phase. Change-Id: Ide830763f7063c7ab880e8e54dc47bd32fd4e7cd Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/455280 Commit-Queue: Nate Biggs <natebiggs@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com>