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

Side by Side Diff: tests/compiler/dart2js/js_backend_cps_ir_source_information_test.dart

Issue 1375213003: dart2js cps: Maintain parent pointers instead of recomputing them. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase Created 5 years, 2 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/js_backend/codegen/unsugar.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) 2015, the Dart project authors. Please see the AUTHORS file 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 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 // Test that the CPS IR code generator generates source information. 5 // Test that the CPS IR code generator generates source information.
6 6
7 library source_information_tests; 7 library source_information_tests;
8 8
9 import 'package:async_helper/async_helper.dart'; 9 import 'package:async_helper/async_helper.dart';
10 import 'package:expect/expect.dart'; 10 import 'package:expect/expect.dart';
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 class JsSourceInformationVisitor extends js.BaseVisitor { 116 class JsSourceInformationVisitor extends js.BaseVisitor {
117 List<String> sourceInformation = <String>[]; 117 List<String> sourceInformation = <String>[];
118 118
119 @override 119 @override
120 visitCall(js.Call node) { 120 visitCall(js.Call node) {
121 sourceInformation.add('${node.sourceInformation}'); 121 sourceInformation.add('${node.sourceInformation}');
122 super.visitCall(node); 122 super.visitCall(node);
123 } 123 }
124 } 124 }
125 125
126 class IrSourceInformationVisitor extends ir.RecursiveVisitor { 126 class IrSourceInformationVisitor extends ir.TrampolineRecursiveVisitor {
127 List<String> sourceInformation = <String>[]; 127 List<String> sourceInformation = <String>[];
128 128
129 @override 129 @override
130 processInvokeStatic(ir.InvokeStatic node) { 130 processInvokeStatic(ir.InvokeStatic node) {
131 sourceInformation.add('${node.sourceInformation}'); 131 sourceInformation.add('${node.sourceInformation}');
132 } 132 }
133 } 133 }
134 134
135 const List<TestEntry> tests = const [ 135 const List<TestEntry> tests = const [
136 const TestEntry(""" 136 const TestEntry("""
137 main() { print('Hello World'); } 137 main() { print('Hello World'); }
138 """, const ['memory:test.dart:[1,10]']), 138 """, const ['memory:test.dart:[1,10]']),
139 const TestEntry(""" 139 const TestEntry("""
140 main() { 140 main() {
141 print('Hello'); 141 print('Hello');
142 print('World'); 142 print('World');
143 } 143 }
144 """, const ['memory:test.dart:[2,3]', 144 """, const ['memory:test.dart:[2,3]',
145 'memory:test.dart:[3,3]']), 145 'memory:test.dart:[3,3]']),
146 ]; 146 ];
147 147
148 void main() { 148 void main() {
149 runTests(tests); 149 runTests(tests);
150 } 150 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/codegen/unsugar.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698