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

Side by Side Diff: pkg/kernel/lib/transformations/async.dart

Issue 2725623003: Reland "Track the 'awaiter return' call stack..." (Closed)
Patch Set: Update the Kernel continuation transformer 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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/lib/async_patch.dart » ('j') | runtime/lib/async_patch.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 library kernel.transformations.async; 5 library kernel.transformations.async;
6 6
7 import '../kernel.dart'; 7 import '../kernel.dart';
8 import 'continuation.dart'; 8 import 'continuation.dart';
9 9
10 /// A transformer that introduces temporary variables for all subexpressions 10 /// A transformer that introduces temporary variables for all subexpressions
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 var shouldName = seenAwait; 410 var shouldName = seenAwait;
411 var result = new VariableGet(asyncResult); 411 var result = new VariableGet(asyncResult);
412 412
413 // The statements are in reverse order, so name the result first if 413 // The statements are in reverse order, so name the result first if
414 // necessary and then add the two other statements in reverse. 414 // necessary and then add the two other statements in reverse.
415 if (shouldName) result = name(result); 415 if (shouldName) result = name(result);
416 statements.add(R.createContinuationPoint()..fileOffset = expr.fileOffset); 416 statements.add(R.createContinuationPoint()..fileOffset = expr.fileOffset);
417 Arguments arguments = new Arguments(<Expression>[ 417 Arguments arguments = new Arguments(<Expression>[
418 expr.operand, 418 expr.operand,
419 new VariableGet(R.thenContinuationVariable), 419 new VariableGet(R.thenContinuationVariable),
420 new VariableGet(R.catchErrorContinuationVariable) 420 new VariableGet(R.catchErrorContinuationVariable),
421 new VariableGet(R.nestedClosureVariable),
421 ]); 422 ]);
422 statements.add(new ExpressionStatement( 423 statements.add(new ExpressionStatement(
423 new StaticInvocation(R.helper.awaitHelper, arguments) 424 new StaticInvocation(R.helper.awaitHelper, arguments)
424 ..fileOffset = expr.fileOffset)); 425 ..fileOffset = expr.fileOffset));
425 426
426 seenAwait = false; 427 seenAwait = false;
427 var index = nameIndex; 428 var index = nameIndex;
428 arguments.positional[0] = expr.operand.accept(this)..parent = arguments; 429 arguments.positional[0] = expr.operand.accept(this)..parent = arguments;
429 430
430 if (shouldName) nameIndex = index + 1; 431 if (shouldName) nameIndex = index + 1;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 }); 482 });
482 } 483 }
483 } 484 }
484 485
485 visitFunctionNode(FunctionNode node) { 486 visitFunctionNode(FunctionNode node) {
486 var nestedRewriter = 487 var nestedRewriter =
487 new RecursiveContinuationRewriter(continuationRewriter.helper); 488 new RecursiveContinuationRewriter(continuationRewriter.helper);
488 return node.accept(nestedRewriter); 489 return node.accept(nestedRewriter);
489 } 490 }
490 } 491 }
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/async_patch.dart » ('j') | runtime/lib/async_patch.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698