| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 sourcemap.diff_view; | 5 library sourcemap.diff_view; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 import 'dart:io'; | 9 import 'dart:io'; |
| 10 | 10 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 filename = arg; | 62 filename = arg; |
| 63 } | 63 } |
| 64 } | 64 } |
| 65 List<String> commonArguments = optionSegments[0]; | 65 List<String> commonArguments = optionSegments[0]; |
| 66 List<List<String>> options = <List<String>>[]; | 66 List<List<String>> options = <List<String>>[]; |
| 67 if (optionSegments.length == 1) { | 67 if (optionSegments.length == 1) { |
| 68 // TODO(sigmund, johnniwinther): change default options now that CPS is | 68 // TODO(sigmund, johnniwinther): change default options now that CPS is |
| 69 // deleted. | 69 // deleted. |
| 70 // Use default options; comparing SSA and CPS output using the new | 70 // Use default options; comparing SSA and CPS output using the new |
| 71 // source information strategy. | 71 // source information strategy. |
| 72 options.add(commonArguments); |
| 72 options.add([Flags.useNewSourceInfo]..addAll(commonArguments)); | 73 options.add([Flags.useNewSourceInfo]..addAll(commonArguments)); |
| 73 options.add([Flags.useNewSourceInfo]..addAll(commonArguments)); | |
| 74 throw "missing options: please specify options for the second column"; | |
| 75 } else if (optionSegments.length == 2) { | 74 } else if (optionSegments.length == 2) { |
| 76 // Use alternative options for the second output column. | 75 // Use alternative options for the second output column. |
| 77 options.add(commonArguments); | 76 options.add(commonArguments); |
| 78 options.add(optionSegments[1]..addAll(commonArguments)); | 77 options.add(optionSegments[1]..addAll(commonArguments)); |
| 79 } else { | 78 } else { |
| 80 // Use specific options for both output columns. | 79 // Use specific options for both output columns. |
| 81 options.add(optionSegments[1]..addAll(commonArguments)); | 80 options.add(optionSegments[1]..addAll(commonArguments)); |
| 82 options.add(optionSegments[2]..addAll(commonArguments)); | 81 options.add(optionSegments[2]..addAll(commonArguments)); |
| 83 } | 82 } |
| 84 | 83 |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 // Add annotations based on trace steps. | 785 // Add annotations based on trace steps. |
| 787 for (TraceStep step in graph.steps) { | 786 for (TraceStep step in graph.steps) { |
| 788 String stepInfo = '${step.id}:${step.kind}:${step.offset}'; | 787 String stepInfo = '${step.id}:${step.kind}:${step.offset}'; |
| 789 bool added = addSourceLocationsForNode( | 788 bool added = addSourceLocationsForNode( |
| 790 annotationType: AnnotationType.WITH_SOURCE_INFO, | 789 annotationType: AnnotationType.WITH_SOURCE_INFO, |
| 791 node: step.node, | 790 node: step.node, |
| 792 stepInfo: stepInfo); | 791 stepInfo: stepInfo); |
| 793 if (!added) { | 792 if (!added) { |
| 794 int offset; | 793 int offset; |
| 795 if (options.contains(Flags.useNewSourceInfo)) { | 794 if (options.contains(Flags.useNewSourceInfo)) { |
| 796 offset = step.offset.subexpressionOffset; | 795 offset = step.offset.value; |
| 797 } else { | 796 } else { |
| 798 offset = info.jsCodePositions[step.node].startPosition; | 797 offset = info.jsCodePositions[step.node].startPosition; |
| 799 } | 798 } |
| 800 if (offset != null) { | 799 if (offset != null) { |
| 801 addCodeLineAnnotation( | 800 addCodeLineAnnotation( |
| 802 annotationType: AnnotationType.WITHOUT_SOURCE_INFO, | 801 annotationType: AnnotationType.WITHOUT_SOURCE_INFO, |
| 803 codeOffset: offset, | 802 codeOffset: offset, |
| 804 stepInfo: stepInfo); | 803 stepInfo: stepInfo); |
| 805 } | 804 } |
| 806 } | 805 } |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 if (data.annotationType == AnnotationType.WITHOUT_SOURCE_INFO) { | 955 if (data.annotationType == AnnotationType.WITHOUT_SOURCE_INFO) { |
| 957 return new AnnotationData(tag: 'span', properties: { | 956 return new AnnotationData(tag: 'span', properties: { |
| 958 'title': annotation.title, | 957 'title': annotation.title, |
| 959 'class': '${ClassNames.marker} ' | 958 'class': '${ClassNames.marker} ' |
| 960 '${data.annotationType.className}' | 959 '${data.annotationType.className}' |
| 961 }); | 960 }); |
| 962 } | 961 } |
| 963 } | 962 } |
| 964 return null; | 963 return null; |
| 965 } | 964 } |
| OLD | NEW |