| OLD | NEW |
| 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 /// Data collected by the dump-info task. | 5 /// Data collected by the dump-info task. |
| 6 library compiler.src.lib.info; | 6 library compiler.src.lib.info; |
| 7 | 7 |
| 8 // Note: this file intentionally doesn't import anything from the compiler. That | 8 // Note: this file intentionally doesn't import anything from the compiler. That |
| 9 // should make it easier for tools to depend on this library. The idea is that | 9 // should make it easier for tools to depend on this library. The idea is that |
| 10 // by using this library, tools can consume the information in the same way it | 10 // by using this library, tools can consume the information in the same way it |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 var src = idMap[k]; | 249 var src = idMap[k]; |
| 250 assert (src != null); | 250 assert (src != null); |
| 251 for (var dep in deps) { | 251 for (var dep in deps) { |
| 252 var target = idMap[dep['id']]; | 252 var target = idMap[dep['id']]; |
| 253 assert (target != null); | 253 assert (target != null); |
| 254 src.uses.add(new DependencyInfo(target, dep['mask'])); | 254 src.uses.add(new DependencyInfo(target, dep['mask'])); |
| 255 } | 255 } |
| 256 }); | 256 }); |
| 257 | 257 |
| 258 json['dependencies']?.forEach((k, deps) { | 258 json['dependencies']?.forEach((k, deps) { |
| 259 result.deps[idMap[k]] = deps.map((d) => idMap[d]).toList(); | 259 result.dependencies[idMap[k]] = deps.map((d) => idMap[d]).toList(); |
| 260 }); | 260 }); |
| 261 | 261 |
| 262 result.program = parseProgram(json['program']); | 262 result.program = parseProgram(json['program']); |
| 263 // todo: version, etc | 263 // todo: version, etc |
| 264 return result; | 264 return result; |
| 265 } | 265 } |
| 266 | 266 |
| 267 LibraryInfo parseLibrary(Map json) { | 267 LibraryInfo parseLibrary(Map json) { |
| 268 LibraryInfo result = parseId(json['id']); | 268 LibraryInfo result = parseId(json['id']); |
| 269 result..name = json['name'] | 269 result..name = json['name'] |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 } | 724 } |
| 725 | 725 |
| 726 visitField(FieldInfo info) { | 726 visitField(FieldInfo info) { |
| 727 info.closures.forEach(visitFunction); | 727 info.closures.forEach(visitFunction); |
| 728 } | 728 } |
| 729 | 729 |
| 730 visitFunction(FunctionInfo info) { | 730 visitFunction(FunctionInfo info) { |
| 731 info.closures.forEach(visitFunction); | 731 info.closures.forEach(visitFunction); |
| 732 } | 732 } |
| 733 } | 733 } |
| OLD | NEW |