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

Unified Diff: tests/compiler/dart2js/sourcemaps/trace_graph.dart

Issue 1678043003: Add Dart code to diff_view (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Cleanup Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: tests/compiler/dart2js/sourcemaps/trace_graph.dart
diff --git a/tests/compiler/dart2js/sourcemaps/trace_graph.dart b/tests/compiler/dart2js/sourcemaps/trace_graph.dart
index b21014bc7350f3de2de8156d3c85665347c7a300..75eec94d24d2f04f58540b48f0e8bc4fb33823f8 100644
--- a/tests/compiler/dart2js/sourcemaps/trace_graph.dart
+++ b/tests/compiler/dart2js/sourcemaps/trace_graph.dart
@@ -8,6 +8,7 @@ import 'dart:collection';
import 'package:compiler/src/io/source_information.dart';
import 'package:compiler/src/io/position_information.dart';
+import 'package:compiler/src/js/js_debug.dart';
import 'sourcemap_html_helper.dart';
@@ -15,9 +16,24 @@ class TraceGraph {
List<TraceStep> steps = <TraceStep>[];
TraceStep entry;
Queue stack = new Queue();
+ Map<int, TraceStep> offsetMap = {};
void addStep(TraceStep step) {
steps.add(step);
+ int offset = step.offset.subexpressionOffset;
+ TraceStep existingStep = offsetMap[offset];
+ if (existingStep != null) {
+ // TODO(johnniwinther): Fix problems with reuse of JS nodes from
+ // templates.
+ if (identical(existingStep.node, step.node)) {
+ print('duplicate node: ${nodeToString(step.node)}');
+ } else {
+ print('duplicate offset: ${offset} : ${nodeToString(step.node)}');
+ }
+ print(' ${existingStep.id}:${existingStep.text}:${existingStep.offset}');
+ print(' ${step.id}:${step.text}:${step.offset}');
+ }
+ offsetMap[offset] = step;
step.stack = stack.toList();
}
@@ -31,6 +47,7 @@ class TraceGraph {
}
class TraceStep {
+ final kind;
final int id;
final node;
final Offset offset;
@@ -43,6 +60,7 @@ class TraceStep {
List stack;
TraceStep(
+ this.kind,
this.id,
this.node,
this.offset,

Powered by Google App Engine
This is Rietveld 408576698