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

Side by Side Diff: lib/compiler/implementation/apiimpl.dart

Issue 10414024: Add a flag to control the backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Last version Created 8 years, 7 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('leg_apiimpl'); 5 #library('leg_apiimpl');
6 6
7 #import('dart:uri'); 7 #import('dart:uri');
8 8
9 #import('../compiler.dart', prefix: 'api'); 9 #import('../compiler.dart', prefix: 'api');
10 #import('leg.dart', prefix: 'leg'); 10 #import('leg.dart', prefix: 'leg');
11 #import('tree/tree.dart', prefix: 'tree'); 11 #import('tree/tree.dart', prefix: 'tree');
12 #import('elements/elements.dart', prefix: 'elements'); 12 #import('elements/elements.dart', prefix: 'elements');
13 #import('ssa/tracer.dart', prefix: 'ssa'); 13 #import('ssa/tracer.dart', prefix: 'ssa');
14 #import('library_map.dart'); 14 #import('library_map.dart');
15 #import('source_file.dart'); 15 #import('source_file.dart');
16 16
17 class Compiler extends leg.Compiler { 17 class Compiler extends leg.Compiler {
18 api.ReadUriFromString provider; 18 api.ReadUriFromString provider;
19 api.DiagnosticHandler handler; 19 api.DiagnosticHandler handler;
20 Uri libraryRoot; 20 Uri libraryRoot;
21 Uri packageRoot; 21 Uri packageRoot;
22 List<String> options; 22 List<String> options;
23 bool mockableLibraryUsed = false; 23 bool mockableLibraryUsed = false;
24 24
25 Compiler(this.provider, this.handler, this.libraryRoot, this.options) 25 Compiler(this.provider, this.handler, this.libraryRoot, List<String> options)
26 : super(tracer: new ssa.HTracer()) { 26 : this.options = options,
27 enableTypeAssertions = options.indexOf('--enable-checked-mode') !== -1; 27 super(
28 } 28 tracer: new ssa.HTracer(),
29 enableTypeAssertions: options.indexOf('--enable-checked-mode') != -1,
30 emitJavascript: options.indexOf('--output-type=dart') == -1);
29 31
30 elements.LibraryElement scanBuiltinLibrary(String path) { 32 elements.LibraryElement scanBuiltinLibrary(String path) {
31 Uri uri = libraryRoot.resolve(DART2JS_LIBRARY_MAP[path]); 33 Uri uri = libraryRoot.resolve(DART2JS_LIBRARY_MAP[path]);
32 elements.LibraryElement library = scanner.loadLibrary(uri, null); 34 elements.LibraryElement library = scanner.loadLibrary(uri, null);
33 return library; 35 return library;
34 } 36 }
35 37
36 void log(message) { 38 void log(message) {
37 handler(null, null, null, message, false); 39 handler(null, null, null, message, false);
38 } 40 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 } else { 99 } else {
98 handler(span.uri, span.begin, span.end, message, fatal); 100 handler(span.uri, span.begin, span.end, message, fatal);
99 } 101 }
100 } 102 }
101 103
102 bool get isMockCompilation() { 104 bool get isMockCompilation() {
103 return mockableLibraryUsed 105 return mockableLibraryUsed
104 && (options.indexOf('--allow-mock-compilation') !== -1); 106 && (options.indexOf('--allow-mock-compilation') !== -1);
105 } 107 }
106 } 108 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/compiler.dart » ('j') | lib/compiler/implementation/dart2js.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698