Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: tests/compiler/dart2js/sourcemaps/js_tracer.dart

Issue 1773553002: Add source location to function declarations. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/io/position_information.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/io/position_information.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698