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

Unified Diff: runtime/vm/stack_frame.cc

Issue 2683633005: Add exception handler cache to isolate (Closed)
Patch Set: s/HandlerInfo/ExceptionHandlerInfo 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
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/vm_sources.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stack_frame.cc
diff --git a/runtime/vm/stack_frame.cc b/runtime/vm/stack_frame.cc
index 500e1ea10dad9f21a87330456c72ce8b63eeab14..c84811a8cb1f1711070e2c5255b9bea18d9750aa 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();
+ ExceptionHandlerInfo* info = cache->Lookup(pc());
+ if (info != NULL) {
+ *handler_pc = code.PayloadStart() + info->handler_pc_offset;
+ *needs_stacktrace = info->needs_stacktrace;
+ *has_catch_all = info->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;
+ ExceptionHandlerInfo 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;
}
}
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/vm_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698