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

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

Issue 10825386: Use JavaScript runtime semantics when constant folding. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | lib/compiler/implementation/compile_time_constants.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) 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');
(...skipping 12 matching lines...) Expand all
23 bool mockableLibraryUsed = false; 23 bool mockableLibraryUsed = false;
24 24
25 Compiler(this.provider, this.handler, this.libraryRoot, this.packageRoot, 25 Compiler(this.provider, this.handler, this.libraryRoot, this.packageRoot,
26 List<String> options) 26 List<String> options)
27 : this.options = options, 27 : this.options = options,
28 super( 28 super(
29 tracer: new ssa.HTracer(), 29 tracer: new ssa.HTracer(),
30 enableTypeAssertions: hasOption(options, '--enable-checked-mode'), 30 enableTypeAssertions: hasOption(options, '--enable-checked-mode'),
31 enableUserAssertions: hasOption(options, '--enable-checked-mode'), 31 enableUserAssertions: hasOption(options, '--enable-checked-mode'),
32 enableMinification: hasOption(options, '--minify'), 32 enableMinification: hasOption(options, '--minify'),
33 emitJavascript: !hasOption(options, '--output-type=dart'), 33 emitJavaScript: !hasOption(options, '--output-type=dart'),
34 cutDeclarationTypes: hasOption(options, '--cut-declaration-types')); 34 cutDeclarationTypes: hasOption(options, '--cut-declaration-types'));
35 35
36 static bool hasOption(List<String> options, String option) { 36 static bool hasOption(List<String> options, String option) {
37 return options.indexOf(option) >= 0; 37 return options.indexOf(option) >= 0;
38 } 38 }
39 39
40 String lookupLibraryPath(String dartLibraryName) { 40 String lookupLibraryPath(String dartLibraryName) {
41 LibraryInfo info = LIBRARIES[dartLibraryName]; 41 LibraryInfo info = LIBRARIES[dartLibraryName];
42 if (info === null) return null; 42 if (info === null) return null;
43 if (!info.isDart2jsLibrary) return null; 43 if (!info.isDart2jsLibrary) return null;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 handler(translateUri(span.uri, null), span.begin, span.end, 144 handler(translateUri(span.uri, null), span.begin, span.end,
145 message, kind); 145 message, kind);
146 } 146 }
147 } 147 }
148 148
149 bool get isMockCompilation { 149 bool get isMockCompilation {
150 return mockableLibraryUsed 150 return mockableLibraryUsed
151 && (options.indexOf('--allow-mock-compilation') !== -1); 151 && (options.indexOf('--allow-mock-compilation') !== -1);
152 } 152 }
153 } 153 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/compile_time_constants.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698