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

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

Issue 14969040: Add a new flag to dart2js: --trust-type-annotations and implement it in the types inferrer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 part of dart2js; 5 part of dart2js;
6 6
7 /** 7 /**
8 * If true, print a warning for each method that was resolved, but not 8 * If true, print a warning for each method that was resolved, but not
9 * compiled. 9 * compiled.
10 */ 10 */
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 * correspond to a particular element. 244 * correspond to a particular element.
245 * 245 *
246 * We should get rid of this and ensure that all dependencies are 246 * We should get rid of this and ensure that all dependencies are
247 * associated with a particular element. 247 * associated with a particular element.
248 */ 248 */
249 final TreeElements globalDependencies = new TreeElementMapping(null); 249 final TreeElements globalDependencies = new TreeElementMapping(null);
250 250
251 final bool enableMinification; 251 final bool enableMinification;
252 final bool enableTypeAssertions; 252 final bool enableTypeAssertions;
253 final bool enableUserAssertions; 253 final bool enableUserAssertions;
254 final bool trustTypeAnnotations;
254 final bool enableConcreteTypeInference; 255 final bool enableConcreteTypeInference;
255 /** 256 /**
256 * The maximum size of a concrete type before it widens to dynamic during 257 * The maximum size of a concrete type before it widens to dynamic during
257 * concrete type inference. 258 * concrete type inference.
258 */ 259 */
259 final int maxConcreteTypeSize; 260 final int maxConcreteTypeSize;
260 final bool analyzeAll; 261 final bool analyzeAll;
261 final bool analyzeOnly; 262 final bool analyzeOnly;
262 /** 263 /**
263 * If true, skip analysis of method bodies and field initializers. Implies 264 * If true, skip analysis of method bodies and field initializers. Implies
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 static const int PHASE_RESOLVING = 1; 432 static const int PHASE_RESOLVING = 1;
432 static const int PHASE_DONE_RESOLVING = 2; 433 static const int PHASE_DONE_RESOLVING = 2;
433 static const int PHASE_COMPILING = 3; 434 static const int PHASE_COMPILING = 3;
434 int phase; 435 int phase;
435 436
436 bool compilationFailed = false; 437 bool compilationFailed = false;
437 438
438 bool hasCrashed = false; 439 bool hasCrashed = false;
439 440
440 Compiler({this.tracer: const Tracer(), 441 Compiler({this.tracer: const Tracer(),
441 this.enableTypeAssertions: false, 442 bool enableTypeAssertions: false,
442 this.enableUserAssertions: false, 443 this.enableUserAssertions: false,
444 bool trustTypeAnnotations: false,
443 this.enableConcreteTypeInference: false, 445 this.enableConcreteTypeInference: false,
444 this.maxConcreteTypeSize: 5, 446 this.maxConcreteTypeSize: 5,
445 this.enableMinification: false, 447 this.enableMinification: false,
446 this.enableNativeLiveTypeAnalysis: false, 448 this.enableNativeLiveTypeAnalysis: false,
447 bool emitJavaScript: true, 449 bool emitJavaScript: true,
448 bool generateSourceMap: true, 450 bool generateSourceMap: true,
449 bool disallowUnsafeEval: false, 451 bool disallowUnsafeEval: false,
450 this.analyzeAll: false, 452 this.analyzeAll: false,
451 bool analyzeOnly: false, 453 bool analyzeOnly: false,
452 bool analyzeSignaturesOnly: false, 454 bool analyzeSignaturesOnly: false,
453 this.rejectDeprecatedFeatures: false, 455 this.rejectDeprecatedFeatures: false,
454 this.checkDeprecationInSdk: false, 456 this.checkDeprecationInSdk: false,
455 this.preserveComments: false, 457 this.preserveComments: false,
456 this.verbose: false, 458 this.verbose: false,
457 this.sourceMapUri: null, 459 this.sourceMapUri: null,
458 this.buildId: "build number could not be determined", 460 this.buildId: "build number could not be determined",
459 outputProvider, 461 outputProvider,
460 List<String> strips: const []}) 462 List<String> strips: const []})
461 : this.analyzeOnly = analyzeOnly || analyzeSignaturesOnly, 463 : this.analyzeOnly = analyzeOnly || analyzeSignaturesOnly,
462 this.analyzeSignaturesOnly = analyzeSignaturesOnly, 464 this.analyzeSignaturesOnly = analyzeSignaturesOnly,
465 this.enableTypeAssertions = enableTypeAssertions,
466 this.trustTypeAnnotations =
kasperl 2013/05/16 13:17:20 Maybe keep the flags separate here, so the inferre
ngeoffray 2013/05/17 14:34:25 Done.
467 enableTypeAssertions || trustTypeAnnotations,
463 this.outputProvider = 468 this.outputProvider =
464 (outputProvider == null) ? NullSink.outputProvider : outputProvider 469 (outputProvider == null) ? NullSink.outputProvider : outputProvider
465 470
466 { 471 {
467 world = new World(this); 472 world = new World(this);
468 473
469 closureMapping.ClosureNamer closureNamer; 474 closureMapping.ClosureNamer closureNamer;
470 if (emitJavaScript) { 475 if (emitJavaScript) {
471 js_backend.JavaScriptBackend jsBackend = 476 js_backend.JavaScriptBackend jsBackend =
472 new js_backend.JavaScriptBackend(this, generateSourceMap, 477 new js_backend.JavaScriptBackend(this, generateSourceMap,
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after
1331 1336
1332 void close() {} 1337 void close() {}
1333 1338
1334 toString() => name; 1339 toString() => name;
1335 1340
1336 /// Convenience method for getting an [api.CompilerOutputProvider]. 1341 /// Convenience method for getting an [api.CompilerOutputProvider].
1337 static NullSink outputProvider(String name, String extension) { 1342 static NullSink outputProvider(String name, String extension) {
1338 return new NullSink('$name.$extension'); 1343 return new NullSink('$name.$extension');
1339 } 1344 }
1340 } 1345 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698