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

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

Issue 10963055: [dart2dart] Make removal of asserts and forcing type strips go under (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
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 5
6 /** 6 /**
7 * If true, print a warning for each method that was resolved, but not 7 * If true, print a warning for each method that was resolved, but not
8 * compiled. 8 * compiled.
9 */ 9 */
10 const bool REPORT_EXCESS_RESOLUTION = false; 10 const bool REPORT_EXCESS_RESOLUTION = false;
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 bool compilationFailed = false; 190 bool compilationFailed = false;
191 191
192 bool hasCrashed = false; 192 bool hasCrashed = false;
193 193
194 Compiler([this.tracer = const Tracer(), 194 Compiler([this.tracer = const Tracer(),
195 this.enableTypeAssertions = false, 195 this.enableTypeAssertions = false,
196 this.enableUserAssertions = false, 196 this.enableUserAssertions = false,
197 this.enableMinification = false, 197 this.enableMinification = false,
198 bool emitJavaScript = true, 198 bool emitJavaScript = true,
199 bool generateSourceMap = true, 199 bool generateSourceMap = true,
200 bool forceCutDeclarationTypes = false]) 200 List<String> strips = const []])
201 : libraries = new Map<String, LibraryElement>(), 201 : libraries = new Map<String, LibraryElement>(),
202 progress = new Stopwatch() { 202 progress = new Stopwatch() {
203 progress.start(); 203 progress.start();
204 world = new World(this); 204 world = new World(this);
205 scanner = new ScannerTask(this); 205 scanner = new ScannerTask(this);
206 dietParser = new DietParserTask(this); 206 dietParser = new DietParserTask(this);
207 parser = new ParserTask(this); 207 parser = new ParserTask(this);
208 patchParser = new PatchParserTask(this); 208 patchParser = new PatchParserTask(this);
209 validator = new TreeValidatorTask(this); 209 validator = new TreeValidatorTask(this);
210 resolver = new ResolverTask(this); 210 resolver = new ResolverTask(this);
211 closureToClassMapper = new closureMapping.ClosureTask(this); 211 closureToClassMapper = new closureMapping.ClosureTask(this);
212 checker = new TypeCheckerTask(this); 212 checker = new TypeCheckerTask(this);
213 typesTask = new ti.TypesTask(this); 213 typesTask = new ti.TypesTask(this);
214 backend = emitJavaScript ? 214 backend = emitJavaScript ?
215 new js_backend.JavaScriptBackend(this, generateSourceMap) : 215 new js_backend.JavaScriptBackend(this, generateSourceMap) :
216 new dart_backend.DartBackend(this, forceCutDeclarationTypes); 216 new dart_backend.DartBackend(this, strips);
217 constantHandler = new ConstantHandler(this, backend.constantSystem); 217 constantHandler = new ConstantHandler(this, backend.constantSystem);
218 enqueuer = new EnqueueTask(this); 218 enqueuer = new EnqueueTask(this);
219 tasks = [scanner, dietParser, parser, resolver, closureToClassMapper, 219 tasks = [scanner, dietParser, parser, resolver, closureToClassMapper,
220 checker, typesTask, constantHandler, enqueuer]; 220 checker, typesTask, constantHandler, enqueuer];
221 tasks.addAll(backend.tasks); 221 tasks.addAll(backend.tasks);
222 } 222 }
223 223
224 Universe get resolverWorld => enqueuer.resolution.universe; 224 Universe get resolverWorld => enqueuer.resolution.universe;
225 Universe get codegenWorld => enqueuer.codegen.universe; 225 Universe get codegenWorld => enqueuer.codegen.universe;
226 226
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 * information in the generated error message. 975 * information in the generated error message.
976 */ 976 */
977 bool invariant(Spannable spannable, var condition, {String message: null}) { 977 bool invariant(Spannable spannable, var condition, {String message: null}) {
978 // TODO(johnniwinther): Use [spannable] and [message] to provide better 978 // TODO(johnniwinther): Use [spannable] and [message] to provide better
979 // information on assertion errors. 979 // information on assertion errors.
980 if (condition is Function){ 980 if (condition is Function){
981 condition = condition(); 981 condition = condition();
982 } 982 }
983 return spannable != null && condition; 983 return spannable != null && condition;
984 } 984 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698