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

Unified Diff: runtime/vm/stack_frame.cc

Issue 326183002: Pass around the current isolate in exception handling code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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/stack_frame.h ('k') | no next file » | 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 af807f10c40fa1cb8ecd9f5e287795ed0d33031a..45637246dc0d5ea2e03709a905e2fd553ac6a26c 100644
--- a/runtime/vm/stack_frame.cc
+++ b/runtime/vm/stack_frame.cc
@@ -12,6 +12,7 @@
#include "vm/os.h"
#include "vm/parser.h"
#include "vm/raw_object.h"
+#include "vm/reusable_handles.h"
#include "vm/stub_code.h"
#include "vm/visitor.h"
@@ -196,23 +197,28 @@ RawCode* StackFrame::GetCodeObject() const {
}
-bool StackFrame::FindExceptionHandler(uword* handler_pc,
+bool StackFrame::FindExceptionHandler(Isolate* isolate,
+ uword* handler_pc,
bool* needs_stacktrace,
bool* has_catch_all) const {
- Isolate* isolate = Isolate::Current();
- Code& code = Code::Handle(isolate, LookupDartCode());
+ REUSABLE_CODE_HANDLESCOPE(isolate);
+ Code& code = reused_code_handle.Handle();
+ code = LookupDartCode();
if (code.IsNull()) {
return false; // Stub frames do not have exception handlers.
}
- ExceptionHandlers& handlers =
- ExceptionHandlers::Handle(isolate, code.exception_handlers());
+ REUSABLE_EXCEPTION_HANDLERS_HANDLESCOPE(isolate);
+ ExceptionHandlers& handlers = reused_exception_handlers_handle.Handle();
+ handlers = code.exception_handlers();
if (handlers.Length() == 0) {
return false;
}
+
// Find pc descriptor for the current pc.
- const PcDescriptors& descriptors =
- PcDescriptors::Handle(isolate, code.pc_descriptors());
+ REUSABLE_PC_DESCRIPTORS_HANDLESCOPE(isolate);
+ PcDescriptors& descriptors = reused_pc_descriptors_handle.Handle();
+ descriptors = code.pc_descriptors();
const intptr_t len = descriptors.Length();
for (intptr_t i = 0; i < len; i++) {
if ((static_cast<uword>(descriptors.PC(i)) == pc()) &&
« no previous file with comments | « runtime/vm/stack_frame.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698