| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 throw new StateError("Can't set [incrementalCompiler] more than once."); | 147 throw new StateError("Can't set [incrementalCompiler] more than once."); |
| 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 _emittedClasses = new Set.from(compiler.backend.emitter.neededClasses); | 157 JavaScriptBackend backend = compiler.backend; |
| 158 _emittedClasses = new Set.from(backend.emitter.neededClasses); |
| 158 | 159 |
| 159 _directlyInstantiatedClasses = | 160 _directlyInstantiatedClasses = |
| 160 new Set.from(compiler.codegenWorld.directlyInstantiatedClasses); | 161 new Set.from(compiler.codegenWorld.directlyInstantiatedClasses); |
| 161 | 162 |
| 162 List<ConstantValue> constants = | 163 List<ConstantValue> constants = |
| 163 compiler.backend.emitter.outputConstantLists[ | 164 backend.emitter.outputConstantLists[ |
| 164 compiler.deferredLoadTask.mainOutputUnit]; | 165 compiler.deferredLoadTask.mainOutputUnit]; |
| 165 if (constants == null) constants = <ConstantValue>[]; | 166 if (constants == null) constants = <ConstantValue>[]; |
| 166 _compiledConstants = new Set<ConstantValue>.identity()..addAll(constants); | 167 _compiledConstants = new Set<ConstantValue>.identity()..addAll(constants); |
| 167 } | 168 } |
| 168 | 169 |
| 169 bool _uriHasUpdate(Uri uri) => _uriWithUpdates.contains(uri); | 170 bool _uriHasUpdate(Uri uri) => _uriWithUpdates.contains(uri); |
| 170 } | 171 } |
| 171 | 172 |
| 172 class LibraryUpdater extends JsFeatures { | 173 class LibraryUpdater extends JsFeatures { |
| 173 final Compiler compiler; | 174 final Compiler compiler; |
| (...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1481 .buildFieldsHackForIncrementalCompilation(classElement); | 1482 .buildFieldsHackForIncrementalCompilation(classElement); |
| 1482 // TODO(ahe): Rewrite for new emitter. | 1483 // TODO(ahe): Rewrite for new emitter. |
| 1483 ClassBuilder builder = new ClassBuilder(classElement, namer); | 1484 ClassBuilder builder = new ClassBuilder(classElement, namer); |
| 1484 classEmitter.emitFields(cls, builder); | 1485 classEmitter.emitFields(cls, builder); |
| 1485 return builder.fields; | 1486 return builder.fields; |
| 1486 } | 1487 } |
| 1487 } | 1488 } |
| 1488 | 1489 |
| 1489 // TODO(ahe): Remove this method. | 1490 // TODO(ahe): Remove this method. |
| 1490 NO_WARN(x) => x; | 1491 NO_WARN(x) => x; |
| OLD | NEW |