loadProgramInfo function

ProgramInfo loadProgramInfo(
  1. List json, {
  2. bool collapseAnonymousClosures = false,
})

Parse the output of --print-instructions-sizes-to saved in the given file input into ProgramInfo structure representing the sizes of individual functions.

If collapseAnonymousClosures is set to true then all anonymous closures within the same scopes are collapsed together. Collapsing closures is helpful when comparing symbol sizes between two versions of the same program because in general there is no reliable way to recognize the same anonymous closures into two independent compilations.

Implementation

ProgramInfo loadProgramInfo(List<dynamic> json,
    {bool collapseAnonymousClosures = false}) {
  final symbols = fromJson(json);
  return toProgramInfo(symbols,
      collapseAnonymousClosures: collapseAnonymousClosures);
}