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

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: Fix last upload. 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 364
365 addForeignFunctions(jsHelperLibrary); 365 addForeignFunctions(jsHelperLibrary);
366 addForeignFunctions(interceptorsLibrary); 366 addForeignFunctions(interceptorsLibrary);
367 367
368 libraries['dart:core'] = coreLibrary; 368 libraries['dart:core'] = coreLibrary;
369 libraries['dart:coreimpl'] = coreImplLibrary; 369 libraries['dart:coreimpl'] = coreImplLibrary;
370 370
371 assertMethod = coreLibrary.find(const SourceString('assert')); 371 assertMethod = coreLibrary.find(const SourceString('assert'));
372 372
373 initializeSpecialClasses(); 373 initializeSpecialClasses();
374
375 //patchDartLibrary(coreLibrary, 'core');
376 //patchDartLibrary(coreImplLibrary, 'coreimpl');
377 } 374 }
378 375
379 void importCoreLibrary(LibraryElement library) { 376 void importCoreLibrary(LibraryElement library) {
380 Uri coreUri = new Uri.fromComponents(scheme: 'dart', path: 'core'); 377 Uri coreUri = new Uri.fromComponents(scheme: 'dart', path: 'core');
381 if (coreLibrary === null) { 378 if (coreLibrary === null) {
382 coreLibrary = scanner.loadLibrary(coreUri, null, coreUri); 379 coreLibrary = scanner.loadLibrary(coreUri, null, coreUri);
383 } 380 }
384 scanner.importLibrary(library, 381 scanner.importLibrary(library,
385 coreLibrary, 382 coreLibrary,
386 null, 383 null,
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 phase = PHASE_COMPILING; 566 phase = PHASE_COMPILING;
570 processQueue(enqueuer.codegen, main); 567 processQueue(enqueuer.codegen, main);
571 log("Recompiling ${enqueuer.codegen.recompilationCandidates.length} " 568 log("Recompiling ${enqueuer.codegen.recompilationCandidates.length} "
572 "methods..."); 569 "methods...");
573 phase = PHASE_RECOMPILING; 570 phase = PHASE_RECOMPILING;
574 processRecompilationQueue(enqueuer.codegen); 571 processRecompilationQueue(enqueuer.codegen);
575 log('Compiled ${codegenWorld.generatedCode.length} methods.'); 572 log('Compiled ${codegenWorld.generatedCode.length} methods.');
576 573
577 if (compilationFailed) return; 574 if (compilationFailed) return;
578 575
576 // TODO(karlklose): also take the instantiated types into account and move
577 // this computation to before codegen.
578 enqueuer.codegen.universe.computeRequiredTypes(
579 enqueuer.resolution.universe.isChecks);
580
579 backend.assembleProgram(); 581 backend.assembleProgram();
580 582
581 checkQueues(); 583 checkQueues();
582 } 584 }
583 585
584 void processQueue(Enqueuer world, Element main) { 586 void processQueue(Enqueuer world, Element main) {
585 backend.processNativeClasses(world, libraries.getValues()); 587 backend.processNativeClasses(world, libraries.getValues());
586 world.addToWorkList(main); 588 world.addToWorkList(main);
587 progress.reset(); 589 progress.reset();
588 world.forEach((WorkItem work) { 590 world.forEach((WorkItem work) {
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 final endOffset = end.charOffset + end.slowCharCount; 919 final endOffset = end.charOffset + end.slowCharCount;
918 920
919 // [begin] and [end] might be the same for the same empty token. This 921 // [begin] and [end] might be the same for the same empty token. This
920 // happens for instance when scanning '$$'. 922 // happens for instance when scanning '$$'.
921 assert(endOffset >= beginOffset); 923 assert(endOffset >= beginOffset);
922 return f(beginOffset, endOffset); 924 return f(beginOffset, endOffset);
923 } 925 }
924 926
925 String toString() => 'SourceSpan($uri, $begin, $end)'; 927 String toString() => 'SourceSpan($uri, $begin, $end)';
926 } 928 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/enqueue.dart » ('j') | lib/compiler/implementation/resolver.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698