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

Side by Side Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 902783008: The execution of an async* should only be scheduled when the stream is (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 5 years, 10 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 | « pkg/compiler/lib/src/js/rewrite_async.dart ('k') | pkg/compiler/lib/src/ssa/builder.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 js_backend; 5 part of js_backend;
6 6
7 const VERBOSE_OPTIMIZER_HINTS = false; 7 const VERBOSE_OPTIMIZER_HINTS = false;
8 8
9 const bool USE_CPS_IR = const bool.fromEnvironment("USE_CPS_IR"); 9 const bool USE_CPS_IR = const bool.fromEnvironment("USE_CPS_IR");
10 10
(...skipping 1602 matching lines...) Expand 10 before | Expand all | Expand 10 after
1613 Element getYieldSingle() { 1613 Element getYieldSingle() {
1614 ClassElement classElement = findHelper("IterationMarker"); 1614 ClassElement classElement = findHelper("IterationMarker");
1615 classElement.ensureResolved(compiler); 1615 classElement.ensureResolved(compiler);
1616 return classElement.lookupLocalMember("yieldSingle"); 1616 return classElement.lookupLocalMember("yieldSingle");
1617 } 1617 }
1618 1618
1619 Element getStreamHelper() { 1619 Element getStreamHelper() {
1620 return findHelper("streamHelper"); 1620 return findHelper("streamHelper");
1621 } 1621 }
1622 1622
1623 Element getStreamOfController() {
1624 return findHelper("streamOfController");
1625 }
1626
1623 Element getEndOfIteration() { 1627 Element getEndOfIteration() {
1624 ClassElement classElement = findHelper("IterationMarker"); 1628 ClassElement classElement = findHelper("IterationMarker");
1625 classElement.ensureResolved(compiler); 1629 classElement.ensureResolved(compiler);
1626 return classElement.lookupLocalMember("endOfIteration"); 1630 return classElement.lookupLocalMember("endOfIteration");
1627 } 1631 }
1628 1632
1629 Element getSyncStarIterable() { 1633 Element getSyncStarIterable() {
1630 ClassElement classElement = findHelper("SyncStarIterable"); 1634 ClassElement classElement = findHelper("SyncStarIterable");
1631 classElement.ensureResolved(compiler); 1635 classElement.ensureResolved(compiler);
1632 return classElement; 1636 return classElement;
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
2405 enqueue(enqueuer, getCompleterConstructor(), registry); 2409 enqueue(enqueuer, getCompleterConstructor(), registry);
2406 enqueue(enqueuer, getStreamIteratorConstructor(), registry); 2410 enqueue(enqueuer, getStreamIteratorConstructor(), registry);
2407 } else if (element.asyncMarker == AsyncMarker.SYNC_STAR) { 2411 } else if (element.asyncMarker == AsyncMarker.SYNC_STAR) {
2408 enqueuer.registerInstantiatedClass(getSyncStarIterable(), registry); 2412 enqueuer.registerInstantiatedClass(getSyncStarIterable(), registry);
2409 enqueue(enqueuer, getSyncStarIterableConstructor(), registry); 2413 enqueue(enqueuer, getSyncStarIterableConstructor(), registry);
2410 enqueue(enqueuer, getEndOfIteration(), registry); 2414 enqueue(enqueuer, getEndOfIteration(), registry);
2411 enqueue(enqueuer, getYieldStar(), registry); 2415 enqueue(enqueuer, getYieldStar(), registry);
2412 } else if (element.asyncMarker == AsyncMarker.ASYNC_STAR) { 2416 } else if (element.asyncMarker == AsyncMarker.ASYNC_STAR) {
2413 enqueuer.registerInstantiatedClass(getASyncStarController(), registry); 2417 enqueuer.registerInstantiatedClass(getASyncStarController(), registry);
2414 enqueue(enqueuer, getStreamHelper(), registry); 2418 enqueue(enqueuer, getStreamHelper(), registry);
2419 enqueue(enqueuer, getStreamOfController(), registry);
2415 enqueue(enqueuer, getYieldSingle(), registry); 2420 enqueue(enqueuer, getYieldSingle(), registry);
2416 enqueue(enqueuer, getYieldStar(), registry); 2421 enqueue(enqueuer, getYieldStar(), registry);
2417 enqueue(enqueuer, getASyncStarControllerConstructor(), registry); 2422 enqueue(enqueuer, getASyncStarControllerConstructor(), registry);
2418 enqueue(enqueuer, getStreamIteratorConstructor(), registry); 2423 enqueue(enqueuer, getStreamIteratorConstructor(), registry);
2419 } 2424 }
2420 } 2425 }
2421 } 2426 }
2422 2427
2423 /// Handling of special annotations for tests. 2428 /// Handling of special annotations for tests.
2424 class Annotations { 2429 class Annotations {
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
2676 } 2681 }
2677 } 2682 }
2678 2683
2679 /// Records that [constant] is used by the element behind [registry]. 2684 /// Records that [constant] is used by the element behind [registry].
2680 class Dependency { 2685 class Dependency {
2681 final ConstantValue constant; 2686 final ConstantValue constant;
2682 final Element annotatedElement; 2687 final Element annotatedElement;
2683 2688
2684 const Dependency(this.constant, this.annotatedElement); 2689 const Dependency(this.constant, this.annotatedElement);
2685 } 2690 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js/rewrite_async.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698