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

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

Issue 1617083002: Base JavaScript code position computation on JavaScript tracer. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 11 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
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library sourcemap.trace_graph;
6
7 import 'dart:collection';
8
9 import 'package:compiler/src/io/source_information.dart';
10 import 'package:compiler/src/io/position_information.dart';
11
12 import 'sourcemap_html_helper.dart';
13
14 class TraceGraph {
15 List<TraceStep> steps = <TraceStep>[];
16 TraceStep entry;
17 Queue stack = new Queue();
18
19 void addStep(TraceStep step) {
20 steps.add(step);
21 step.stack = stack.toList();
22 }
23
24 void pushBranch(branch) {
25 stack.addLast(branch);
26 }
27
28 void popBranch() {
29 stack.removeLast();
30 }
31 }
32
33 class TraceStep {
34 final int id;
35 final node;
36 final Offset offset;
37 final List text;
38 final SourceLocation sourceLocation;
39
40 TraceStep next;
41 Map<dynamic, TraceStep> branchMap;
42
43 List stack;
44
45 TraceStep(
46 this.id,
47 this.node,
48 this.offset,
49 this.text,
50 [this.sourceLocation]);
51
52 String toString() => '<span style="background:${toColorCss(id)}">$id</span>';
53 }
54
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/sourcemaps/sourcemap_html_helper.dart ('k') | tests/compiler/dart2js/type_representation_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698