Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(491)

Side by Side Diff: pkg/compiler/lib/src/js_emitter/registry.dart

Issue 849933003: dart2js: register static non final fields in the model. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/program_builder.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 result = _deferredLibrariesMap.putIfAbsent( 91 result = _deferredLibrariesMap.putIfAbsent(
92 targetUnit, () => new LibrariesMap.deferred(targetUnit, name)); 92 targetUnit, () => new LibrariesMap.deferred(targetUnit, name));
93 } 93 }
94 _lastOutputUnit = targetUnit; 94 _lastOutputUnit = targetUnit;
95 _lastLibrariesMap = result; 95 _lastLibrariesMap = result;
96 return result; 96 return result;
97 } 97 }
98 98
99 /// Adds all elements to their respective libraries in the correct 99 /// Adds all elements to their respective libraries in the correct
100 /// libraries map. 100 /// libraries map.
101 void registerElements(OutputUnit outputUnit, List<Element> elements) { 101 void registerElements(OutputUnit outputUnit, Iterable<Element> elements) {
102 LibrariesMap targetLibrariesMap = _mapUnitToLibrariesMap(outputUnit); 102 LibrariesMap targetLibrariesMap = _mapUnitToLibrariesMap(outputUnit);
103 for (Element element in Elements.sortedByPosition(elements)) { 103 for (Element element in Elements.sortedByPosition(elements)) {
104 targetLibrariesMap.add(element.library, element); 104 targetLibrariesMap.add(element.library, element);
105 } 105 }
106 } 106 }
107 107
108 void registerConstant(OutputUnit outputUnit, ConstantValue constantValue) { 108 void registerConstant(OutputUnit outputUnit, ConstantValue constantValue) {
109 // We just need to make sure that the target library map is registered. 109 // We just need to make sure that the target library map is registered.
110 // Otherwise a library map that contains only constants is not built. 110 // Otherwise a library map that contains only constants is not built.
111 _mapUnitToLibrariesMap(outputUnit); 111 _mapUnitToLibrariesMap(outputUnit);
112 } 112 }
113 113
114 Holder registerHolder(String name) { 114 Holder registerHolder(String name) {
115 return _holdersMap.putIfAbsent( 115 return _holdersMap.putIfAbsent(
116 name, 116 name,
117 () => new Holder(name, _holdersMap.length)); 117 () => new Holder(name, _holdersMap.length));
118 } 118 }
119 } 119 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/program_builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698