Improve AOT snapshot input verification + cleanup (#17136)

Bugfix: Moves AOT snapshot input verification past where the last input
is added to the inputs list.

Cleanup:
* Extracts _isValidAotPlatform method.
* Moves non-platform-specific logic to the top.
* Moves variable declaration closer to first use, and inlines to a
  narrower scope where possible.
This commit is contained in:
Chris Bracken
2018-04-30 16:47:03 -07:00
committed by GitHub
parent b2c67e88d4
commit 100be23a34
2 changed files with 62 additions and 67 deletions

View File

@@ -662,12 +662,12 @@ void main() {
'--url_mapping=dart:ui,${fs.path.join(skyEnginePath, 'lib', 'ui', 'ui.dart')}',
'--url_mapping=dart:vmservice_io,${fs.path.join(skyEnginePath, 'sdk_ext', 'vmservice_io.dart')}',
'--dependencies=${fs.path.join(outputPath, 'snapshot.d')}',
'--snapshot_kind=core',
'snapshot.dart',
'--no-checked',
'--conditional_directives',
'--reify-generic-functions',
'--strong',
'--no-checked',
'--conditional_directives',
'--snapshot_kind=core',
'snapshot.dart',
'main.dill',
]);
}, overrides: contextOverrides);
@@ -704,14 +704,14 @@ void main() {
'--url_mapping=dart:ui,${fs.path.join(skyEnginePath, 'lib', 'ui', 'ui.dart')}',
'--url_mapping=dart:vmservice_io,${fs.path.join(skyEnginePath, 'sdk_ext', 'vmservice_io.dart')}',
'--dependencies=${fs.path.join(outputPath, 'snapshot.d')}',
'--reify-generic-functions',
'--strong',
'--no-checked',
'--conditional_directives',
'--embedder_entry_points_manifest=$kVmEntrypoints',
'--embedder_entry_points_manifest=$kIoEntries',
'--snapshot_kind=app-aot-assembly',
'--assembly=${fs.path.join(outputPath, 'snapshot_assembly.S')}',
'--no-checked',
'--conditional_directives',
'--reify-generic-functions',
'--strong',
'main.dill',
]);
}, overrides: contextOverrides);
@@ -748,12 +748,12 @@ void main() {
'--url_mapping=dart:ui,${fs.path.join(skyEnginePath, 'lib', 'ui', 'ui.dart')}',
'--url_mapping=dart:vmservice_io,${fs.path.join(skyEnginePath, 'sdk_ext', 'vmservice_io.dart')}',
'--dependencies=${fs.path.join(outputPath, 'snapshot.d')}',
'--reify-generic-functions',
'--strong',
'--embedder_entry_points_manifest=$kVmEntrypoints',
'--embedder_entry_points_manifest=$kIoEntries',
'--snapshot_kind=app-aot-assembly',
'--assembly=${fs.path.join(outputPath, 'snapshot_assembly.S')}',
'--reify-generic-functions',
'--strong',
'main.dill',
]);
}, overrides: contextOverrides);