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

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

Issue 15764003: Add Zone support for Timers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload Created 7 years, 6 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 | « runtime/lib/timer_patch.dart ('k') | sdk/lib/_internal/lib/async_patch.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 part of dart2js; 5 part of dart2js;
6 6
7 class EnqueueTask extends CompilerTask { 7 class EnqueueTask extends CompilerTask {
8 final ResolutionEnqueuer resolution; 8 final ResolutionEnqueuer resolution;
9 final CodegenEnqueuer codegen; 9 final CodegenEnqueuer codegen;
10 10
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 queue.add(new ResolutionWorkItem(element, itemCompilationContextCreator())); 632 queue.add(new ResolutionWorkItem(element, itemCompilationContextCreator()));
633 633
634 // Enable isolate support if we start using something from the 634 // Enable isolate support if we start using something from the
635 // isolate library, or timers for the async library. 635 // isolate library, or timers for the async library.
636 LibraryElement library = element.getLibrary(); 636 LibraryElement library = element.getLibrary();
637 if (!compiler.hasIsolateSupport()) { 637 if (!compiler.hasIsolateSupport()) {
638 String uri = library.canonicalUri.toString(); 638 String uri = library.canonicalUri.toString();
639 if (uri == 'dart:isolate') { 639 if (uri == 'dart:isolate') {
640 enableIsolateSupport(library); 640 enableIsolateSupport(library);
641 } else if (uri == 'dart:async') { 641 } else if (uri == 'dart:async') {
642 ClassElement cls = element.getEnclosingClass(); 642 if (element.name == const SourceString('_createTimer') ||
643 if (cls != null && cls.name == const SourceString('Timer')) { 643 element.name == const SourceString('_createPeriodicTimer')) {
644 // The [:Timer:] class uses the event queue of the isolate 644 // The [:Timer:] class uses the event queue of the isolate
645 // library, so we make sure that event queue is generated. 645 // library, so we make sure that event queue is generated.
646 enableIsolateSupport(library); 646 enableIsolateSupport(library);
647 } 647 }
648 } 648 }
649 } 649 }
650 650
651 if (element.isGetter() && element.name == Compiler.RUNTIME_TYPE) { 651 if (element.isGetter() && element.name == Compiler.RUNTIME_TYPE) {
652 // Enable runtime type support if we discover a getter called runtimeType. 652 // Enable runtime type support if we discover a getter called runtimeType.
653 // We have to enable runtime type before hitting the codegen, so 653 // We have to enable runtime type before hitting the codegen, so
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 while(!queue.isEmpty) { 759 while(!queue.isEmpty) {
760 // TODO(johnniwinther): Find an optimal process order for codegen. 760 // TODO(johnniwinther): Find an optimal process order for codegen.
761 f(queue.removeLast()); 761 f(queue.removeLast());
762 } 762 }
763 } 763 }
764 764
765 void _logSpecificSummary(log(message)) { 765 void _logSpecificSummary(log(message)) {
766 log('Compiled ${generatedCode.length} methods.'); 766 log('Compiled ${generatedCode.length} methods.');
767 } 767 }
768 } 768 }
OLDNEW
« no previous file with comments | « runtime/lib/timer_patch.dart ('k') | sdk/lib/_internal/lib/async_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698