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 dart2js_incremental; | 5 part of dart2js_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, |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 69 |
70 // Much like a scout, an incremental compiler is always prepared. For | 70 // Much like a scout, an incremental compiler is always prepared. For |
71 // mixins, classes, and lazy statics, at least. | 71 // mixins, classes, and lazy statics, at least. |
72 emitter | 72 emitter |
73 ..needsClassSupport = true | 73 ..needsClassSupport = true |
74 ..needsMixinSupport = true | 74 ..needsMixinSupport = true |
75 ..needsLazyInitializer = true | 75 ..needsLazyInitializer = true |
76 ..needsStructuredMemberInfo = true; | 76 ..needsStructuredMemberInfo = true; |
77 | 77 |
78 Uri core = Uri.parse("dart:core"); | 78 Uri core = Uri.parse("dart:core"); |
79 return compiler.libraryLoader.loadLibrary(core).then((_) { | 79 |
80 // Likewise, always be prepared for runtimeType support. | 80 return compiler.setupSdk().then((_) { |
81 // TODO(johnniwinther): Add global switch to force RTI. | 81 return compiler.libraryLoader.loadLibrary(core).then((_) { |
82 compiler.enabledRuntimeType = true; | 82 // Likewise, always be prepared for runtimeType support. |
83 backend.registerRuntimeType( | 83 // TODO(johnniwinther): Add global switch to force RTI. |
84 compiler.enqueuer.resolution, compiler.globalDependencies); | 84 compiler.enabledRuntimeType = true; |
85 return compiler; | 85 backend.registerRuntimeType( |
| 86 compiler.enqueuer.resolution, compiler.globalDependencies); |
| 87 return compiler; |
| 88 }); |
86 }); | 89 }); |
87 } else { | 90 } else { |
88 for (final task in compiler.tasks) { | 91 for (final task in compiler.tasks) { |
89 if (task.watch != null) { | 92 if (task.watch != null) { |
90 task.watch.reset(); | 93 task.watch.reset(); |
91 } | 94 } |
92 } | 95 } |
93 compiler | 96 compiler |
94 ..userOutputProvider = outputProvider | 97 ..userOutputProvider = outputProvider |
95 ..provider = inputProvider | 98 ..provider = inputProvider |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 final Map<String, String> output = new Map<String, String>(); | 192 final Map<String, String> output = new Map<String, String>(); |
190 | 193 |
191 EventSink<String> createEventSink(String name, String extension) { | 194 EventSink<String> createEventSink(String name, String extension) { |
192 return new StringEventSink((String data) { | 195 return new StringEventSink((String data) { |
193 output['$name.$extension'] = data; | 196 output['$name.$extension'] = data; |
194 }); | 197 }); |
195 } | 198 } |
196 | 199 |
197 String operator[] (String key) => output[key]; | 200 String operator[] (String key) => output[key]; |
198 } | 201 } |
OLD | NEW |