| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library dart2js_incremental.library_updater; | 5 library dart2js_incremental.library_updater; |
| 6 | 6 |
| 7 import 'dart:async' show | 7 import 'dart:async' show |
| 8 Future; | 8 Future; |
| 9 | 9 |
| 10 import 'dart:convert' show | 10 import 'dart:convert' show |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 } | 148 } |
| 149 super.incrementalCompiler = value; | 149 super.incrementalCompiler = value; |
| 150 } | 150 } |
| 151 | 151 |
| 152 void registerUriWithUpdates(Iterable<Uri> uris) { | 152 void registerUriWithUpdates(Iterable<Uri> uris) { |
| 153 _uriWithUpdates.addAll(uris); | 153 _uriWithUpdates.addAll(uris); |
| 154 } | 154 } |
| 155 | 155 |
| 156 void _captureState(Compiler compiler) { | 156 void _captureState(Compiler compiler) { |
| 157 JavaScriptBackend backend = compiler.backend; | 157 JavaScriptBackend backend = compiler.backend; |
| 158 _emittedClasses = new Set.from(backend.emitter.neededClasses); | 158 Set neededClasses = backend.emitter.neededClasses; |
| 159 if (neededClasses == null) { |
| 160 neededClasses = new Set(); |
| 161 } |
| 162 _emittedClasses = new Set.from(neededClasses); |
| 159 | 163 |
| 160 _directlyInstantiatedClasses = | 164 _directlyInstantiatedClasses = |
| 161 new Set.from(compiler.codegenWorld.directlyInstantiatedClasses); | 165 new Set.from(compiler.codegenWorld.directlyInstantiatedClasses); |
| 162 | 166 |
| 163 List<ConstantValue> constants = | 167 // This breaks constant tracking of the incremental compiler. It would need |
| 164 backend.emitter.outputConstantLists[ | 168 // to capture the emitted constants. |
| 165 compiler.deferredLoadTask.mainOutputUnit]; | 169 List<ConstantValue> constants = null; |
| 166 if (constants == null) constants = <ConstantValue>[]; | 170 if (constants == null) constants = <ConstantValue>[]; |
| 167 _compiledConstants = new Set<ConstantValue>.identity()..addAll(constants); | 171 _compiledConstants = new Set<ConstantValue>.identity()..addAll(constants); |
| 168 } | 172 } |
| 169 | 173 |
| 170 bool _uriHasUpdate(Uri uri) => _uriWithUpdates.contains(uri); | 174 bool _uriHasUpdate(Uri uri) => _uriWithUpdates.contains(uri); |
| 171 } | 175 } |
| 172 | 176 |
| 173 class LibraryUpdater extends JsFeatures { | 177 class LibraryUpdater extends JsFeatures { |
| 174 final Compiler compiler; | 178 final Compiler compiler; |
| 175 | 179 |
| (...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1487 .buildFieldsHackForIncrementalCompilation(classElement); | 1491 .buildFieldsHackForIncrementalCompilation(classElement); |
| 1488 // TODO(ahe): Rewrite for new emitter. | 1492 // TODO(ahe): Rewrite for new emitter. |
| 1489 ClassBuilder builder = new ClassBuilder(classElement, namer); | 1493 ClassBuilder builder = new ClassBuilder(classElement, namer); |
| 1490 classEmitter.emitFields(cls, builder); | 1494 classEmitter.emitFields(cls, builder); |
| 1491 return builder.fields; | 1495 return builder.fields; |
| 1492 } | 1496 } |
| 1493 } | 1497 } |
| 1494 | 1498 |
| 1495 // TODO(ahe): Remove this method. | 1499 // TODO(ahe): Remove this method. |
| 1496 NO_WARN(x) => x; | 1500 NO_WARN(x) => x; |
| OLD | NEW |