Chromium Code Reviews| Index: runtime/vm/stack_frame.cc |
| diff --git a/runtime/vm/stack_frame.cc b/runtime/vm/stack_frame.cc |
| index 500e1ea10dad9f21a87330456c72ce8b63eeab14..c5efe99b3a725a102d436905c84a87940d420ddb 100644 |
| --- a/runtime/vm/stack_frame.cc |
| +++ b/runtime/vm/stack_frame.cc |
| @@ -257,6 +257,14 @@ bool StackFrame::FindExceptionHandler(Thread* thread, |
| if (code.IsNull()) { |
| return false; // Stub frames do not have exception handlers. |
| } |
| + HandlerInfoCache* cache = thread->isolate()->handler_info_cache(); |
| + HandlerInfo* p = cache->Lookup(pc()); |
|
Florian Schneider
2017/02/09 19:25:56
Rename p to info for readability.
Dmitry Olshansky
2017/02/10 16:32:15
Done.
|
| + if (p) { |
|
Florian Schneider
2017/02/09 19:25:56
Style: use (p != NULL)
Dmitry Olshansky
2017/02/10 16:32:15
Done.
|
| + *handler_pc = code.PayloadStart() + p->handler_pc_offset; |
| + *needs_stacktrace = p->needs_stacktrace; |
| + *has_catch_all = p->has_catch_all; |
| + return true; |
| + } |
| uword pc_offset = pc() - code.PayloadStart(); |
| REUSABLE_EXCEPTION_HANDLERS_HANDLESCOPE(thread); |
| @@ -274,11 +282,12 @@ bool StackFrame::FindExceptionHandler(Thread* thread, |
| while (iter.MoveNext()) { |
| const intptr_t current_try_index = iter.TryIndex(); |
| if ((iter.PcOffset() == pc_offset) && (current_try_index != -1)) { |
| - RawExceptionHandlers::HandlerInfo handler_info; |
| + HandlerInfo handler_info; |
| handlers.GetHandlerInfo(current_try_index, &handler_info); |
| *handler_pc = code.PayloadStart() + handler_info.handler_pc_offset; |
| *needs_stacktrace = handler_info.needs_stacktrace; |
| *has_catch_all = handler_info.has_catch_all; |
| + cache->Insert(pc(), handler_info); |
| return true; |
| } |
| } |