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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/dump_info.dart

Issue 185543010: --dump-info: only computeType if field used (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 | « no previous file | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 dump_info; 5 library dump_info;
6 6
7 import 'elements/elements.dart'; 7 import 'elements/elements.dart';
8 import 'elements/visitor.dart'; 8 import 'elements/visitor.dart';
9 import 'dart:convert' show HtmlEscape; 9 import 'dart:convert' show HtmlEscape;
10 import 'dart2jslib.dart' show 10 import 'dart2jslib.dart' show
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 return element.alias == null 265 return element.alias == null
266 ? null 266 ? null
267 : new ElementInfoNode( 267 : new ElementInfoNode(
268 type: element.alias.toString(), 268 type: element.alias.toString(),
269 kind: "typedef", 269 kind: "typedef",
270 name: element.name); 270 name: element.name);
271 } 271 }
272 272
273 InfoNode visitFieldElement(FieldElement element) { 273 InfoNode visitFieldElement(FieldElement element) {
274 CodeBuffer emittedCode = compiler.backend.codeOf(element); 274 CodeBuffer emittedCode = compiler.backend.codeOf(element);
275 int size = 0;
276 DartType type = element.computeType(compiler);
277 TypeMask inferredType = compiler.typesTask 275 TypeMask inferredType = compiler.typesTask
278 .getGuaranteedTypeOfElement(element); 276 .getGuaranteedTypeOfElement(element);
279 // If a field has an empty inferred type it is never used. 277 // If a field has an empty inferred type it is never used.
280 if ((inferredType == null || inferredType.isEmpty) && emittedCode == null) { 278 if ((inferredType == null || inferredType.isEmpty) && emittedCode == null) {
281 return null; 279 return null;
282 } 280 }
281 int size = 0;
282 DartType type = element.computeType(compiler);
283 List<InfoNode> contents = new List<InfoNode>(); 283 List<InfoNode> contents = new List<InfoNode>();
284 if (emittedCode != null) { 284 if (emittedCode != null) {
285 contents.add(new CodeInfoNode( 285 contents.add(new CodeInfoNode(
286 description: "Generated initializer", 286 description: "Generated initializer",
287 generatedCode: emittedCode.getText())); 287 generatedCode: emittedCode.getText()));
288 size = emittedCode.length; 288 size = emittedCode.length;
289 } 289 }
290 if (inferredType != null) { 290 if (inferredType != null) {
291 contents.add(new InferredInfoNode( 291 contents.add(new InferredInfoNode(
292 description: "type", 292 description: "type",
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 var container = containers[i]; 508 var container = containers[i];
509 container.addEventListener('click', 509 container.addEventListener('click',
510 toggler(container.nextElementSibling), false); 510 toggler(container.nextElementSibling), false);
511 container.nextElementSibling.hidden = true; 511 container.nextElementSibling.hidden = true;
512 }; 512 };
513 </script> 513 </script>
514 </body> 514 </body>
515 </html>"""); 515 </html>""");
516 } 516 }
517 } 517 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698