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

Unified Diff: runtime/vm/stub_code_arm.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
Index: runtime/vm/stub_code_arm.cc
diff --git a/runtime/vm/stub_code_arm.cc b/runtime/vm/stub_code_arm.cc
index 3dbd41b90bc391519dc79c163357dd5a2455f796..e29b0d5cc9104f8665760d6569709062cc104aea 100644
--- a/runtime/vm/stub_code_arm.cc
+++ b/runtime/vm/stub_code_arm.cc
@@ -1685,7 +1685,8 @@ void StubCode::GenerateGetStackPointerStub(Assembler* assembler) {
// R1: stack_pointer.
// R2: frame_pointer.
// R3: error object.
-// SP: address of stacktrace object.
+// SP + 0: address of stacktrace object.
+// SP + 4: isolate
// Does not return.
void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) {
ASSERT(kExceptionObjectReg == R0);
@@ -1694,8 +1695,15 @@ void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) {
__ mov(LR, Operand(R0)); // Program counter.
__ mov(R0, Operand(R3)); // Exception object.
__ ldr(R1, Address(SP, 0)); // StackTrace object.
+ __ ldr(CTX, Address(SP, 4)); // Isolate.
regis 2014/07/14 20:00:34 Are you sure it is OK to trash the CTX register? I
Cutch 2014/07/14 21:32:07 Done.
__ mov(FP, Operand(R2)); // Frame_pointer.
__ mov(SP, Operand(IP)); // Stack pointer.
+ // Set the tag.
+ __ LoadImmediate(R2, VMTag::kScriptTagId);
+ __ StoreToOffset(kWord, R2, CTX, Isolate::vm_tag_offset());
+ // Clear top exit frame.
+ __ LoadImmediate(R2, 0);
+ __ StoreToOffset(kWord, R2, CTX, Isolate::top_exit_frame_info_offset());
__ bx(LR); // Jump to the exception handler code.
}

Powered by Google App Engine
This is Rietveld 408576698