Skip to content

Commit bcc0900

Browse files
sjindel-googlecommit-bot@chromium.org
authored andcommitted
[vm] AOT blobs snapshots are obsolete. Remove dead code.
Change-Id: I35cf4befbe66b92197dcd659172f90be3de30f8e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134840 Commit-Queue: Samir Jindel <[email protected]> Reviewed-by: Ryan Macnak <[email protected]>
1 parent a0323c7 commit bcc0900

17 files changed

+46
-315
lines changed

pkg/smith/lib/configuration.dart

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ class Configuration {
259259
isMinified: boolOption("minified"),
260260
useAnalyzerCfe: boolOption("use-cfe"),
261261
useAnalyzerFastaParser: boolOption("analyzer-use-fasta-parser"),
262-
useBlobs: boolOption("use-blobs"),
263262
useElf: boolOption("use-elf"),
264263
useHotReload: boolOption("hot-reload"),
265264
useHotReloadRollback: boolOption("hot-reload-rollback"),
@@ -330,8 +329,6 @@ class Configuration {
330329
final bool useAnalyzerCfe;
331330
final bool useAnalyzerFastaParser;
332331

333-
// TODO(rnystrom): What is this?
334-
final bool useBlobs;
335332
final bool useElf;
336333

337334
final bool useHotReload;
@@ -359,7 +356,6 @@ class Configuration {
359356
bool isMinified,
360357
bool useAnalyzerCfe,
361358
bool useAnalyzerFastaParser,
362-
bool useBlobs,
363359
bool useElf,
364360
bool useHotReload,
365361
bool useHotReloadRollback,
@@ -381,7 +377,6 @@ class Configuration {
381377
isMinified = isMinified ?? false,
382378
useAnalyzerCfe = useAnalyzerCfe ?? false,
383379
useAnalyzerFastaParser = useAnalyzerFastaParser ?? false,
384-
useBlobs = useBlobs ?? false,
385380
useElf = useElf ?? false,
386381
useHotReload = useHotReload ?? false,
387382
useHotReloadRollback = useHotReloadRollback ?? false,
@@ -412,7 +407,6 @@ class Configuration {
412407
isMinified == other.isMinified &&
413408
useAnalyzerCfe == other.useAnalyzerCfe &&
414409
useAnalyzerFastaParser == other.useAnalyzerFastaParser &&
415-
useBlobs == other.useBlobs &&
416410
useElf == other.useElf &&
417411
useHotReload == other.useHotReload &&
418412
useHotReloadRollback == other.useHotReloadRollback &&
@@ -462,7 +456,6 @@ class Configuration {
462456
isMinified,
463457
useAnalyzerCfe,
464458
useAnalyzerFastaParser,
465-
useBlobs,
466459
useElf,
467460
useHotReload,
468461
useHotReloadRollback,
@@ -503,7 +496,6 @@ class Configuration {
503496
if (isMinified) fields.add("minified");
504497
if (useAnalyzerCfe) fields.add("use-cfe");
505498
if (useAnalyzerFastaParser) fields.add("analyzer-use-fasta-parser");
506-
if (useBlobs) fields.add("use-blobs");
507499
if (useHotReload) fields.add("hot-reload");
508500
if (useHotReloadRollback) fields.add("hot-reload-rollback");
509501
if (useSdk) fields.add("use-sdk");
@@ -561,7 +553,6 @@ class Configuration {
561553
boolField("use-cfe", useAnalyzerCfe, other.useAnalyzerCfe);
562554
boolField("analyzer-use-fasta-parser", useAnalyzerFastaParser,
563555
other.useAnalyzerFastaParser);
564-
boolField("use-blobs", useBlobs, other.useBlobs);
565556
boolField("host-checked", isHostChecked, other.isHostChecked);
566557
boolField("hot-reload", useHotReload, other.useHotReload);
567558
boolField("hot-reload-rollback", useHotReloadRollback,

pkg/smith/test/configuration_test.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,6 @@ void main() {
382382
isMinified: true,
383383
useAnalyzerCfe: true,
384384
useAnalyzerFastaParser: true,
385-
useBlobs: true,
386385
useElf: true,
387386
useHotReload: true,
388387
useHotReloadRollback: true,
@@ -412,7 +411,6 @@ architecture: ia32 x64
412411
minified: false true
413412
use-cfe: false true
414413
analyzer-use-fasta-parser: false true
415-
use-blobs: false true
416414
host-checked: false true
417415
hot-reload: false true
418416
hot-reload-rollback: false true

pkg/test_runner/lib/src/command.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,6 @@ class AdbPrecompilationCommand extends Command implements AdbCommand {
547547
final String processTestFilename;
548548
final String precompiledTestDirectory;
549549
final List<String> arguments;
550-
final bool useBlobs;
551550
final bool useElf;
552551
final List<String> extraLibraries;
553552

@@ -556,7 +555,6 @@ class AdbPrecompilationCommand extends Command implements AdbCommand {
556555
this.processTestFilename,
557556
this.precompiledTestDirectory,
558557
this.arguments,
559-
this.useBlobs,
560558
this.useElf,
561559
this.extraLibraries,
562560
{int index = 0})
@@ -567,7 +565,6 @@ class AdbPrecompilationCommand extends Command implements AdbCommand {
567565
processTestFilename,
568566
precompiledTestDirectory,
569567
arguments,
570-
useBlobs,
571568
useElf,
572569
extraLibraries,
573570
index: index);
@@ -582,15 +579,13 @@ class AdbPrecompilationCommand extends Command implements AdbCommand {
582579
builder.add(buildPath);
583580
builder.add(precompiledTestDirectory);
584581
builder.add(arguments);
585-
builder.add(useBlobs);
586582
builder.add(useElf);
587583
extraLibraries.forEach(builder.add);
588584
}
589585

590586
bool _equal(AdbPrecompilationCommand other) =>
591587
super._equal(other) &&
592588
buildPath == other.buildPath &&
593-
useBlobs == other.useBlobs &&
594589
useElf == other.useElf &&
595590
arguments == other.arguments &&
596591
precompiledTestDirectory == other.precompiledTestDirectory &&

pkg/test_runner/lib/src/compiler_configuration.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration
626626
tempDir, arguments, environmentOverrides));
627627
}
628628

629-
if (!_configuration.useBlobs && !_configuration.useElf) {
629+
if (!_configuration.useElf) {
630630
commands.add(
631631
computeAssembleCommand(tempDir, arguments, environmentOverrides));
632632
if (!_configuration.keepGeneratedFiles) {
@@ -698,10 +698,7 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration
698698
}
699699

700700
var args = [
701-
if (_configuration.useBlobs) ...[
702-
"--snapshot-kind=app-aot-blobs",
703-
"--blobs_container_filename=$tempDir/out.aotsnapshot"
704-
] else if (_configuration.useElf) ...[
701+
if (_configuration.useElf) ...[
705702
"--snapshot-kind=app-aot-elf",
706703
"--elf=$tempDir/out.aotsnapshot"
707704
] else ...[

pkg/test_runner/lib/src/configuration.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ class TestConfiguration {
115115
bool get isMinified => configuration.isMinified;
116116
bool get useAnalyzerCfe => configuration.useAnalyzerCfe;
117117
bool get useAnalyzerFastaParser => configuration.useAnalyzerFastaParser;
118-
bool get useBlobs => configuration.useBlobs;
119118
bool get useElf => configuration.useElf;
120119
bool get useSdk => configuration.useSdk;
121120
bool get enableAsserts => configuration.enableAsserts;

pkg/test_runner/lib/src/options.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,6 @@ compiler.''',
816816
useAnalyzerCfe: data["use_cfe"] as bool,
817817
useAnalyzerFastaParser:
818818
data["analyzer_use_fasta_parser"] as bool,
819-
useBlobs: data["use_blobs"] as bool,
820819
useElf: data["use_elf"] as bool,
821820
useSdk: data["use_sdk"] as bool,
822821
useHotReload: data["hot_reload"] as bool,

pkg/test_runner/lib/src/runtime_configuration.dart

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,10 @@ abstract class RuntimeConfiguration {
4848
case Runtime.dartPrecompiled:
4949
if (configuration.system == System.android) {
5050
return DartPrecompiledAdbRuntimeConfiguration(
51-
useBlobs: configuration.useBlobs,
5251
useElf: configuration.useElf,
5352
);
5453
} else {
5554
return DartPrecompiledRuntimeConfiguration(
56-
useBlobs: configuration.useBlobs,
5755
useElf: configuration.useElf,
5856
);
5957
}
@@ -282,11 +280,8 @@ class StandaloneDartRuntimeConfiguration extends DartVmRuntimeConfiguration {
282280
}
283281

284282
class DartPrecompiledRuntimeConfiguration extends DartVmRuntimeConfiguration {
285-
final bool useBlobs;
286283
final bool useElf;
287-
DartPrecompiledRuntimeConfiguration({bool useBlobs, bool useElf})
288-
: useBlobs = useBlobs,
289-
useElf = useElf;
284+
DartPrecompiledRuntimeConfiguration({bool useElf}) : useElf = useElf;
290285

291286
List<Command> computeRuntimeCommands(
292287
CommandArtifact artifact,
@@ -340,11 +335,8 @@ class DartPrecompiledAdbRuntimeConfiguration
340335
static const deviceDir = '/data/local/tmp/precompilation-testing';
341336
static const deviceTestDir = '/data/local/tmp/precompilation-testing/test';
342337

343-
final bool useBlobs;
344338
final bool useElf;
345-
DartPrecompiledAdbRuntimeConfiguration({bool useBlobs, bool useElf})
346-
: useBlobs = useBlobs,
347-
useElf = useElf;
339+
DartPrecompiledAdbRuntimeConfiguration({bool useElf}) : useElf = useElf;
348340

349341
List<Command> computeRuntimeCommands(
350342
CommandArtifact artifact,
@@ -361,7 +353,7 @@ class DartPrecompiledAdbRuntimeConfiguration
361353
var processTest = processTestBinaryFileName;
362354
return [
363355
AdbPrecompilationCommand(
364-
buildDir, processTest, script, arguments, useBlobs, useElf, extraLibs)
356+
buildDir, processTest, script, arguments, useElf, extraLibs)
365357
];
366358
}
367359
}

runtime/bin/gen_snapshot.cc

Lines changed: 1 addition & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ enum SnapshotKind {
8181
kCoreJIT,
8282
kApp,
8383
kAppJIT,
84-
kAppAOTBlobs,
8584
kAppAOTAssembly,
8685
kAppAOTElf,
8786
kVMAOTAssembly,
@@ -95,7 +94,6 @@ static const char* kSnapshotKindNames[] = {
9594
"core-jit",
9695
"app",
9796
"app-jit",
98-
"app-aot-blobs",
9997
"app-aot-assembly",
10098
"app-aot-elf",
10199
"vm-aot-assembly",
@@ -146,8 +144,7 @@ DEFINE_ENUM_OPTION(snapshot_kind, SnapshotKind, snapshot_kind);
146144
DEFINE_CB_OPTION(ProcessEnvironmentOption);
147145

148146
static bool IsSnapshottingForPrecompilation() {
149-
return (snapshot_kind == kAppAOTBlobs) ||
150-
(snapshot_kind == kAppAOTAssembly) || (snapshot_kind == kAppAOTElf) ||
147+
return (snapshot_kind == kAppAOTAssembly) || (snapshot_kind == kAppAOTElf) ||
151148
(snapshot_kind == kVMAOTAssembly);
152149
}
153150

@@ -286,34 +283,6 @@ static int ParseArguments(int argc,
286283
}
287284
break;
288285
}
289-
case kAppAOTBlobs: {
290-
if ((blobs_container_filename == NULL) &&
291-
((vm_snapshot_data_filename == NULL) ||
292-
(vm_snapshot_instructions_filename == NULL) ||
293-
(isolate_snapshot_data_filename == NULL) ||
294-
(isolate_snapshot_instructions_filename == NULL))) {
295-
Syslog::PrintErr(
296-
"Building an AOT snapshot as blobs requires specifying output "
297-
"file for --blobs_container_filename or "
298-
"files for --vm_snapshot_data, --vm_snapshot_instructions, "
299-
"--isolate_snapshot_data and --isolate_snapshot_instructions.\n\n");
300-
return -1;
301-
}
302-
if ((blobs_container_filename != NULL) &&
303-
((vm_snapshot_data_filename != NULL) ||
304-
(vm_snapshot_instructions_filename != NULL) ||
305-
(isolate_snapshot_data_filename != NULL) ||
306-
(isolate_snapshot_instructions_filename != NULL))) {
307-
Syslog::PrintErr(
308-
"Building an AOT snapshot as blobs requires specifying output "
309-
"file for --blobs_container_filename or "
310-
"files for --vm_snapshot_data, --vm_snapshot_instructions, "
311-
"--isolate_snapshot_data and --isolate_snapshot_instructions"
312-
" not both.\n\n");
313-
return -1;
314-
}
315-
break;
316-
}
317286
case kAppAOTElf: {
318287
if (elf_filename == NULL) {
319288
Syslog::PrintErr(
@@ -669,54 +638,6 @@ static void CreateAndWritePrecompiledSnapshot() {
669638
" To avoid this, use --strip to remove it and "
670639
"--save-debugging-info=<...> to save it to a separate file.\n");
671640
}
672-
} else if (snapshot_kind == kAppAOTBlobs) {
673-
Syslog::PrintErr(
674-
"WARNING: app-aot-blobs snapshots have been deprecated and support for "
675-
"generating them will be removed soon. Please use the app-aot-elf or "
676-
"app-aot-assembly snapshot kinds in conjunction with the portable ELF "
677-
"loader from //runtime/bin:elf_loader if necessary. See "
678-
"http://dartbug.com/38764 for more details.\n");
679-
680-
uint8_t* vm_snapshot_data_buffer = NULL;
681-
intptr_t vm_snapshot_data_size = 0;
682-
uint8_t* vm_snapshot_instructions_buffer = NULL;
683-
intptr_t vm_snapshot_instructions_size = 0;
684-
uint8_t* isolate_snapshot_data_buffer = NULL;
685-
intptr_t isolate_snapshot_data_size = 0;
686-
uint8_t* isolate_snapshot_instructions_buffer = NULL;
687-
intptr_t isolate_snapshot_instructions_size = 0;
688-
File* debug_file = nullptr;
689-
if (debugging_info_filename != nullptr) {
690-
debug_file = OpenFile(debugging_info_filename);
691-
}
692-
result = Dart_CreateAppAOTSnapshotAsBlobs(
693-
&vm_snapshot_data_buffer, &vm_snapshot_data_size,
694-
&vm_snapshot_instructions_buffer, &vm_snapshot_instructions_size,
695-
&isolate_snapshot_data_buffer, &isolate_snapshot_data_size,
696-
&isolate_snapshot_instructions_buffer,
697-
&isolate_snapshot_instructions_size, StreamingWriteCallback,
698-
debug_file);
699-
if (debug_file != nullptr) debug_file->Release();
700-
CHECK_RESULT(result);
701-
702-
if (blobs_container_filename != NULL) {
703-
Snapshot::WriteAppSnapshot(
704-
blobs_container_filename, vm_snapshot_data_buffer,
705-
vm_snapshot_data_size, vm_snapshot_instructions_buffer,
706-
vm_snapshot_instructions_size, isolate_snapshot_data_buffer,
707-
isolate_snapshot_data_size, isolate_snapshot_instructions_buffer,
708-
isolate_snapshot_instructions_size);
709-
} else {
710-
WriteFile(vm_snapshot_data_filename, vm_snapshot_data_buffer,
711-
vm_snapshot_data_size);
712-
WriteFile(vm_snapshot_instructions_filename,
713-
vm_snapshot_instructions_buffer, vm_snapshot_instructions_size);
714-
WriteFile(isolate_snapshot_data_filename, isolate_snapshot_data_buffer,
715-
isolate_snapshot_data_size);
716-
WriteFile(isolate_snapshot_instructions_filename,
717-
isolate_snapshot_instructions_buffer,
718-
isolate_snapshot_instructions_size);
719-
}
720641
} else {
721642
UNREACHABLE();
722643
}
@@ -826,7 +747,6 @@ static int CreateIsolateAndSnapshot(const CommandLineOptions& inputs) {
826747
CreateAndWriteAppJITSnapshot();
827748
break;
828749
case kAppAOTAssembly:
829-
case kAppAOTBlobs:
830750
case kAppAOTElf:
831751
CreateAndWritePrecompiledSnapshot();
832752
break;

runtime/bin/snapshot_utils.cc

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -509,29 +509,6 @@ void Snapshot::GenerateAppJIT(const char* snapshot_filename) {
509509
#endif
510510
}
511511

512-
void Snapshot::GenerateAppAOTAsBlobs(const char* snapshot_filename) {
513-
uint8_t* vm_data_buffer = NULL;
514-
intptr_t vm_data_size = 0;
515-
uint8_t* vm_instructions_buffer = NULL;
516-
intptr_t vm_instructions_size = 0;
517-
uint8_t* isolate_data_buffer = NULL;
518-
intptr_t isolate_data_size = 0;
519-
uint8_t* isolate_instructions_buffer = NULL;
520-
intptr_t isolate_instructions_size = 0;
521-
Dart_Handle result = Dart_CreateAppAOTSnapshotAsBlobs(
522-
&vm_data_buffer, &vm_data_size, &vm_instructions_buffer,
523-
&vm_instructions_size, &isolate_data_buffer, &isolate_data_size,
524-
&isolate_instructions_buffer, &isolate_instructions_size,
525-
/*callback=*/nullptr, /*debug_callback_info=*/nullptr);
526-
if (Dart_IsError(result)) {
527-
ErrorExit(kErrorExitCode, "%s\n", Dart_GetError(result));
528-
}
529-
WriteAppSnapshot(snapshot_filename, vm_data_buffer, vm_data_size,
530-
vm_instructions_buffer, vm_instructions_size,
531-
isolate_data_buffer, isolate_data_size,
532-
isolate_instructions_buffer, isolate_instructions_size);
533-
}
534-
535512
static void StreamingWriteCallback(void* callback_data,
536513
const uint8_t* buffer,
537514
intptr_t size) {

runtime/bin/snapshot_utils.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class Snapshot {
3232
const char* script_name,
3333
const char* package_config);
3434
static void GenerateAppJIT(const char* snapshot_filename);
35-
static void GenerateAppAOTAsBlobs(const char* snapshot_filename);
3635
static void GenerateAppAOTAsAssembly(const char* snapshot_filename);
3736

3837
static AppSnapshot* TryReadAppendedAppSnapshotElf(const char* container_path);

runtime/include/dart_api.h

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3480,31 +3480,6 @@ DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
34803480
Dart_CreateVMAOTSnapshotAsAssembly(Dart_StreamingWriteCallback callback,
34813481
void* callback_data);
34823482

3483-
/**
3484-
* Same as Dart_CreateAppAOTSnapshotAsAssembly, except all the pieces are
3485-
* provided directly as bytes that the embedder can load with mmap. The
3486-
* instructions pieces must be loaded with read and execute permissions; the
3487-
* other pieces may be loaded as read-only.
3488-
*
3489-
* This function has been DEPRECATED. Please use Dart_CreateAppAOTSnapshotAsELF
3490-
* or Dart_CreateAppAOTSnapshotAsAssembly instead. A portable ELF loader is
3491-
* available in the target //runtime/bin:elf_loader.
3492-
*
3493-
* If callback and debug_callback_data are provided, debug_callback_data will
3494-
* be used with the callback to provide separate debugging information.
3495-
*/
3496-
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
3497-
Dart_CreateAppAOTSnapshotAsBlobs(uint8_t** vm_snapshot_data_buffer,
3498-
intptr_t* vm_snapshot_data_size,
3499-
uint8_t** vm_snapshot_instructions_buffer,
3500-
intptr_t* vm_snapshot_instructions_size,
3501-
uint8_t** isolate_snapshot_data_buffer,
3502-
intptr_t* isolate_snapshot_data_size,
3503-
uint8_t** isolate_snapshot_instructions_buffer,
3504-
intptr_t* isolate_snapshot_instructions_size,
3505-
Dart_StreamingWriteCallback callback,
3506-
void* debug_callback_data);
3507-
35083483
/**
35093484
* Sorts the class-ids in depth first traversal order of the inheritance
35103485
* tree. This is a costly operation, but it can make method dispatch

0 commit comments

Comments
 (0)