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

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: port to other architectures 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 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 2242 matching lines...) Expand 10 before | Expand all | Expand 10 after
2253 } 2253 }
2254 2254
2255 2255
2256 Fragment FlowGraphBuilder::CatchBlockEntry(const Array& handler_types, 2256 Fragment FlowGraphBuilder::CatchBlockEntry(const Array& handler_types,
2257 intptr_t handler_index) { 2257 intptr_t handler_index) {
2258 ASSERT(CurrentException()->is_captured() == 2258 ASSERT(CurrentException()->is_captured() ==
2259 CurrentStackTrace()->is_captured()); 2259 CurrentStackTrace()->is_captured());
2260 const bool should_restore_closure_context = 2260 const bool should_restore_closure_context =
2261 CurrentException()->is_captured() || CurrentCatchContext()->is_captured(); 2261 CurrentException()->is_captured() || CurrentCatchContext()->is_captured();
2262 CatchBlockEntryInstr* entry = new (Z) CatchBlockEntryInstr( 2262 CatchBlockEntryInstr* entry = new (Z) CatchBlockEntryInstr(
2263 TokenPosition::kNoSource, // Token position of catch block.
2264 false, // Not an artifact of compilation.
2263 AllocateBlockId(), CurrentTryIndex(), graph_entry_, handler_types, 2265 AllocateBlockId(), CurrentTryIndex(), graph_entry_, handler_types,
2264 handler_index, *CurrentException(), *CurrentStackTrace(), 2266 handler_index, *CurrentException(), *CurrentStackTrace(),
2265 /* needs_stacktrace = */ true, H.thread()->GetNextDeoptId(), 2267 /* needs_stacktrace = */ true, H.thread()->GetNextDeoptId(),
2266 should_restore_closure_context); 2268 should_restore_closure_context);
2267 graph_entry_->AddCatchEntry(entry); 2269 graph_entry_->AddCatchEntry(entry);
2268 Fragment instructions(entry); 2270 Fragment instructions(entry);
2269 2271
2270 // :saved_try_context_var can be captured in the context of 2272 // :saved_try_context_var can be captured in the context of
2271 // of the closure, in this case CatchBlockEntryInstr restores 2273 // of the closure, in this case CatchBlockEntryInstr restores
2272 // :current_context_var to point to closure context in the 2274 // :current_context_var to point to closure context in the
(...skipping 4026 matching lines...) Expand 10 before | Expand all | Expand 10 after
6299 thread->clear_sticky_error(); 6301 thread->clear_sticky_error();
6300 return error.raw(); 6302 return error.raw();
6301 } 6303 }
6302 } 6304 }
6303 6305
6304 6306
6305 } // namespace kernel 6307 } // namespace kernel
6306 } // namespace dart 6308 } // namespace dart
6307 6309
6308 #endif // !defined(DART_PRECOMPILED_RUNTIME) 6310 #endif // !defined(DART_PRECOMPILED_RUNTIME)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698