Skip to main content

dart-aot-development

Instructions on building and testing changes using Dart AOT mode. Use when working on Dart runtime, Dart AOT compiler or other related components.

来源信息

仓库
dart-lang/sdk
最近来源活动
2026年10月5日 22:08
检测到的 SKILL.md 语言
英语
星标
11,303
分支
1,907

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
dart-aot-development
description
Instructions on building and testing changes using Dart AOT mode. Use when working on Dart runtime, Dart AOT compiler or other related components.
# Testing changes to Dart SDK in AOT mode If you are making changes to Dart SDK (including but not limited to modifying Dart VM runtime, Dart VM compiler pipeline, Dart common front-end, Dart type flow analysis, etc) and you want to test the changes in AOT mode, you should use the following instructions. 1. Build `gen_snapshot`, `vm_platform.dill` and `dartaotruntime` targets using the following command `tools/build.py -m $MODE -a $ARCH --rbe gen_snapshot vm_platform.dill dartaotruntime`. Here `$MODE` specifies preferred compilation mode (`debug` or `release`), `$ARCH` specifies target architecture (e.g. `x64`, `arm64`). Prefer building using `release` mode and prefer using `$ARCH` that matches the host unless something else is requested. A combination of `$MODE` and `$ARCH` is called `DART_CONFIGURATION` (e.g. `ReleaseX64` is `release` build targeting `x64`). 2. Use helper script `pkg/vm/tool/precompiler2 test.dart test.aot` to compile test script `test.dart` to AOT snapshot `test.aot`. To check commands executed by the script you can pass `-v` to the script. 3. Use `out/${DART_CONFIGURATION}/dartaotruntime test.aot` to execute AOT snapshot. 4. Use `perf record -g out/${DART_CONFIGURATION}/dartaotruntime test.aot` to profile the code and `perf report` and `perf annotate` to explore performance of different parts of code. 5. Use `--print-flow-graph` flag to get IL generated by optimizing compiler, `--print-flow-graph-filter=$NAME_STR` allows to filter out only methods which contain $NAME_STR in their fully qualified names. You can also use `--disassemble --code-comments` to dump disassembly annotated with IL instructions. The output produced by all these flags is written to stderr. You can pass these flags to `precompiler2` script. 6. When making changes to runtime system, AOT compiler or core libraries - always make sure to rebuild Dart SDK components given in the first item of this list before recompiling and rerunning test or benchmark code.
在 GitHub 查看