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.js_tracer; | 5 library sourcemap.js_tracer; |
6 | 6 |
7 import 'package:compiler/src/io/source_information.dart'; | 7 import 'package:compiler/src/io/source_information.dart'; |
8 import 'package:compiler/src/io/position_information.dart'; | 8 import 'package:compiler/src/io/position_information.dart'; |
9 import 'package:compiler/src/js/js.dart' as js; | 9 import 'package:compiler/src/js/js.dart' as js; |
10 import 'sourcemap_helper.dart'; | 10 import 'sourcemap_helper.dart'; |
(...skipping 17 matching lines...) Expand all Loading... |
28 final TraceGraph graph; | 28 final TraceGraph graph; |
29 | 29 |
30 StepTraceListener(this.graph); | 30 StepTraceListener(this.graph); |
31 | 31 |
32 @override | 32 @override |
33 void onStep(js.Node node, Offset offset, StepKind kind) { | 33 void onStep(js.Node node, Offset offset, StepKind kind) { |
34 SourceInformation sourceInformation = computeSourceInformation(node); | 34 SourceInformation sourceInformation = computeSourceInformation(node); |
35 SourcePositionKind sourcePositionKind = SourcePositionKind.START; | 35 SourcePositionKind sourcePositionKind = SourcePositionKind.START; |
36 List text = [node]; | 36 List text = [node]; |
37 switch (kind) { | 37 switch (kind) { |
38 case StepKind.FUN: | 38 case StepKind.FUN_ENTRY: |
| 39 text = ['<entry>']; |
| 40 break; |
| 41 case StepKind.FUN_EXIT: |
39 sourcePositionKind = SourcePositionKind.INNER; | 42 sourcePositionKind = SourcePositionKind.INNER; |
40 text = ['<exit>']; | 43 text = ['<exit>']; |
41 break; | 44 break; |
42 case StepKind.CALL: | 45 case StepKind.CALL: |
43 CallPosition callPosition = | 46 CallPosition callPosition = |
44 CallPosition.getSemanticPositionForCall(node); | 47 CallPosition.getSemanticPositionForCall(node); |
45 sourcePositionKind = callPosition.sourcePositionKind; | 48 sourcePositionKind = callPosition.sourcePositionKind; |
46 break; | 49 break; |
47 case StepKind.NEW: | 50 case StepKind.NEW: |
48 case StepKind.RETURN: | 51 case StepKind.RETURN: |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 branch = '$value'; | 138 branch = '$value'; |
136 break; | 139 break; |
137 } | 140 } |
138 graph.pushBranch(branch); | 141 graph.pushBranch(branch); |
139 } | 142 } |
140 | 143 |
141 void popBranch() { | 144 void popBranch() { |
142 graph.popBranch(); | 145 graph.popBranch(); |
143 } | 146 } |
144 } | 147 } |
OLD | NEW |