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

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

Issue 10911006: Collect the types used in is-checks in the resolver phase. (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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 352
353 addForeignFunctions(jsHelperLibrary); 353 addForeignFunctions(jsHelperLibrary);
354 addForeignFunctions(interceptorsLibrary); 354 addForeignFunctions(interceptorsLibrary);
355 355
356 libraries['dart:core'] = coreLibrary; 356 libraries['dart:core'] = coreLibrary;
357 libraries['dart:coreimpl'] = coreImplLibrary; 357 libraries['dart:coreimpl'] = coreImplLibrary;
358 358
359 assertMethod = coreLibrary.find(const SourceString('assert')); 359 assertMethod = coreLibrary.find(const SourceString('assert'));
360 360
361 initializeSpecialClasses(); 361 initializeSpecialClasses();
362
363 //patchDartLibrary(coreLibrary, 'core');
364 //patchDartLibrary(coreImplLibrary, 'coreimpl');
365 } 362 }
366 363
367 void importCoreLibrary(LibraryElement library) { 364 void importCoreLibrary(LibraryElement library) {
368 Uri coreUri = new Uri.fromComponents(scheme: 'dart', path: 'core'); 365 Uri coreUri = new Uri.fromComponents(scheme: 'dart', path: 'core');
369 if (coreLibrary === null) { 366 if (coreLibrary === null) {
370 coreLibrary = scanner.loadLibrary(coreUri, null, coreUri); 367 coreLibrary = scanner.loadLibrary(coreUri, null, coreUri);
371 } 368 }
372 scanner.importLibrary(library, 369 scanner.importLibrary(library,
373 coreLibrary, 370 coreLibrary,
374 null, 371 null,
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 phase = PHASE_RESOLVING; 538 phase = PHASE_RESOLVING;
542 backend.enqueueHelpers(enqueuer.resolution); 539 backend.enqueueHelpers(enqueuer.resolution);
543 processQueue(enqueuer.resolution, main); 540 processQueue(enqueuer.resolution, main);
544 log('Resolved ${enqueuer.resolution.resolvedElements.length} elements.'); 541 log('Resolved ${enqueuer.resolution.resolvedElements.length} elements.');
545 542
546 if (compilationFailed) return; 543 if (compilationFailed) return;
547 544
548 log('Inferring types...'); 545 log('Inferring types...');
549 typesTask.onResolutionComplete(); 546 typesTask.onResolutionComplete();
550 547
548 enqueuer.codegen.universe.computeRequiredTypes(
ngeoffray 2012/08/30 13:17:46 Why is that here? The computation should be done o
karlklose 2012/09/05 09:36:01 Done.
549 enqueuer.resolution.universe.isChecks,
550 enqueuer.resolution.universe.instantiatedClasses);
551
551 // TODO(ahe): Remove this line. Eventually, enqueuer.resolution 552 // TODO(ahe): Remove this line. Eventually, enqueuer.resolution
552 // should know this. 553 // should know this.
553 world.populate(this); 554 world.populate(this);
554 555
555 log('Compiling...'); 556 log('Compiling...');
556 phase = PHASE_COMPILING; 557 phase = PHASE_COMPILING;
557 processQueue(enqueuer.codegen, main); 558 processQueue(enqueuer.codegen, main);
558 log("Recompiling ${enqueuer.codegen.recompilationCandidates.length} " 559 log("Recompiling ${enqueuer.codegen.recompilationCandidates.length} "
559 "methods..."); 560 "methods...");
560 phase = PHASE_RECOMPILING; 561 phase = PHASE_RECOMPILING;
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 final endOffset = end.charOffset + end.slowCharCount; 897 final endOffset = end.charOffset + end.slowCharCount;
897 898
898 // [begin] and [end] might be the same for the same empty token. This 899 // [begin] and [end] might be the same for the same empty token. This
899 // happens for instance when scanning '$$'. 900 // happens for instance when scanning '$$'.
900 assert(endOffset >= beginOffset); 901 assert(endOffset >= beginOffset);
901 return f(beginOffset, endOffset); 902 return f(beginOffset, endOffset);
902 } 903 }
903 904
904 String toString() => 'SourceSpan($uri, $begin, $end)'; 905 String toString() => 'SourceSpan($uri, $begin, $end)';
905 } 906 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/enqueue.dart » ('j') | lib/compiler/implementation/js_backend/native_emitter.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698