[VM/dartdev] Switch dartdev to use an AOT runtime.
- split the Dart CLI tool out of the VM into it's own embedder which runs in AOT mode. The pure Dart VM executable is called 'dartvm' and has no Dart CLI functionality in it - the Dart CLI executable parses the CLI commands and invokes the rest of the AOT tools in the same process, for the 'run' and 'test' commands it execs a process which runs 'dartvm' to run - 'dart hello.dart' execs the 'dartvm' process and runs 'hello.dart' - the Dart CLI is not generated for ia32 as we are not shipping a Dart SDK for ia32 anymore (support to execute the 'dartvm' for ia32 architecture is retained) - the Dart CLI tool is not built in the internal Dart SDK builds TEST=ci Some performance improvement numbers 'dart format pkg/dartdev' goes from 1.17 secs to 0.22 secs 'dart doc pkg/dartdev' goes from 100.2 secs to 66.6 secs 'dart fix pkg/dartdev' goes from 19.3 secs to 14.5 secs Change-Id: I66984a26cb2ab014b34dc1873f1f3d2884e13518 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364202 Commit-Queue: Ben Konyi <bkonyi@google.com> Reviewed-by: Ben Konyi <bkonyi@google.com>
This commit is contained in:
@@ -186,7 +186,7 @@ template("application_snapshot") {
|
||||
assert(training_deps != "", "Ignoring unused argument")
|
||||
}
|
||||
} else {
|
||||
dart_action(target_name) {
|
||||
dartvm_action(target_name) {
|
||||
if (defined(invoker.pool)) {
|
||||
pool = invoker.pool
|
||||
}
|
||||
|
||||
+1
-10
@@ -54,9 +54,7 @@ sdk_root = "../../sdk"
|
||||
|
||||
application_snapshot("dart2js") {
|
||||
deps = [ ":dart2js_create_snapshot_entry" ]
|
||||
training_deps = [
|
||||
":compile_dart2js_platform",
|
||||
]
|
||||
training_deps = [ ":compile_dart2js_platform" ]
|
||||
training_inputs = [
|
||||
"$root_out_dir/dart2js_platform.dill",
|
||||
"$root_out_dir/dart2js_outline.dill",
|
||||
@@ -77,13 +75,6 @@ application_snapshot("dart2js") {
|
||||
]
|
||||
}
|
||||
|
||||
aot_snapshot("dart2js_aot") {
|
||||
deps = [ ":dart2js_create_snapshot_entry" ]
|
||||
|
||||
main_dart = "$target_gen_dir/dart2js.dart"
|
||||
name = "dart2js_aot"
|
||||
}
|
||||
|
||||
aot_snapshot("dart2js_sdk_aot") {
|
||||
deps = [ ":dart2js_create_snapshot_entry" ]
|
||||
|
||||
|
||||
+36
-7
@@ -3,8 +3,34 @@
|
||||
# BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import("../../build/dart/copy_tree.gni")
|
||||
import("../aot_snapshot.gni")
|
||||
import("../application_snapshot.gni")
|
||||
|
||||
group("dartdev_aot") {
|
||||
public_deps = [
|
||||
":copy_prebuilt_devtools",
|
||||
":dartdev_aot_snapshot",
|
||||
]
|
||||
}
|
||||
|
||||
aot_snapshot("dartdev_aot_profile_snapshot") {
|
||||
main_dart = "../../pkg/dartdev/bin/dartdev.dart"
|
||||
output = "$root_out_dir/dartdev_aot_profile.dart.snapshot"
|
||||
}
|
||||
|
||||
aot_snapshot("dartdev_aot_snapshot") {
|
||||
main_dart = "../../pkg/dartdev/bin/dartdev.dart"
|
||||
output = "$root_out_dir/dartdev_aot.dart.snapshot"
|
||||
|
||||
# dart has dart_product_config applied to it,
|
||||
# so it is built in product mode in both release and
|
||||
# product builds, and is only built in debug mode in debug
|
||||
# builds. The following line ensures that the dart
|
||||
# and dartdev_aot snapshot in an SDK build are
|
||||
# always compatible with each other.
|
||||
force_product_mode = !dart_debug
|
||||
}
|
||||
|
||||
group("dartdev") {
|
||||
public_deps = [
|
||||
":copy_dartdev_snapshot",
|
||||
@@ -12,6 +38,12 @@ group("dartdev") {
|
||||
]
|
||||
}
|
||||
|
||||
application_snapshot("generate_dartdev_snapshot") {
|
||||
main_dart = "../../pkg/dartdev/bin/dartdev.dart"
|
||||
training_args = [ "--help" ]
|
||||
output = "$root_gen_dir/dartdev.dart.snapshot"
|
||||
}
|
||||
|
||||
copy("copy_dartdev_snapshot") {
|
||||
visibility = [ ":dartdev" ]
|
||||
public_deps = [ ":generate_dartdev_snapshot" ]
|
||||
@@ -19,14 +51,11 @@ copy("copy_dartdev_snapshot") {
|
||||
outputs = [ "$root_out_dir/dartdev.dart.snapshot" ]
|
||||
}
|
||||
|
||||
application_snapshot("generate_dartdev_snapshot") {
|
||||
main_dart = "../../pkg/dartdev/bin/dartdev.dart"
|
||||
training_args = [ "--help" ]
|
||||
output = "$root_gen_dir/dartdev.dart.snapshot"
|
||||
}
|
||||
|
||||
copy_tree("copy_prebuilt_devtools") {
|
||||
visibility = [ ":dartdev" ]
|
||||
visibility = [
|
||||
":dartdev",
|
||||
":dartdev_aot",
|
||||
]
|
||||
source = "../../third_party/devtools/web"
|
||||
dest = "$root_out_dir/devtools"
|
||||
exclude = "{}"
|
||||
|
||||
Reference in New Issue
Block a user