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

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

Issue 1362953002: dart2js: Measure time of individual optimization passes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Add a comment Created 5 years, 3 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/ssa/optimize.dart ('k') | tests/compiler/dart2js/memory_compiler.dart » ('j') | 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 ir.FunctionDefinition irNodeForMain; 71 ir.FunctionDefinition irNodeForMain;
72 72
73 void cacheIrNodeForMain(Element function, ir.FunctionDefinition irNode) { 73 void cacheIrNodeForMain(Element function, ir.FunctionDefinition irNode) {
74 if (function == compiler.mainFunction) { 74 if (function == compiler.mainFunction) {
75 assert(irNodeForMain == null); 75 assert(irNodeForMain == null);
76 irNodeForMain = irNode; 76 irNodeForMain = irNode;
77 } 77 }
78 } 78 }
79 79
80 Uri uri = Uri.parse('memory:$TEST_MAIN_FILE'); 80 Uri uri = Uri.parse('memory:$TEST_MAIN_FILE');
81 compiler.irBuilder.builderCallback = cacheIrNodeForMain; 81 compiler.backend.functionCompiler.cpsBuilderTask.builderCallback =
82 cacheIrNodeForMain;
82 83
83 return compiler.run(uri).then((bool success) { 84 return compiler.run(uri).then((bool success) {
84 Expect.isTrue(success); 85 Expect.isTrue(success);
85 86
86 IrSourceInformationVisitor irVisitor = new IrSourceInformationVisitor(); 87 IrSourceInformationVisitor irVisitor = new IrSourceInformationVisitor();
87 irNodeForMain.accept(irVisitor); 88 irNodeForMain.accept(irVisitor);
88 89
89 js.Node jsNode = getJsNodeForElement(compiler, compiler.mainFunction); 90 js.Node jsNode = getJsNodeForElement(compiler, compiler.mainFunction);
90 JsSourceInformationVisitor jsVisitor = new JsSourceInformationVisitor(); 91 JsSourceInformationVisitor jsVisitor = new JsSourceInformationVisitor();
91 jsNode.accept(jsVisitor); 92 jsNode.accept(jsVisitor);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 print('Hello'); 141 print('Hello');
141 print('World'); 142 print('World');
142 } 143 }
143 """, const ['memory:test.dart:[2,3]', 144 """, const ['memory:test.dart:[2,3]',
144 'memory:test.dart:[3,3]']), 145 'memory:test.dart:[3,3]']),
145 ]; 146 ];
146 147
147 void main() { 148 void main() {
148 runTests(tests); 149 runTests(tests);
149 } 150 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/optimize.dart ('k') | tests/compiler/dart2js/memory_compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698