Chromium Code Reviews| OLD | NEW |
|---|---|
| 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' | 7 import 'dart:convert' |
| 8 show ChunkedConversionSink, JsonEncoder, StringConversionSink; | 8 show ChunkedConversionSink, JsonEncoder, StringConversionSink; |
| 9 | 9 |
| 10 import 'package:dart2js_info/info.dart'; | 10 import 'package:dart2js_info/info.dart'; |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 return classInfo; | 207 return classInfo; |
| 208 } | 208 } |
| 209 | 209 |
| 210 ClosureInfo visitClosureClassElement(ClosureClassElement element, _) { | 210 ClosureInfo visitClosureClassElement(ClosureClassElement element, _) { |
| 211 ClosureInfo closureInfo = new ClosureInfo( | 211 ClosureInfo closureInfo = new ClosureInfo( |
| 212 name: element.name, | 212 name: element.name, |
| 213 outputUnit: _unitInfoForElement(element), | 213 outputUnit: _unitInfoForElement(element), |
| 214 size: compiler.dumpInfoTask.sizeOf(element)); | 214 size: compiler.dumpInfoTask.sizeOf(element)); |
| 215 _elementToInfo[element] = closureInfo; | 215 _elementToInfo[element] = closureInfo; |
| 216 | 216 |
| 217 ClosureClassMap closureMap = compiler.closureToClassMapper | 217 FunctionInfo functionInfo = this.process(compiler.closureToClassMapper |
| 218 .getClosureToClassMapping(element.methodElement.resolvedAst); | 218 .getCallEntity(element.methodElement.resolvedAst)); |
|
Johnni Winther
2017/05/31 12:39:51
`element.methodElement.resolvedAst` -> `element.me
| |
| 219 assert(closureMap != null && closureMap.closureClassElement == element); | |
| 220 | |
| 221 FunctionInfo functionInfo = this.process(closureMap.callElement); | |
| 222 if (functionInfo == null) return null; | 219 if (functionInfo == null) return null; |
| 223 closureInfo.function = functionInfo; | 220 closureInfo.function = functionInfo; |
| 224 functionInfo.parent = closureInfo; | 221 functionInfo.parent = closureInfo; |
| 225 | 222 |
| 226 result.closures.add(closureInfo); | 223 result.closures.add(closureInfo); |
| 227 return closureInfo; | 224 return closureInfo; |
| 228 } | 225 } |
| 229 | 226 |
| 230 FunctionInfo visitFunctionElement(FunctionElement element, _) { | 227 FunctionInfo visitFunctionElement(FunctionElement element, _) { |
| 231 int size = compiler.dumpInfoTask.sizeOf(element); | 228 int size = compiler.dumpInfoTask.sizeOf(element); |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 612 | 609 |
| 613 ChunkedConversionSink<Object> sink = encoder.startChunkedConversion( | 610 ChunkedConversionSink<Object> sink = encoder.startChunkedConversion( |
| 614 new StringConversionSink.fromStringSink(buffer)); | 611 new StringConversionSink.fromStringSink(buffer)); |
| 615 sink.add(new AllInfoJsonCodec().encode(result)); | 612 sink.add(new AllInfoJsonCodec().encode(result)); |
| 616 compiler.reporter.reportInfo(NO_LOCATION_SPANNABLE, MessageKind.GENERIC, { | 613 compiler.reporter.reportInfo(NO_LOCATION_SPANNABLE, MessageKind.GENERIC, { |
| 617 'text': "View the dumped .info.json file at " | 614 'text': "View the dumped .info.json file at " |
| 618 "https://dart-lang.github.io/dump-info-visualizer" | 615 "https://dart-lang.github.io/dump-info-visualizer" |
| 619 }); | 616 }); |
| 620 } | 617 } |
| 621 } | 618 } |
| OLD | NEW |