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

Unified Diff: runtime/vm/code_descriptors.h

Issue 11883023: Collect debugging info for catch clauses (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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
« no previous file with comments | « runtime/vm/ast.h ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_descriptors.h
===================================================================
--- runtime/vm/code_descriptors.h (revision 17099)
+++ runtime/vm/code_descriptors.h (working copy)
@@ -98,8 +98,10 @@
class ExceptionHandlerList : public ZoneAllocated {
public:
struct HandlerDesc {
- intptr_t try_index; // Try block index handled by the handler.
- intptr_t pc_offset; // Handler PC offset value.
+ intptr_t try_index; // Try block index handled by the handler.
+ intptr_t outer_try_index; // Try block in which this try block is nested.
+ intptr_t pc_offset; // Handler PC offset value.
+ const Array* handler_types; // Catch clause guards.
};
ExceptionHandlerList() : list_() {}
@@ -111,17 +113,29 @@
intptr_t TryIndex(int index) const {
return list_[index].try_index;
}
+ intptr_t OuterTryIndex(int index) const {
+ return list_[index].outer_try_index;
+ }
intptr_t PcOffset(int index) const {
return list_[index].pc_offset;
}
+ const Array& HandlerTypes(int index) const {
+ return *list_[index].handler_types;
+ }
void SetPcOffset(int index, intptr_t handler_pc) {
list_[index].pc_offset = handler_pc;
}
- void AddHandler(intptr_t try_index, intptr_t pc_offset) {
+ void AddHandler(intptr_t try_index,
+ intptr_t outer_try_index,
+ intptr_t pc_offset,
+ const Array& handler_types) {
struct HandlerDesc data;
data.try_index = try_index;
+ data.outer_try_index = outer_try_index;
data.pc_offset = pc_offset;
+ ASSERT(handler_types.IsZoneHandle());
+ data.handler_types = &handler_types;
list_.Add(data);
}
@@ -130,7 +144,9 @@
const ExceptionHandlers& handlers =
ExceptionHandlers::Handle(ExceptionHandlers::New(num_handlers));
for (intptr_t i = 0; i < num_handlers; i++) {
- handlers.SetHandlerEntry(i, TryIndex(i), (entry_point + PcOffset(i)));
+ handlers.SetHandlerInfo(i, TryIndex(i), OuterTryIndex(i),
+ (entry_point + PcOffset(i)));
+ handlers.SetHandledTypes(i, HandlerTypes(i));
}
return handlers.raw();
}
« no previous file with comments | « runtime/vm/ast.h ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698