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

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

Issue 2647043002: Fix hints reported by analyzer. (Closed)
Patch Set: Address review comments. Created 3 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 /** 7 /**
8 * Generates the code for all used classes in the program. Static fields (even 8 * Generates the code for all used classes in the program. Static fields (even
9 * in classes) are ignored, since they can be treated as non-class elements. 9 * in classes) are ignored, since they can be treated as non-class elements.
10 * 10 *
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 274
275 for (Element element in Elements.sortedByPosition(elements)) { 275 for (Element element in Elements.sortedByPosition(elements)) {
276 List<Element> list = outputStaticLists.putIfAbsent( 276 List<Element> list = outputStaticLists.putIfAbsent(
277 compiler.deferredLoadTask.outputUnitForElement(element), 277 compiler.deferredLoadTask.outputUnitForElement(element),
278 () => new List<Element>()); 278 () => new List<Element>());
279 list.add(element); 279 list.add(element);
280 } 280 }
281 } 281 }
282 282
283 void computeNeededStaticNonFinalFields() { 283 void computeNeededStaticNonFinalFields() {
284 JavaScriptConstantCompiler handler = backend.constants;
285 addToOutputUnit(Element element) { 284 addToOutputUnit(Element element) {
286 List<VariableElement> list = outputStaticNonFinalFieldLists.putIfAbsent( 285 List<VariableElement> list = outputStaticNonFinalFieldLists.putIfAbsent(
287 compiler.deferredLoadTask.outputUnitForElement(element), 286 compiler.deferredLoadTask.outputUnitForElement(element),
288 () => new List<VariableElement>()); 287 () => new List<VariableElement>());
289 list.add(element); 288 list.add(element);
290 } 289 }
291 290
292 Iterable<Element> fields = compiler 291 Iterable<Element> fields = compiler
293 // TODO(johnniwinther): This should be accessed from a codegen closed 292 // TODO(johnniwinther): This should be accessed from a codegen closed
294 // world. 293 // world.
(...skipping 29 matching lines...) Expand all
324 } 323 }
325 324
326 void collect() { 325 void collect() {
327 computeNeededDeclarations(); 326 computeNeededDeclarations();
328 computeNeededConstants(); 327 computeNeededConstants();
329 computeNeededStatics(); 328 computeNeededStatics();
330 computeNeededStaticNonFinalFields(); 329 computeNeededStaticNonFinalFields();
331 computeNeededLibraries(); 330 computeNeededLibraries();
332 } 331 }
333 } 332 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698