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

Side by Side Diff: lib/compiler/implementation/scanner/vm_scanner_bench.dart

Issue 9873021: Move frog/leg to lib/compiler/implementation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #library('vm_scanner_bench'); 5 #library('vm_scanner_bench');
6 #import('dart:io'); 6 #import('dart:io');
7 #import('scannerlib.dart'); 7 #import('scannerlib.dart');
8 #import('scanner_implementation.dart'); 8 #import('scanner_implementation.dart');
9 #import('scanner_bench.dart'); 9 #import('scanner_bench.dart');
10 #import('../../../lib/utf/utf.dart'); 10 #import('../../../utf/utf.dart');
11 #import('../util/characters.dart'); 11 #import('../util/characters.dart');
12 #source('byte_strings.dart'); 12 #source('byte_strings.dart');
13 #source('byte_array_scanner.dart'); 13 #source('byte_array_scanner.dart');
14 14
15 class VmScannerBench extends ScannerBench { 15 class VmScannerBench extends ScannerBench {
16 int getBytes(String filename, void callback(List<int> bytes)) { 16 int getBytes(String filename, void callback(List<int> bytes)) {
17 var file = (new File(filename)).openSync(); 17 var file = (new File(filename)).openSync();
18 int size = file.lengthSync(); 18 int size = file.lengthSync();
19 List<int> bytes = new ByteArray(size + 1); 19 List<int> bytes = new ByteArray(size + 1);
20 file.readListSync(bytes, 0, size); 20 file.readListSync(bytes, 0, size);
21 bytes[size] = $EOF; 21 bytes[size] = $EOF;
22 file.closeSync(); 22 file.closeSync();
23 callback(bytes); 23 callback(bytes);
24 return bytes.length - 1; 24 return bytes.length - 1;
25 } 25 }
26 26
27 void checkExistence(String filename) { 27 void checkExistence(String filename) {
28 File file = new File(filename); 28 File file = new File(filename);
29 if (!file.existsSync()) { 29 if (!file.existsSync()) {
30 print("no such file: ${filename}"); 30 print("no such file: ${filename}");
31 } 31 }
32 } 32 }
33 33
34 Scanner makeScanner(bytes) => new ByteArrayScanner(bytes); 34 Scanner makeScanner(bytes) => new ByteArrayScanner(bytes);
35 } 35 }
36 36
37 main() { 37 main() {
38 new VmScannerBench().main(argv); 38 new VmScannerBench().main(argv);
39 } 39 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/scanner/scannerlib.dart ('k') | lib/compiler/implementation/tools/mini_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698