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

Unified Diff: runtime/vm/ast_transformer.cc

Issue 2692803006: Track the 'awaiter return' call stack use it to detect uncaught exceptions in async functions (Closed)
Patch Set: rmacnak review Created 3 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/ast_transformer.cc
diff --git a/runtime/vm/ast_transformer.cc b/runtime/vm/ast_transformer.cc
index af1331c59d3a5299ddc9fbb6779d5b4d1dae300a..7886349a22dc8d7f99ee5d72d4c36de81abe6445 100644
--- a/runtime/vm/ast_transformer.cc
+++ b/runtime/vm/ast_transformer.cc
@@ -136,7 +136,10 @@ void AwaitTransformer::VisitAwaitNode(AwaitNode* node) {
// :await_temp_var_X = <expr>;
// AwaitMarker(kNewContinuationState);
// :result_param = _awaitHelper(
- // :await_temp_var_X, :async_then_callback, :async_catch_error_callback);
+ // :await_temp_var_X,
+ // :async_then_callback,
+ // :async_catch_error_callback,
+ // :async_op);
// return; // (return_type() == kContinuationTarget)
//
// :saved_try_ctx_var = :await_saved_try_ctx_var_y;
@@ -165,7 +168,10 @@ void AwaitTransformer::VisitAwaitNode(AwaitNode* node) {
preamble_->Add(await_marker);
// :result_param = _awaitHelper(
- // :await_temp, :async_then_callback, :async_catch_error_callback)
+ // :await_temp,
+ // :async_then_callback,
+ // :async_catch_error_callback,
+ // :async_op)
const Library& async_lib = Library::Handle(Library::AsyncLibrary());
const Function& async_await_helper = Function::ZoneHandle(
Z, async_lib.LookupFunctionAllowPrivate(Symbols::AsyncAwaitHelper()));
@@ -177,6 +183,7 @@ void AwaitTransformer::VisitAwaitNode(AwaitNode* node) {
new (Z) LoadLocalNode(token_pos, async_then_callback));
async_await_helper_args->Add(
new (Z) LoadLocalNode(token_pos, async_catch_error_callback));
+ async_await_helper_args->Add(new (Z) LoadLocalNode(token_pos, async_op));
StaticCallNode* await_helper_call = new (Z) StaticCallNode(
node->token_pos(), async_await_helper, async_await_helper_args);

Powered by Google App Engine
This is Rietveld 408576698