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

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

Issue 79243002: Implement scheduleImmediate for the VM. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add comments and types. Created 7 years, 1 month 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 typedef ItemCompilationContext ItemCompilationContextCreator(); 7 typedef ItemCompilationContext ItemCompilationContextCreator();
8 8
9 class EnqueueTask extends CompilerTask { 9 class EnqueueTask extends CompilerTask {
10 final ResolutionEnqueuer resolution; 10 final ResolutionEnqueuer resolution;
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 queue.add(new ResolutionWorkItem(element, itemCompilationContextCreator())); 627 queue.add(new ResolutionWorkItem(element, itemCompilationContextCreator()));
628 628
629 // Enable isolate support if we start using something from the 629 // Enable isolate support if we start using something from the
630 // isolate library, or timers for the async library. 630 // isolate library, or timers for the async library.
631 LibraryElement library = element.getLibrary(); 631 LibraryElement library = element.getLibrary();
632 if (!compiler.hasIsolateSupport()) { 632 if (!compiler.hasIsolateSupport()) {
633 String uri = library.canonicalUri.toString(); 633 String uri = library.canonicalUri.toString();
634 if (uri == 'dart:isolate') { 634 if (uri == 'dart:isolate') {
635 enableIsolateSupport(library); 635 enableIsolateSupport(library);
636 } else if (uri == 'dart:async') { 636 } else if (uri == 'dart:async') {
637 if (element.name == '_createTimer' || 637 if (element.name == '_createTimer' ||
floitsch 2013/11/21 17:39:47 _createTimer, _createPeriodicTimer and scheduleImm
638 element.name == '_createPeriodicTimer') { 638 element.name == '_createPeriodicTimer') {
639 // The [:Timer:] class uses the event queue of the isolate 639 // The `Timer` class uses the event queue of the isolate
640 // library, so we make sure that event queue is generated. 640 // library, so we make sure that event queue is generated.
641 enableIsolateSupport(library); 641 enableIsolateSupport(library);
642 } 642 }
643 } else if (uri == 'dart:_collection-dev' &&
644 element.name == "scheduleImmediate") {
645 // `scheduleImmediate` class uses the event queue of the isolate
646 // library, so we make sure that event queue is generated.
647 enableIsolateSupport(library);
643 } 648 }
644 } 649 }
645 650
646 if (element.isGetter() && element.name == Compiler.RUNTIME_TYPE) { 651 if (element.isGetter() && element.name == Compiler.RUNTIME_TYPE) {
647 // Enable runtime type support if we discover a getter called runtimeType. 652 // Enable runtime type support if we discover a getter called runtimeType.
648 // We have to enable runtime type before hitting the codegen, so 653 // We have to enable runtime type before hitting the codegen, so
649 // that constructors know whether they need to generate code for 654 // that constructors know whether they need to generate code for
650 // runtime type. 655 // runtime type.
651 compiler.enabledRuntimeType = true; 656 compiler.enabledRuntimeType = true;
652 // TODO(ahe): Record precise dependency here. 657 // TODO(ahe): Record precise dependency here.
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 } 755 }
751 CodegenWorkItem workItem = new CodegenWorkItem( 756 CodegenWorkItem workItem = new CodegenWorkItem(
752 element, itemCompilationContextCreator()); 757 element, itemCompilationContextCreator());
753 queue.add(workItem); 758 queue.add(workItem);
754 } 759 }
755 760
756 void _logSpecificSummary(log(message)) { 761 void _logSpecificSummary(log(message)) {
757 log('Compiled ${generatedCode.length} methods.'); 762 log('Compiled ${generatedCode.length} methods.');
758 } 763 }
759 } 764 }
OLDNEW
« no previous file with comments | « sdk/lib/_collection_dev/collection_dev_sources.gypi ('k') | sdk/lib/_internal/lib/async_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698