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

Unified Diff: pkg/kernel/lib/transformations/continuation.dart

Issue 2743283002: [kernel] set dartAsyncMarker to Sync for continuations (Closed)
Patch Set: Added comment Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/lib/transformations/continuation.dart
diff --git a/pkg/kernel/lib/transformations/continuation.dart b/pkg/kernel/lib/transformations/continuation.dart
index a8b28205e7d446a47eaba6eb9ee6be33d804d52d..7f593d17f4efd7aec1278a23b1a6ce42a8f85822 100644
--- a/pkg/kernel/lib/transformations/continuation.dart
+++ b/pkg/kernel/lib/transformations/continuation.dart
@@ -124,11 +124,16 @@ class SyncStarFunctionRewriter extends ContinuationRewriterBase {
// :sync_body(:iterator) {
// modified <node.body>;
// }
+
+ // Note: SyncYielding functions have no Dart equivalent. Since they are
+ // synchronous, we use Sync. (Note also that the Dart VM backend uses the
+ // Dart async marker to decide if functions are debuggable.)
final nestedClosureVariable = new VariableDeclaration(":sync_op");
final function = new FunctionNode(buildClosureBody(),
positionalParameters: [iteratorVariable],
requiredParameterCount: 1,
- asyncMarker: AsyncMarker.SyncYielding)
+ asyncMarker: AsyncMarker.SyncYielding,
+ dartAsyncMarker: AsyncMarker.Sync)
..fileOffset = enclosingFunction.fileOffset
..fileEndOffset = enclosingFunction.fileEndOffset
..returnType = helper.coreTypes.boolClass.rawType;
@@ -223,10 +228,15 @@ abstract class AsyncRewriterBase extends ContinuationRewriterBase {
new VariableDeclaration(':exception'),
new VariableDeclaration(':stack_trace'),
];
+
+ // Note: SyncYielding functions have no Dart equivalent. Since they are
+ // synchronous, we use Sync. (Note also that the Dart VM backend uses the
+ // Dart async marker to decide if functions are debuggable.)
final function = new FunctionNode(buildWrappedBody(),
positionalParameters: parameters,
requiredParameterCount: 0,
- asyncMarker: AsyncMarker.SyncYielding)
+ asyncMarker: AsyncMarker.SyncYielding,
+ dartAsyncMarker: AsyncMarker.Sync)
..fileOffset = enclosingFunction.fileOffset
..fileEndOffset = enclosingFunction.fileEndOffset;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698