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

Side by Side Diff: runtime/vm/kernel_to_il.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, 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
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 #include <map> 5 #include <map>
6 #include <set> 6 #include <set>
7 #include <string> 7 #include <string>
8 8
9 #include "vm/kernel_to_il.h" 9 #include "vm/kernel_to_il.h"
10 10
(...skipping 2259 matching lines...) Expand 10 before | Expand all | Expand 10 after
2270 } 2270 }
2271 2271
2272 2272
2273 Fragment FlowGraphBuilder::CatchBlockEntry(const Array& handler_types, 2273 Fragment FlowGraphBuilder::CatchBlockEntry(const Array& handler_types,
2274 intptr_t handler_index) { 2274 intptr_t handler_index) {
2275 ASSERT(CurrentException()->is_captured() == 2275 ASSERT(CurrentException()->is_captured() ==
2276 CurrentStackTrace()->is_captured()); 2276 CurrentStackTrace()->is_captured());
2277 const bool should_restore_closure_context = 2277 const bool should_restore_closure_context =
2278 CurrentException()->is_captured() || CurrentCatchContext()->is_captured(); 2278 CurrentException()->is_captured() || CurrentCatchContext()->is_captured();
2279 CatchBlockEntryInstr* entry = new (Z) CatchBlockEntryInstr( 2279 CatchBlockEntryInstr* entry = new (Z) CatchBlockEntryInstr(
2280 TokenPosition::kNoSource, // Token position of catch block.
2281 false, // Not an artifact of compilation.
2280 AllocateBlockId(), CurrentTryIndex(), graph_entry_, handler_types, 2282 AllocateBlockId(), CurrentTryIndex(), graph_entry_, handler_types,
2281 handler_index, *CurrentException(), *CurrentStackTrace(), 2283 handler_index, *CurrentException(), *CurrentStackTrace(),
2282 /* needs_stacktrace = */ true, H.thread()->GetNextDeoptId(), 2284 /* needs_stacktrace = */ true, H.thread()->GetNextDeoptId(),
2283 should_restore_closure_context); 2285 should_restore_closure_context);
2284 graph_entry_->AddCatchEntry(entry); 2286 graph_entry_->AddCatchEntry(entry);
2285 Fragment instructions(entry); 2287 Fragment instructions(entry);
2286 2288
2287 // :saved_try_context_var can be captured in the context of 2289 // :saved_try_context_var can be captured in the context of
2288 // of the closure, in this case CatchBlockEntryInstr restores 2290 // of the closure, in this case CatchBlockEntryInstr restores
2289 // :current_context_var to point to closure context in the 2291 // :current_context_var to point to closure context in the
(...skipping 4092 matching lines...) Expand 10 before | Expand all | Expand 10 after
6382 thread->clear_sticky_error(); 6384 thread->clear_sticky_error();
6383 return error.raw(); 6385 return error.raw();
6384 } 6386 }
6385 } 6387 }
6386 6388
6387 6389
6388 } // namespace kernel 6390 } // namespace kernel
6389 } // namespace dart 6391 } // namespace dart
6390 6392
6391 #endif // !defined(DART_PRECOMPILED_RUNTIME) 6393 #endif // !defined(DART_PRECOMPILED_RUNTIME)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698