src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp

Print this page
rev 7023 : 8058345: Refactor native stack printing from vmError.cpp to debug.cpp to make it available in gdb as well
Summary: Also fix stack trace on x86 to enable walking of runtime stubs and native wrappers


 248 
 249 frame os::get_sender_for_C_frame(frame* fr) {
 250   return frame(fr->sender_sp(), frame::unpatchable, fr->sender_pc());
 251 }
 252 
 253 // Returns an estimate of the current stack pointer. Result must be guaranteed to
 254 // point into the calling threads stack, and be no lower than the current stack
 255 // pointer.
 256 address os::current_stack_pointer() {
 257   volatile int dummy;
 258   address sp = (address)&dummy + 8;     // %%%% need to confirm if this is right
 259   return sp;
 260 }
 261 
 262 frame os::current_frame() {
 263   intptr_t* sp = StubRoutines::Sparc::flush_callers_register_windows_func()();
 264   frame myframe(sp, frame::unpatchable,
 265                 CAST_FROM_FN_PTR(address, os::current_frame));
 266   if (os::is_first_C_frame(&myframe)) {
 267     // stack is not walkable
 268     return frame(NULL, NULL, NULL);
 269   } else {
 270     return os::get_sender_for_C_frame(&myframe);
 271   }
 272 }
 273 
 274 bool os::is_allocatable(size_t bytes) {
 275 #ifdef _LP64
 276    return true;
 277 #else
 278    return (bytes <= (size_t)3835*M);
 279 #endif
 280 }
 281 
 282 extern "C" JNIEXPORT int
 283 JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid,
 284                           int abort_if_unrecognized) {
 285   ucontext_t* uc = (ucontext_t*) ucVoid;
 286 
 287   Thread* t = ThreadLocalStorage::get_thread_slow();
 288 




 248 
 249 frame os::get_sender_for_C_frame(frame* fr) {
 250   return frame(fr->sender_sp(), frame::unpatchable, fr->sender_pc());
 251 }
 252 
 253 // Returns an estimate of the current stack pointer. Result must be guaranteed to
 254 // point into the calling threads stack, and be no lower than the current stack
 255 // pointer.
 256 address os::current_stack_pointer() {
 257   volatile int dummy;
 258   address sp = (address)&dummy + 8;     // %%%% need to confirm if this is right
 259   return sp;
 260 }
 261 
 262 frame os::current_frame() {
 263   intptr_t* sp = StubRoutines::Sparc::flush_callers_register_windows_func()();
 264   frame myframe(sp, frame::unpatchable,
 265                 CAST_FROM_FN_PTR(address, os::current_frame));
 266   if (os::is_first_C_frame(&myframe)) {
 267     // stack is not walkable
 268     return frame(NULL, NULL, true);
 269   } else {
 270     return os::get_sender_for_C_frame(&myframe);
 271   }
 272 }
 273 
 274 bool os::is_allocatable(size_t bytes) {
 275 #ifdef _LP64
 276    return true;
 277 #else
 278    return (bytes <= (size_t)3835*M);
 279 #endif
 280 }
 281 
 282 extern "C" JNIEXPORT int
 283 JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid,
 284                           int abort_if_unrecognized) {
 285   ucontext_t* uc = (ucontext_t*) ucVoid;
 286 
 287   Thread* t = ThreadLocalStorage::get_thread_slow();
 288