| 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 part of dart2js.js_emitter.program_builder; | 5 part of dart2js.js_emitter.program_builder; |
| 6 | 6 |
| 7 /// Maps [LibraryElement]s to their [Element]s. | 7 /// Maps [LibraryElement]s to their [Element]s. |
| 8 /// | 8 /// |
| 9 /// Fundamentally, this class nicely encapsulates a | 9 /// Fundamentally, this class nicely encapsulates a |
| 10 /// `Map<LibraryElement, List<Element>>`. | 10 /// `Map<LibraryElement, List<Element>>`. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 Iterable<LibrariesMap> get deferredLibrariesMap => | 65 Iterable<LibrariesMap> get deferredLibrariesMap => |
| 66 _deferredLibrariesMap.values; | 66 _deferredLibrariesMap.values; |
| 67 | 67 |
| 68 // Add one for the main libraries map. | 68 // Add one for the main libraries map. |
| 69 int get librariesMapCount => _deferredLibrariesMap.length + 1; | 69 int get librariesMapCount => _deferredLibrariesMap.length + 1; |
| 70 | 70 |
| 71 LibrariesMap mainLibrariesMap; | 71 LibrariesMap mainLibrariesMap; |
| 72 | 72 |
| 73 Registry(this._compiler); | 73 Registry(this._compiler); |
| 74 | 74 |
| 75 bool get _isProgramSplit => _deferredLoadTask.isProgramSplit; | |
| 76 OutputUnit get _mainOutputUnit => _deferredLoadTask.mainOutputUnit; | 75 OutputUnit get _mainOutputUnit => _deferredLoadTask.mainOutputUnit; |
| 77 | 76 |
| 78 LibrariesMap _mapUnitToLibrariesMap(OutputUnit targetUnit) { | 77 LibrariesMap _mapUnitToLibrariesMap(OutputUnit targetUnit) { |
| 79 if (targetUnit == _lastOutputUnit) return _lastLibrariesMap; | 78 if (targetUnit == _lastOutputUnit) return _lastLibrariesMap; |
| 80 | 79 |
| 81 LibrariesMap result = (targetUnit == _mainOutputUnit) | 80 LibrariesMap result = (targetUnit == _mainOutputUnit) |
| 82 ? mainLibrariesMap | 81 ? mainLibrariesMap |
| 83 : _deferredLibrariesMap[targetUnit]; | 82 : _deferredLibrariesMap[targetUnit]; |
| 84 | 83 |
| 85 assert(result != null); | 84 assert(result != null); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 112 | 111 |
| 113 void registerConstant(OutputUnit outputUnit, ConstantValue constantValue) { | 112 void registerConstant(OutputUnit outputUnit, ConstantValue constantValue) { |
| 114 // Ignore for now. | 113 // Ignore for now. |
| 115 } | 114 } |
| 116 | 115 |
| 117 Holder registerHolder(String name) { | 116 Holder registerHolder(String name) { |
| 118 return _holdersMap.putIfAbsent( | 117 return _holdersMap.putIfAbsent( |
| 119 name, | 118 name, |
| 120 () => new Holder(name, _holdersMap.length)); | 119 () => new Holder(name, _holdersMap.length)); |
| 121 } | 120 } |
| 122 } | 121 } |
| OLD | NEW |