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

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

Issue 469903002: Added a test for dump-info with lots of closures. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rename variables to make the test easier to read Created 6 years, 4 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
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 'dart:convert' show 7 import 'dart:convert' show
8 HtmlEscape, 8 HtmlEscape,
9 JsonEncoder, 9 JsonEncoder,
10 StringConversionSink, 10 StringConversionSink,
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 'kind': 'typedef', 185 'kind': 'typedef',
186 'name': element.name 186 'name': element.name
187 }; 187 };
188 } 188 }
189 189
190 Map<String, dynamic> visitFieldElement(FieldElement element) { 190 Map<String, dynamic> visitFieldElement(FieldElement element) {
191 String id = mapper._field.add(element); 191 String id = mapper._field.add(element);
192 List<String> children = []; 192 List<String> children = [];
193 StringBuffer emittedCode = compiler.dumpInfoTask.codeOf(element); 193 StringBuffer emittedCode = compiler.dumpInfoTask.codeOf(element);
194 194
195 // If a field has an empty inferred type it is never used.
196 TypeMask inferredType = 195 TypeMask inferredType =
197 compiler.typesTask.getGuaranteedTypeOfElement(element); 196 compiler.typesTask.getGuaranteedTypeOfElement(element);
sra1 2014/08/13 21:45:26 indent by +4 when breaking an expression
Ty Overby (Google) 2014/08/13 22:00:31 Done.
197 // If a field has an empty inferred type it is never used.
198 if (inferredType == null || inferredType.isEmpty || element.isConst) { 198 if (inferredType == null || inferredType.isEmpty || element.isConst) {
199 return null; 199 return null;
200 } 200 }
201 201
202 int size = compiler.dumpInfoTask.sizeOf(element); 202 int size = compiler.dumpInfoTask.sizeOf(element);
203 String code; 203 String code;
204 204
205 if (emittedCode != null) { 205 if (emittedCode != null) {
206 size += emittedCode.length; 206 size += emittedCode.length;
207 code = emittedCode.toString(); 207 code = emittedCode.toString();
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 }; 589 };
590 590
591 outJson['program'] = generalProgramInfo; 591 outJson['program'] = generalProgramInfo;
592 592
593 ChunkedConversionSink<Object> sink = 593 ChunkedConversionSink<Object> sink =
594 encoder.startChunkedConversion( 594 encoder.startChunkedConversion(
595 new StringConversionSink.fromStringSink(buffer)); 595 new StringConversionSink.fromStringSink(buffer));
596 sink.add(outJson); 596 sink.add(outJson);
597 } 597 }
598 } 598 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698