Add DAS AOT snapshot to SDK; can toggle with runtime dartdev flag

Change-Id: Idbef46ca62045022458d6d951f301ff4d6895cfe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424342
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This commit is contained in:
Sam Rawlins
2025-04-24 18:06:38 -07:00
committed by Commit Queue
parent 26641af3a1
commit 7e8f84b571
3 changed files with 27 additions and 7 deletions
@@ -35,7 +35,8 @@ For more information about the server's capabilities and configuration, see:
usageLineLength: dartdevUsageLineLength,
includeHelpFlag: false,
defaultToLsp: true,
);
)..addFlag(_useAotSnapshotFlag,
help: 'Use the AOT analysis server snapshot', hide: true);
}
@override
@@ -48,12 +49,20 @@ For more information about the server's capabilities and configuration, see:
args = [...args, '--$protocol=$lsp'];
}
try {
VmInteropHandler.run(
sdk.analysisServerSnapshot,
args,
packageConfigOverride: null,
useExecProcess: false,
);
if (argResults!.flag(_useAotSnapshotFlag)) {
args.remove('--$_useAotSnapshotFlag');
VmInteropHandler.run(
sdk.dartAotRuntime,
[sdk.analysisServerAotSnapshot, ...args],
useExecProcess: true,
);
} else {
VmInteropHandler.run(
sdk.analysisServerSnapshot,
args,
useExecProcess: false,
);
}
return 0;
} catch (e, st) {
log.stderr('Error: launching language analysis server failed');
@@ -64,4 +73,6 @@ For more information about the server's capabilities and configuration, see:
return 255;
}
}
static const _useAotSnapshotFlag = 'use-aot-snapshot';
}
+4
View File
@@ -66,6 +66,10 @@ class Sdk {
Platform.isWindows ? 'dartaotruntime.exe' : 'dartaotruntime',
);
String get analysisServerAotSnapshot => _snapshotPathFor(
'analysis_server_aot.dart.snapshot',
);
String get analysisServerSnapshot => _snapshotPathFor(
'analysis_server.dart.snapshot',
);
+5
View File
@@ -130,6 +130,11 @@ _platform_sdk_snapshots = [
]
if (dart_target_arch != "ia32" && dart_target_arch != "x86") {
_platform_sdk_snapshots += [
[
"analysis_server_aot_product",
"../utils/analysis_server:analysis_server_aot_product",
"analysis_server_aot",
],
[
"frontend_server_aot_product",
"../utils/kernel-service:frontend_server_aot_product",