Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(480)

Unified Diff: pkg/front_end/lib/src/fasta/fasta.dart

Issue 2918923003: Revert "Use backend targets to run Kernel transformations in Fasta" (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/front_end/lib/src/fasta/fasta.dart
diff --git a/pkg/front_end/lib/src/fasta/fasta.dart b/pkg/front_end/lib/src/fasta/fasta.dart
index 23a53e4c67cd924530d25d0e864746bf28f24674..c4662bd7ebee6019703f98ef9febbb660c74da4e 100644
--- a/pkg/front_end/lib/src/fasta/fasta.dart
+++ b/pkg/front_end/lib/src/fasta/fasta.dart
@@ -186,7 +186,7 @@ Future<CompilationResult> parseScript(
Future<CompilationResult> parseScriptInFileSystem(
Uri fileName, FileSystem fileSystem, Uri packages, Uri patchedSdk,
{bool verbose: false, bool strongMode: false, String backendTarget}) async {
- backendTarget ??= "vm_fasta";
+ backendTarget ??= "vm";
try {
if (!await fileSystem.entityForUri(fileName).exists()) {
return new CompilationResult.error(
@@ -204,9 +204,8 @@ Future<CompilationResult> parseScriptInFileSystem(
TranslateUri uriTranslator =
await TranslateUri.parse(fileSystem, patchedSdk, packages: packages);
final Ticker ticker = new Ticker(isVerbose: verbose);
- final DillTarget dillTarget = new DillTarget(
- ticker, uriTranslator, backendTarget,
- flags: new TargetFlags(strongMode: strongMode));
+ final DillTarget dillTarget =
+ new DillTarget(ticker, uriTranslator, backendTarget);
_appendDillForUri(dillTarget, patchedSdk.resolve('platform.dill'));
final KernelTarget kernelTarget =
new KernelTarget(fileSystem, dillTarget, uriTranslator, strongMode);
@@ -227,6 +226,11 @@ Future<CompilationResult> parseScriptInFileSystem(
return new CompilationResult.error("No 'main' method found.");
}
+ // Perform target-specific transformations.
+ Target target = getTarget("vm", new TargetFlags(strongMode: false));
+ target.performModularTransformations(coreTypes, hierarchy, program);
+ target.performGlobalTransformations(coreTypes, program);
+
// Write the program to a list of bytes and return it. Do not include
// libraries that have a dart: import URI.
//
@@ -245,14 +249,9 @@ Future<CompilationResult> parseScriptInFileSystem(
}
Future compilePlatform(Uri patchedSdk, Uri fullOutput,
- {Uri outlineOutput,
- Uri packages,
- bool verbose: false,
- String backendTarget}) async {
- backendTarget ??= "vm_fasta";
+ {Uri outlineOutput, Uri packages, bool verbose: false}) async {
Ticker ticker = new Ticker(isVerbose: verbose);
await CompilerCommandLine.withGlobalOptions("", [""], (CompilerContext c) {
- c.options.options["--target"] = backendTarget;
c.options.options["--packages"] = packages;
if (verbose) {
c.options.options["--verbose"] = true;
@@ -269,7 +268,7 @@ Future writeDepsFile(Uri script, Uri depsFile, Uri output,
Iterable<Uri> extraDependencies,
bool verbose: false,
String backendTarget}) async {
- backendTarget ??= "vm_fasta";
+ backendTarget ??= "vm";
Ticker ticker = new Ticker(isVerbose: verbose);
await CompilerCommandLine.withGlobalOptions("", [""],
(CompilerContext c) async {
@@ -282,8 +281,8 @@ Future writeDepsFile(Uri script, Uri depsFile, Uri output,
TranslateUri uriTranslator = await TranslateUri.parse(c.fileSystem, sdk,
packages: c.options.packages);
ticker.logMs("Read packages file");
- DillTarget dillTarget = new DillTarget(ticker, uriTranslator, backendTarget,
- flags: new TargetFlags(strongMode: false));
+ DillTarget dillTarget =
+ new DillTarget(ticker, uriTranslator, backendTarget);
_appendDillForUri(dillTarget, platform);
KernelTarget kernelTarget = new KernelTarget(PhysicalFileSystem.instance,
dillTarget, uriTranslator, false, c.uriToSource);
« no previous file with comments | « pkg/front_end/lib/src/fasta/dill/dill_target.dart ('k') | pkg/front_end/lib/src/fasta/kernel/kernel_target.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698