Chromium Code Reviews| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 oldTag.makeCurrent(); | 58 oldTag.makeCurrent(); |
| 59 compiler = new Compiler( | 59 compiler = new Compiler( |
| 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 // Much like a scout, an incremental compiler is always prepared. For | 69 // Much like a scout, an incremental compiler is always prepared. For |
| 69 // mixins, at least. | 70 // mixins, at least. |
| 70 backend.emitter.oldEmitter.needsMixinSupport = true; | 71 backend.emitter.oldEmitter.needsMixinSupport = true; |
| 71 return new Future.value(compiler); | 72 |
| 73 Uri core = Uri.parse("dart:core"); | |
| 74 return compiler.libraryLoader.loadLibrary(core).then((_) { | |
| 75 // Likewise, always be prepared for runtimeType support. | |
| 76 compiler.enabledRuntimeType = true; | |
| 77 backend.registerRuntimeType( | |
|
Johnni Winther
2014/12/01 08:50:19
Add a TODO for me to add a global switch for alway
ahe
2014/12/01 10:15:02
Done.
| |
| 78 compiler.enqueuer.resolution, compiler.globalDependencies); | |
| 79 return compiler; | |
| 80 }); | |
| 72 } else { | 81 } else { |
| 73 for (final task in compiler.tasks) { | 82 for (final task in compiler.tasks) { |
| 74 if (task.watch != null) { | 83 if (task.watch != null) { |
| 75 task.watch.reset(); | 84 task.watch.reset(); |
| 76 } | 85 } |
| 77 } | 86 } |
| 78 compiler | 87 compiler |
| 79 ..outputProvider = outputProvider | 88 ..outputProvider = outputProvider |
| 80 ..provider = inputProvider | 89 ..provider = inputProvider |
| 81 ..handler = diagnosticHandler | 90 ..handler = diagnosticHandler |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 153 library.isPlatformLibrary || | 162 library.isPlatformLibrary || |
| 154 (packagesAreImmutable && library.isPackageLibrary)); | 163 (packagesAreImmutable && library.isPackageLibrary)); |
| 155 }; | 164 }; |
| 156 } | 165 } |
| 157 return compiler.libraryLoader.resetAsync(reuseLibrary).then((_) { | 166 return compiler.libraryLoader.resetAsync(reuseLibrary).then((_) { |
| 158 oldTag.makeCurrent(); | 167 oldTag.makeCurrent(); |
| 159 return compiler; | 168 return compiler; |
| 160 }); | 169 }); |
| 161 } | 170 } |
| 162 } | 171 } |
| OLD | NEW |