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

Unified Diff: vm/stub_code_x64.cc

Issue 10664004: Fix issue 1968, replace usage of inline 'asm' constructs in 'stack alignment', 'jump to exception h… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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 | « vm/stub_code_ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/stub_code_x64.cc
===================================================================
--- vm/stub_code_x64.cc (revision 9040)
+++ vm/stub_code_x64.cc (working copy)
@@ -1873,6 +1873,50 @@
GenerateSubtypeNTestCacheStub(assembler, 3);
}
+
+// Return the current stack pointer address, used to stack alignment
+// checks.
+// TOS + 0: return address
+// Result in RAX.
+void StubCode::GenerateGetStackPointerStub(Assembler* assembler) {
+ __ leaq(RAX, Address(RSP, kWordSize));
+ __ ret();
+}
+
+
+// Jump to the exception handler.
+// TOS + 0: return address
+// RDI: program counter
+// RSI: stack pointer
+// RDX: frame_pointer
+// RCX: exception object
+// R8: stacktrace object
+// No Result.
+void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) {
+ ASSERT(kExceptionObjectReg == RAX);
+ ASSERT(kStackTraceObjectReg == RDX);
+ __ movq(RBP, RDX); // target frame pointer.
+ __ movq(kStackTraceObjectReg, R8); // stacktrace object.
+ __ movq(kExceptionObjectReg, RCX); // exception object.
+ __ movq(RSP, RSI); // target stack_pointer.
+ __ jmp(RDI); // Jump to the exception handler code.
+}
+
+
+// Jump to the error handler.
+// TOS + 0: return address
+// RDI: program_counter
+// RSI: stack_pointer
+// RDX: frame_pointer
+// RCX: error object
+// No Result.
+void StubCode::GenerateJumpToErrorHandlerStub(Assembler* assembler) {
+ __ movq(RAX, RCX); // error object.
+ __ movq(RBP, RDX); // target frame_pointer.
+ __ movq(RSP, RSI); // target stack_pointer.
+ __ jmp(RDI); // Jump to the exception handler code.
+}
+
} // namespace dart
#endif // defined TARGET_ARCH_X64
« no previous file with comments | « vm/stub_code_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698