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

Side by Side Diff: pkg/front_end/tool/fasta_perf.dart

Issue 2980883003: Remove code associated with the old "kompile" functionality. (Closed)
Patch Set: Created 3 years, 5 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/front_end/testcases/type_variable_as_super.dart.dartk.expect ('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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 /// An entrypoint used to run portions of fasta and measure its performance. 5 /// An entrypoint used to run portions of fasta and measure its performance.
6 library front_end.tool.fasta_perf; 6 library front_end.tool.fasta_perf;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:io'; 9 import 'dart:io';
10 10
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 /// Parse the full body of [source]. 187 /// Parse the full body of [source].
188 parseFull(Uri uri, List<int> source) { 188 parseFull(Uri uri, List<int> source) {
189 var tokens = tokenize(source); 189 var tokens = tokenize(source);
190 Parser parser = new Parser(new _PartialAstBuilder(uri)); 190 Parser parser = new Parser(new _PartialAstBuilder(uri));
191 parser.parseUnit(tokens); 191 parser.parseUnit(tokens);
192 } 192 }
193 193
194 // Note: AstBuilder doesn't build compilation-units or classes, only method 194 // Note: AstBuilder doesn't build compilation-units or classes, only method
195 // bodies. So this listener is not feature complete. 195 // bodies. So this listener is not feature complete.
196 class _PartialAstBuilder extends AstBuilder { 196 class _PartialAstBuilder extends AstBuilder {
197 _PartialAstBuilder(Uri uri) 197 _PartialAstBuilder(Uri uri) : super(null, null, null, null, true, uri);
198 : super(null, null, null, null, null, true, true, uri);
199 198
200 // Note: this method converts the body to kernel, so we skip that here. 199 // Note: this method converts the body to kernel, so we skip that here.
201 @override 200 @override
202 finishFunction(annotations, formals, asyncModifier, body) {} 201 finishFunction(annotations, formals, asyncModifier, body) {}
203 } 202 }
204 203
205 // Invoke the fasta kernel generator for the program starting in [entryUri] 204 // Invoke the fasta kernel generator for the program starting in [entryUri]
206 generateKernel(Uri entryUri, 205 generateKernel(Uri entryUri,
207 {bool compileSdk: true, bool strongMode: false}) async { 206 {bool compileSdk: true, bool strongMode: false}) async {
208 // TODO(sigmund): this is here only to compute the input size, 207 // TODO(sigmund): this is here only to compute the input size,
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 /// Report that metric [name] took [time] micro-seconds to process 245 /// Report that metric [name] took [time] micro-seconds to process
247 /// [inputSize] characters. 246 /// [inputSize] characters.
248 void report(String name, int time) { 247 void report(String name, int time) {
249 var sb = new StringBuffer(); 248 var sb = new StringBuffer();
250 var padding = ' ' * (20 - name.length); 249 var padding = ' ' * (20 - name.length);
251 sb.write('$name:$padding $time us, ${time ~/ 1000} ms'); 250 sb.write('$name:$padding $time us, ${time ~/ 1000} ms');
252 var invSpeed = (time * 1000 / inputSize).toStringAsFixed(2); 251 var invSpeed = (time * 1000 / inputSize).toStringAsFixed(2);
253 sb.write(', $invSpeed ns/char'); 252 sb.write(', $invSpeed ns/char');
254 print('$sb'); 253 print('$sb');
255 } 254 }
OLDNEW
« no previous file with comments | « pkg/front_end/testcases/type_variable_as_super.dart.dartk.expect ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698