Revert "[analyzer] Make KernelCompilationService use AOT frontend_server snapshot"

This reverts commit 21743361b0.

Reason for revert: b/298654122

Original change's description:
> [analyzer] Make KernelCompilationService use AOT frontend_server snapshot
>
> TEST=pkg/analyzer/test/src/summary/macro_test
>
> Change-Id: I28a37c7648de3e9b3c98b93fea1244234854e439
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322424
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>

Change-Id: Idec05c8759edd26821ee4eeffe9be76ed750f8fa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323880
Commit-Queue: Derek Xu <derekx@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
Derek Xu 2023-09-01 15:57:47 +00:00 committed by Commit Queue
parent ddfc758572
commit 40c2a63c66

View file

@ -36,6 +36,7 @@ class KernelCompilationService {
return instance;
}
final executablePath = io.Platform.resolvedExecutable;
final sdkPaths = _computeSdkPaths();
final socketCompleter = Completer<io.Socket>();
@ -47,23 +48,10 @@ class KernelCompilationService {
final host = serverSocket.address.address;
final addressStr = '$host:${serverSocket.port}';
final io.Process process;
if (io.File(sdkPaths.frontEndAotSnapshot).existsSync()) {
final aotRuntimePath = package_path.join(
package_path.dirname(io.Platform.resolvedExecutable),
'dartaotruntime');
process = await io.Process.start(aotRuntimePath, [
sdkPaths.frontEndAotSnapshot,
'--binary-protocol-address=$addressStr',
]);
} else {
// AOT snapshots cannot be generated on IA32, so we need this fallback
// branch until support for IA32 is dropped (https://dartbug.com/49969).
process = await io.Process.start(io.Platform.resolvedExecutable, [
sdkPaths.frontEndSnapshot,
'--binary-protocol-address=$addressStr',
]);
}
final process = await io.Process.start(executablePath, [
sdkPaths.frontEndSnapshot,
'--binary-protocol-address=$addressStr',
]);
// When the process exits, we should not try to continue using it.
// ignore: unawaited_futures
@ -162,13 +150,9 @@ class KernelCompilationService {
final runFiles = io.Platform.environment['RUNFILES'];
if (runFiles != null) {
final frontServerPath = io.Platform.environment['FRONTEND_SERVER_PATH']!;
final frontendServerAotSnapshotPath =
io.Platform.environment['FRONTEND_SERVER_AOT_SNAPSHOT_PATH']!;
final platformDillPath = io.Platform.environment['PLATFORM_DILL_PATH']!;
return _SdkPaths(
frontEndSnapshot: package_path.join(runFiles, frontServerPath),
frontEndAotSnapshot:
package_path.join(runFiles, frontendServerAotSnapshotPath),
platformDill: package_path.join(runFiles, platformDillPath),
);
}
@ -180,8 +164,6 @@ class KernelCompilationService {
return _SdkPaths(
frontEndSnapshot: package_path.join(
binPath, 'snapshots', 'frontend_server.dart.snapshot'),
frontEndAotSnapshot: package_path.join(
binPath, 'snapshots', 'frontend_server_aot.dart.snapshot'),
platformDill: package_path.join(
sdkPath, 'lib', '_internal', 'vm_platform_strong.dill'),
);
@ -240,12 +222,10 @@ class _Lock {
class _SdkPaths {
final String frontEndSnapshot;
final String frontEndAotSnapshot;
final String platformDill;
_SdkPaths({
required this.frontEndSnapshot,
required this.frontEndAotSnapshot,
required this.platformDill,
});
}