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

Unified Diff: vm/cpu_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/cpu_ia32.cc ('k') | vm/exceptions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/cpu_x64.cc
===================================================================
--- vm/cpu_x64.cc (revision 9040)
+++ vm/cpu_x64.cc (working copy)
@@ -20,91 +20,6 @@
}
-void CPU::JumpToExceptionHandler(uword program_counter,
- uword stack_pointer,
- uword frame_pointer,
- const Instance& exception_object,
- const Instance& stacktrace_object) {
- // The no_gc StackResource is unwound through the tear down of
- // stack resources below.
- NoGCScope no_gc;
- RawInstance* exception = exception_object.raw();
- RawInstance* stacktrace = stacktrace_object.raw();
-
- // Prepare for unwinding frames by destroying all the stack resources
- // in the previous frames.
- Isolate* isolate = Isolate::Current();
- while (isolate->top_resource() != NULL &&
- (reinterpret_cast<uword>(isolate->top_resource()) < stack_pointer)) {
- isolate->top_resource()->~StackResource();
- }
-
- // Set up the appropriate register state and jump to the handler.
- ASSERT(kExceptionObjectReg == RAX);
- ASSERT(kStackTraceObjectReg == RDX);
-#if defined(TARGET_OS_WINDOWS)
- UNIMPLEMENTED();
-#else
- asm volatile("mov %[exception], %%rax;"
- "mov %[stacktrace], %%rdx;"
- "mov %[pc], %%rbx;"
- "mov %[fp], %%rcx;"
- "mov %[sp], %%rdi;"
- "mov %%rcx, %%rbp;"
- "mov %%rdi, %%rsp;"
- "jmp *%%rbx;"
- :
- : [exception] "m" (exception),
- [stacktrace] "m" (stacktrace),
- [pc] "m" (program_counter),
- [sp] "m" (stack_pointer),
- [fp] "m" (frame_pointer));
-#endif
- UNREACHABLE();
-}
-
-
-void CPU::JumpToErrorHandler(
- uword program_counter,
- uword stack_pointer,
- uword frame_pointer,
- const Error& error) {
- // The no_gc StackResource is unwound through the tear down of
- // stack resources below.
- NoGCScope no_gc;
- ASSERT(!error.IsNull());
- RawError* raw_error = error.raw();
-
- // Prepare for unwinding frames by destroying all the stack resources
- // in the previous frames.
- Isolate* isolate = Isolate::Current();
- while (isolate->top_resource() != NULL &&
- (reinterpret_cast<uword>(isolate->top_resource()) < stack_pointer)) {
- isolate->top_resource()->~StackResource();
- }
-
- // Set up the error object as the return value in RAX and continue
- // from the invocation stub.
-#if defined(TARGET_OS_WINDOWS)
- UNIMPLEMENTED();
-#else
- asm volatile("mov %[raw_error], %%rax;"
- "mov %[pc], %%rbx;"
- "mov %[fp], %%rcx;"
- "mov %[sp], %%rdi;"
- "mov %%rcx, %%rbp;"
- "mov %%rdi, %%rsp;"
- "jmp *%%rbx;"
- :
- : [raw_error] "m" (raw_error),
- [pc] "m" (program_counter),
- [sp] "m" (stack_pointer),
- [fp] "m" (frame_pointer));
-#endif
- UNREACHABLE();
-}
-
-
const char* CPU::Id() {
return "x64";
}
« no previous file with comments | « vm/cpu_ia32.cc ('k') | vm/exceptions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698