src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp

Print this page
rev 3149 : 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:

@@ -249,10 +249,19 @@
 
 frame os::get_sender_for_C_frame(frame* fr) {
   return frame(fr->sender_sp(), frame::unpatchable, fr->sender_pc());
 }
 
+// Returns an estimate of the current stack pointer. Result must be guaranteed to
+// point into the calling threads stack, and be no lower than the current stack
+// pointer.
+address os::current_stack_pointer() {
+  volatile int dummy;
+  address sp = (address)&dummy + 8;     // %%%% need to confirm if this is right
+  return sp;
+}
+
 frame os::current_frame() {
   intptr_t* sp = StubRoutines::Sparc::flush_callers_register_windows_func()();
   frame myframe(sp, frame::unpatchable,
                 CAST_FROM_FN_PTR(address, os::current_frame));
   if (os::is_first_C_frame(&myframe)) {

@@ -813,5 +822,10 @@
  // For compiler1 the architecture is v8 and frps isn't present in v8
  extern "C"  void _mark_fpu_nosave() {
    __asm__ __volatile__ ("wr %%g0, 0, %%fprs \n\t" : : :);
   }
 #endif //defined(__sparc) && defined(COMPILER2)
+
+#ifndef PRODUCT
+void os::verify_stack_alignment() {
+}
+#endif