OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 part of fletchc_incremental; | 5 part of dartino_compiler_incremental; |
6 | 6 |
7 /// Do not call this method directly. It will be made private. | 7 /// Do not call this method directly. It will be made private. |
8 // TODO(ahe): Make this method private. | 8 // TODO(ahe): Make this method private. |
9 Future<CompilerImpl> reuseCompiler( | 9 Future<CompilerImpl> reuseCompiler( |
10 {CompilerDiagnostics diagnosticHandler, | 10 {CompilerDiagnostics diagnosticHandler, |
11 CompilerInput inputProvider, | 11 CompilerInput inputProvider, |
12 CompilerOutput outputProvider, | 12 CompilerOutput outputProvider, |
13 List<String> options: const [], | 13 List<String> options: const [], |
14 CompilerImpl cachedCompiler, | 14 CompilerImpl cachedCompiler, |
15 Uri libraryRoot, | 15 Uri libraryRoot, |
16 Uri nativesJson, | 16 Uri nativesJson, |
17 Uri packageConfig, | 17 Uri packageConfig, |
18 Uri fletchVm, | 18 Uri dartinoVm, |
19 bool packagesAreImmutable: false, | 19 bool packagesAreImmutable: false, |
20 Map<String, dynamic> environment, | 20 Map<String, dynamic> environment, |
21 ReuseLibrariesFunction reuseLibraries, | 21 ReuseLibrariesFunction reuseLibraries, |
22 String platform, | 22 String platform, |
23 Uri base, | 23 Uri base, |
24 IncrementalCompiler incrementalCompiler}) async { | 24 IncrementalCompiler incrementalCompiler}) async { |
25 UserTag oldTag = new UserTag('_reuseCompiler').makeCurrent(); | 25 UserTag oldTag = new UserTag('_reuseCompiler').makeCurrent(); |
26 // if (libraryRoot == null) { | 26 // if (libraryRoot == null) { |
27 // throw 'Missing libraryRoot'; | 27 // throw 'Missing libraryRoot'; |
28 // } | 28 // } |
(...skipping 28 matching lines...) Expand all Loading... |
57 "Unable to reuse compiler due to dart:mirrors"); | 57 "Unable to reuse compiler due to dart:mirrors"); |
58 } else if (compiler.deferredLoadTask.isProgramSplit) { | 58 } else if (compiler.deferredLoadTask.isProgramSplit) { |
59 throw new IncrementalCompilationFailed( | 59 throw new IncrementalCompilationFailed( |
60 "Unable to reuse compiler due to deferred loading"); | 60 "Unable to reuse compiler due to deferred loading"); |
61 } else { | 61 } else { |
62 throw new IncrementalCompilationFailed( | 62 throw new IncrementalCompilationFailed( |
63 "Unable to reuse compiler"); | 63 "Unable to reuse compiler"); |
64 } | 64 } |
65 } | 65 } |
66 oldTag.makeCurrent(); | 66 oldTag.makeCurrent(); |
67 FletchCompiler fletchCompiler = new FletchCompiler( | 67 DartinoCompiler dartinoCompiler = new DartinoCompiler( |
68 provider: inputProvider, | 68 provider: inputProvider, |
69 outputProvider: outputProvider, | 69 outputProvider: outputProvider, |
70 handler: diagnosticHandler, | 70 handler: diagnosticHandler, |
71 libraryRoot: libraryRoot, | 71 libraryRoot: libraryRoot, |
72 nativesJson: nativesJson, | 72 nativesJson: nativesJson, |
73 packageConfig: packageConfig, | 73 packageConfig: packageConfig, |
74 fletchVm: fletchVm, | 74 dartinoVm: dartinoVm, |
75 options: options, | 75 options: options, |
76 environment: environment, | 76 environment: environment, |
77 platform: platform, | 77 platform: platform, |
78 incrementalCompiler: incrementalCompiler); | 78 incrementalCompiler: incrementalCompiler); |
79 compiler = await fletchCompiler.backdoor.compilerImplementation; | 79 compiler = await dartinoCompiler.backdoor.compilerImplementation; |
80 return compiler; | 80 return compiler; |
81 } else { | 81 } else { |
82 for (final task in compiler.tasks) { | 82 for (final task in compiler.tasks) { |
83 if (task.watch != null) { | 83 if (task.watch != null) { |
84 task.watch.reset(); | 84 task.watch.reset(); |
85 } | 85 } |
86 } | 86 } |
87 compiler | 87 compiler |
88 ..userOutputProvider = outputProvider | 88 ..userOutputProvider = outputProvider |
89 ..provider = inputProvider | 89 ..provider = inputProvider |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 throw 'addError($errorEvent, $stackTrace)'; | 128 throw 'addError($errorEvent, $stackTrace)'; |
129 } | 129 } |
130 | 130 |
131 void close() { | 131 void close() { |
132 if (data != null) { | 132 if (data != null) { |
133 onClose(data.join()); | 133 onClose(data.join()); |
134 data = null; | 134 data = null; |
135 } | 135 } |
136 } | 136 } |
137 } | 137 } |
OLD | NEW |