Skip to content

Commit

Permalink
[gen_snapshot] Remove --print_dependencies and --dependencies_only.
Browse files Browse the repository at this point in the history
These options only make sense with a source input, which is not supported in Dart 2.

Change-Id: I7fcfecf44c310f49a688f189e77e8768cd82db23
Reviewed-on: https://dart-review.googlesource.com/65794
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
  • Loading branch information
rmacnak-google authored and commit-bot@chromium.org committed Aug 8, 2018
1 parent 34f17b2 commit af45552
Showing 1 changed file with 20 additions and 50 deletions.
70 changes: 20 additions & 50 deletions runtime/bin/gen_snapshot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,6 @@ static const char* kSnapshotKindNames[] = {
V(save_obfuscation_map, obfuscation_map_filename)

#define BOOL_OPTIONS_LIST(V) \
V(dependencies_only, dependencies_only) \
V(print_dependencies, print_dependencies) \
V(obfuscate, obfuscate) \
V(verbose, verbose) \
V(version, version) \
Expand Down Expand Up @@ -206,10 +204,6 @@ static void PrintUsage() {
"--dependencies=<output-file> \n"
" Generates a Makefile with snapshot output files as targets and all \n"
" transitive imports as sources. \n"
"--print_dependencies \n"
" Prints all transitive imports to stdout. \n"
"--dependencies_only \n"
" Don't create and output the snapshot. \n"
"--help \n"
" Display this message (add --verbose for information about all VM options).\n"
"--version \n"
Expand Down Expand Up @@ -705,33 +699,12 @@ static void CreateAndWriteDependenciesFile() {

Loader::ResolveDependenciesAsFilePaths();

ASSERT((dependencies_filename != NULL) || print_dependencies);
ASSERT(dependencies_filename != NULL);
if (dependencies_filename != NULL) {
DependenciesFileWriter writer;
writer.WriteDependencies(dependencies);
}

if (print_dependencies) {
Log::Print("%s\n", vm_snapshot_data_filename);
if (snapshot_kind == kScript) {
if (vm_snapshot_data_filename != NULL) {
Log::Print("%s\n", vm_snapshot_data_filename);
}
if (vm_snapshot_instructions_filename != NULL) {
Log::Print("%s\n", vm_snapshot_instructions_filename);
}
if (isolate_snapshot_data_filename != NULL) {
Log::Print("%s\n", isolate_snapshot_data_filename);
}
if (isolate_snapshot_instructions_filename != NULL) {
Log::Print("%s\n", isolate_snapshot_instructions_filename);
}
}
for (intptr_t i = 0; i < dependencies->length(); i++) {
Log::Print("%s\n", dependencies->At(i));
}
}

for (intptr_t i = 0; i < dependencies->length(); i++) {
free(dependencies->At(i));
}
Expand Down Expand Up @@ -1422,7 +1395,7 @@ static int GenerateSnapshotFromKernel(const uint8_t* kernel_buffer,
char* error = NULL;
IsolateData* isolate_data = new IsolateData(NULL, commandline_package_root,
commandline_packages_file, NULL);
if ((dependencies_filename != NULL) || print_dependencies) {
if (dependencies_filename != NULL) {
isolate_data->set_dependencies(new MallocGrowableArray<char*>());
}

Expand Down Expand Up @@ -1552,8 +1525,7 @@ int main(int argc, char** argv) {
"Can only generate core or aot snapshots from a kernel file.\n");
return kErrorExitCode;
}
if ((dependencies_filename != NULL) || print_dependencies ||
dependencies_only) {
if (dependencies_filename != NULL) {
Log::PrintErr("Depfiles are not supported in Dart 2.\n");
return kErrorExitCode;
}
Expand Down Expand Up @@ -1718,7 +1690,7 @@ int main(int argc, char** argv) {
// be in the snapshot.
isolate_data = new IsolateData(app_script_name, commandline_package_root,
commandline_packages_file, NULL);
if ((dependencies_filename != NULL) || print_dependencies) {
if (dependencies_filename != NULL) {
isolate_data->set_dependencies(new MallocGrowableArray<char*>());
}

Expand Down Expand Up @@ -1768,24 +1740,22 @@ int main(int argc, char** argv) {

LoadCompilationTrace();

if (!dependencies_only) {
switch (snapshot_kind) {
case kCore:
CreateAndWriteCoreSnapshot();
break;
case kCoreJIT:
CreateAndWriteCoreJITSnapshot();
break;
case kScript:
CreateAndWriteScriptSnapshot();
break;
case kAppAOTBlobs:
case kAppAOTAssembly:
CreateAndWritePrecompiledSnapshot(entry_points);
break;
default:
UNREACHABLE();
}
switch (snapshot_kind) {
case kCore:
CreateAndWriteCoreSnapshot();
break;
case kCoreJIT:
CreateAndWriteCoreJITSnapshot();
break;
case kScript:
CreateAndWriteScriptSnapshot();
break;
case kAppAOTBlobs:
case kAppAOTAssembly:
CreateAndWritePrecompiledSnapshot(entry_points);
break;
default:
UNREACHABLE();
}

CreateAndWriteDependenciesFile();
Expand Down

0 comments on commit af45552

Please sign in to comment.