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

Unified Diff: runtime/vm/exceptions.cc

Issue 396463003: Move some isolate state setup from C++ code to JumpToExceptionHandler stub (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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/simulator_arm.h » ('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 c8808dde56df204ff1622669897626967d14c669..2e95096f379fde2990eb6dd3f79cea7a6c4330bb 100644
--- a/runtime/vm/exceptions.cc
+++ b/runtime/vm/exceptions.cc
@@ -280,12 +280,11 @@ 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);
+ // The following operation is 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.
+ // The other operations performed as part of the 'epilogue' are handled
+ // by the simulator's Longjmp or the JumpToExceptionHandler stub.
isolate->set_top_context(Context::null());
#if defined(USING_SIMULATOR)
@@ -298,7 +297,7 @@ static void JumpToExceptionHandler(Isolate* isolate,
// object (may be raw null) in the kStackTraceObjectReg register.
Simulator::Current()->Longjmp(program_counter, stack_pointer, frame_pointer,
- raw_exception, raw_stacktrace);
+ raw_exception, raw_stacktrace, isolate);
#else
// Prepare for unwinding frames by destroying all the stack resources
// in the previous frames.
@@ -311,7 +310,8 @@ static void JumpToExceptionHandler(Isolate* isolate,
// Call a stub to set up the exception object in kExceptionObjectReg,
// to set up the stacktrace object in kStackTraceObjectReg, and to
// continue execution at the given pc in the given frame.
- typedef void (*ExcpHandler)(uword, uword, uword, RawObject*, RawObject*);
+ typedef void (*ExcpHandler)(uword, uword, uword, RawObject*, RawObject*,
+ Isolate*);
ExcpHandler func = reinterpret_cast<ExcpHandler>(
StubCode::JumpToExceptionHandlerEntryPoint());
@@ -321,7 +321,7 @@ static void JumpToExceptionHandler(Isolate* isolate,
stack_pointer - current_sp);
func(program_counter, stack_pointer, frame_pointer,
- raw_exception, raw_stacktrace);
+ raw_exception, raw_stacktrace, isolate);
#endif
UNREACHABLE();
}
« no previous file with comments | « no previous file | runtime/vm/simulator_arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698