diff src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp @ 5903:da4be62fb889

7147740: add assertions to check stack alignment on VM entry from generated code (x64) Summary: check stack alignment on VM entry on x64. Reviewed-by: kvn, never
author roland
date Mon, 27 Feb 2012 09:17:44 +0100
parents 1d1603768966
children bf2edd3c9b0f
line wrap: on
line diff
--- a/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp	Fri Feb 24 12:33:31 2012 -0800
+++ b/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp	Mon Feb 27 09:17:44 2012 +0100
@@ -237,6 +237,12 @@
   return frame(fr->sender_sp(), fr->link(), fr->sender_pc());
 }
 
+extern "C" intptr_t *_get_current_sp();  // in .il file
+
+address os::current_stack_pointer() {
+  return (address)_get_current_sp();
+}
+
 extern "C" intptr_t *_get_current_fp();  // in .il file
 
 frame os::current_frame() {
@@ -954,3 +960,11 @@
   _solaris_raw_setup_fpu(fpu_cntrl);
 }
 #endif // AMD64
+
+#ifndef PRODUCT
+void os::verify_stack_alignment() {
+#ifdef AMD64
+  assert(((intptr_t)os::current_stack_pointer() & (StackAlignmentInBytes-1)) == 0, "incorrect stack alignment");
+#endif
+}
+#endif