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

Unified Diff: runtime/vm/code_descriptors.h

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/code_descriptors.h
diff --git a/runtime/vm/code_descriptors.h b/runtime/vm/code_descriptors.h
index 2500ed808d9b4ed161494d3145f11a6a204cbb63..5a1528e174c0317a8659752016f9827bb46d4181 100644
--- a/runtime/vm/code_descriptors.h
+++ b/runtime/vm/code_descriptors.h
@@ -74,6 +74,8 @@ class ExceptionHandlerList : public ZoneAllocated {
struct HandlerDesc {
intptr_t outer_try_index; // Try block in which this try block is nested.
intptr_t pc_offset; // Handler PC offset value.
+ TokenPosition token_pos; // Token position of handler.
+ bool is_generated; // False if this is directly from Dart code.
const Array* handler_types; // Catch clause guards.
bool needs_stacktrace;
};
@@ -86,6 +88,8 @@ class ExceptionHandlerList : public ZoneAllocated {
struct HandlerDesc data;
data.outer_try_index = -1;
data.pc_offset = ExceptionHandlers::kInvalidPcOffset;
+ data.token_pos = TokenPosition::kNoSource;
+ data.is_generated = true;
data.handler_types = NULL;
data.needs_stacktrace = false;
list_.Add(data);
@@ -94,6 +98,8 @@ class ExceptionHandlerList : public ZoneAllocated {
void AddHandler(intptr_t try_index,
intptr_t outer_try_index,
intptr_t pc_offset,
+ TokenPosition token_pos,
+ bool is_generated,
const Array& handler_types,
bool needs_stacktrace) {
ASSERT(try_index >= 0);
@@ -103,6 +109,8 @@ class ExceptionHandlerList : public ZoneAllocated {
list_[try_index].outer_try_index = outer_try_index;
ASSERT(list_[try_index].pc_offset == ExceptionHandlers::kInvalidPcOffset);
list_[try_index].pc_offset = pc_offset;
+ list_[try_index].token_pos = token_pos;
+ list_[try_index].is_generated = is_generated;
ASSERT(handler_types.IsZoneHandle());
list_[try_index].handler_types = &handler_types;
list_[try_index].needs_stacktrace |= needs_stacktrace;

Powered by Google App Engine
This is Rietveld 408576698