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

Unified Diff: runtime/vm/exceptions.cc

Issue 341083002: Use Dart stack walker when we have an exit frame. (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 | « no previous file | runtime/vm/profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/exceptions.cc
diff --git a/runtime/vm/exceptions.cc b/runtime/vm/exceptions.cc
index f927af1c47f55381174a1ac46bd90eebaec0440c..1c94406995e3c84069366db7c72dd99a04c347a5 100644
--- a/runtime/vm/exceptions.cc
+++ b/runtime/vm/exceptions.cc
@@ -280,6 +280,14 @@ static void JumpToExceptionHandler(Isolate* isolate,
RawObject* raw_exception = exception_object.raw();
RawObject* raw_stacktrace = stacktrace_object.raw();
+ // The following three operations are part of the 'epilogue' of the
+ // CallToRuntime, CallBootstrapCFunction, and CallNativeCFunction stubs.
+ // In the case of an exception, we skip the epilogues and must set the
+ // correct state here.
+ isolate->set_vm_tag(VMTag::kScriptTagId);
+ isolate->set_top_exit_frame_info(0);
+ isolate->set_top_context(Context::null());
+
#if defined(USING_SIMULATOR)
// Unwinding of the C++ frames and destroying of their stack resources is done
// by the simulator, because the target stack_pointer is a simulated stack
@@ -288,8 +296,7 @@ static void JumpToExceptionHandler(Isolate* isolate,
// Continue simulating at the given pc in the given frame after setting up the
// exception object in the kExceptionObjectReg register and the stacktrace
// object (may be raw null) in the kStackTraceObjectReg register.
- isolate->set_vm_tag(VMTag::kScriptTagId);
- isolate->set_top_context(Context::null());
+
Simulator::Current()->Longjmp(program_counter, stack_pointer, frame_pointer,
raw_exception, raw_stacktrace);
#else
@@ -312,8 +319,7 @@ static void JumpToExceptionHandler(Isolate* isolate,
uword current_sp = reinterpret_cast<uword>(&program_counter) - 1024;
__asan_unpoison_memory_region(reinterpret_cast<void*>(current_sp),
stack_pointer - current_sp);
- isolate->set_vm_tag(VMTag::kScriptTagId);
- isolate->set_top_context(Context::null());
+
func(program_counter, stack_pointer, frame_pointer,
raw_exception, raw_stacktrace);
#endif
« no previous file with comments | « no previous file | runtime/vm/profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698