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<Compiler> reuseCompiler( | 9 Future<Compiler> reuseCompiler( |
10 {DiagnosticHandler diagnosticHandler, | 10 {DiagnosticHandler diagnosticHandler, |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 inputProvider, | 60 inputProvider, |
61 outputProvider, | 61 outputProvider, |
62 diagnosticHandler, | 62 diagnosticHandler, |
63 libraryRoot, | 63 libraryRoot, |
64 packageRoot, | 64 packageRoot, |
65 options, | 65 options, |
66 environment); | 66 environment); |
67 JavaScriptBackend backend = compiler.backend; | 67 JavaScriptBackend backend = compiler.backend; |
68 | 68 |
69 // Much like a scout, an incremental compiler is always prepared. For | 69 // Much like a scout, an incremental compiler is always prepared. For |
70 // mixins, at least. | 70 // mixins, classes, and lazy statics, at least. |
71 backend.emitter.oldEmitter.needsMixinSupport = true; | 71 backend.emitter.oldEmitter |
| 72 ..needsDefineClass = true |
| 73 ..needsMixinSupport = true |
| 74 ..needsLazyInitializer = true; |
72 | 75 |
73 Uri core = Uri.parse("dart:core"); | 76 Uri core = Uri.parse("dart:core"); |
74 return compiler.libraryLoader.loadLibrary(core).then((_) { | 77 return compiler.libraryLoader.loadLibrary(core).then((_) { |
75 // Likewise, always be prepared for runtimeType support. | 78 // Likewise, always be prepared for runtimeType support. |
76 // TODO(johnniwinther): Add global switch to force RTI. | 79 // TODO(johnniwinther): Add global switch to force RTI. |
77 compiler.enabledRuntimeType = true; | 80 compiler.enabledRuntimeType = true; |
78 backend.registerRuntimeType( | 81 backend.registerRuntimeType( |
79 compiler.enqueuer.resolution, compiler.globalDependencies); | 82 compiler.enqueuer.resolution, compiler.globalDependencies); |
80 return compiler; | 83 return compiler; |
81 }); | 84 }); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 library.isPlatformLibrary || | 165 library.isPlatformLibrary || |
163 (packagesAreImmutable && library.isPackageLibrary)); | 166 (packagesAreImmutable && library.isPackageLibrary)); |
164 }; | 167 }; |
165 } | 168 } |
166 return compiler.libraryLoader.resetAsync(reuseLibrary).then((_) { | 169 return compiler.libraryLoader.resetAsync(reuseLibrary).then((_) { |
167 oldTag.makeCurrent(); | 170 oldTag.makeCurrent(); |
168 return compiler; | 171 return compiler; |
169 }); | 172 }); |
170 } | 173 } |
171 } | 174 } |
OLD | NEW |