OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /// Additions to Fasta for generating .dill (Kernel IR) files with dart2js patch | 5 /// Additions to Fasta for generating .dill (Kernel IR) files with dart2js patch |
6 /// files and native hooks. | 6 /// files and native hooks. |
7 library compiler.src.kernel.fasta_support; | 7 library compiler.src.kernel.fasta_support; |
8 | 8 |
9 // TODO(sigmund): get rid of this file. Fasta should be agnostic of the | 9 // TODO(sigmund): get rid of this file. Fasta should be agnostic of the |
10 // target platform, at which point this should not be necessary. In particular, | 10 // target platform, at which point this should not be necessary. In particular, |
(...skipping 20 matching lines...) Expand all Loading... |
31 import 'package:front_end/src/fasta/parser/parser.dart' show optional; | 31 import 'package:front_end/src/fasta/parser/parser.dart' show optional; |
32 import 'package:front_end/src/scanner/token.dart' show Token; | 32 import 'package:front_end/src/scanner/token.dart' show Token; |
33 import 'package:front_end/src/fasta/ticker.dart' show Ticker; | 33 import 'package:front_end/src/fasta/ticker.dart' show Ticker; |
34 import 'package:front_end/src/fasta/translate_uri.dart' show TranslateUri; | 34 import 'package:front_end/src/fasta/translate_uri.dart' show TranslateUri; |
35 | 35 |
36 /// Generates a platform.dill file containing the compiled Kernel IR of the | 36 /// Generates a platform.dill file containing the compiled Kernel IR of the |
37 /// dart2js SDK. | 37 /// dart2js SDK. |
38 Future compilePlatform(Uri patchedSdk, Uri fullOutput, | 38 Future compilePlatform(Uri patchedSdk, Uri fullOutput, |
39 {Uri outlineOutput, Uri packages}) async { | 39 {Uri outlineOutput, Uri packages}) async { |
40 Uri deps = Uri.base.resolveUri(new Uri.file("${fullOutput.toFilePath()}.d")); | 40 Uri deps = Uri.base.resolveUri(new Uri.file("${fullOutput.toFilePath()}.d")); |
41 TranslateUri uriTranslator = await TranslateUri.parse( | 41 TranslateUri uriTranslator = await TranslateUri |
42 PhysicalFileSystem.instance, patchedSdk, packages); | 42 .parse(PhysicalFileSystem.instance, patchedSdk, packages: packages); |
43 var ticker = new Ticker(isVerbose: false); | 43 var ticker = new Ticker(isVerbose: false); |
44 var dillTarget = new DillTargetForDart2js(ticker, uriTranslator); | 44 var dillTarget = new DillTargetForDart2js(ticker, uriTranslator); |
45 var kernelTarget = | 45 var kernelTarget = |
46 new KernelTargetForDart2js(dillTarget, uriTranslator, false); | 46 new KernelTargetForDart2js(dillTarget, uriTranslator, false); |
47 | 47 |
48 kernelTarget.read(Uri.parse("dart:core")); | 48 kernelTarget.read(Uri.parse("dart:core")); |
49 await dillTarget.buildOutlines(); | 49 await dillTarget.buildOutlines(); |
50 var outline = await kernelTarget.buildOutlines(); | 50 var outline = await kernelTarget.buildOutlines(); |
51 await writeProgramToFile(outline, outlineOutput); | 51 await writeProgramToFile(outline, outlineOutput); |
52 ticker.logMs("Wrote outline to ${outlineOutput.toFilePath()}"); | 52 ticker.logMs("Wrote outline to ${outlineOutput.toFilePath()}"); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 'dart:html_common', | 155 'dart:html_common', |
156 'dart:indexed_db', | 156 'dart:indexed_db', |
157 'dart:js', | 157 'dart:js', |
158 'dart:js_util', | 158 'dart:js_util', |
159 'dart:mirrors', | 159 'dart:mirrors', |
160 'dart:svg', | 160 'dart:svg', |
161 'dart:web_audio', | 161 'dart:web_audio', |
162 'dart:web_gl', | 162 'dart:web_gl', |
163 'dart:web_sql', | 163 'dart:web_sql', |
164 ]; | 164 ]; |
OLD | NEW |