< prev index next >

src/os_cpu/linux_zero/vm/os_linux_zero.cpp

Print this page
@  rev 8479 : 8087120: [GCC5] java.lang.StackOverflowError on Zero JVM initialization on non x86 platforms.
|  Summary: Use __builtin_frame_address(0) rather than returning address of local variable.
|  Reviewed-by:


  42 #include "runtime/arguments.hpp"
  43 #include "runtime/extendedPC.hpp"
  44 #include "runtime/frame.inline.hpp"
  45 #include "runtime/interfaceSupport.hpp"
  46 #include "runtime/java.hpp"
  47 #include "runtime/javaCalls.hpp"
  48 #include "runtime/mutexLocker.hpp"
  49 #include "runtime/osThread.hpp"
  50 #include "runtime/sharedRuntime.hpp"
  51 #include "runtime/stubRoutines.hpp"
  52 #include "runtime/thread.inline.hpp"
  53 #include "runtime/timer.hpp"
  54 #include "utilities/events.hpp"
  55 #include "utilities/vmError.hpp"
  56 
  57 // See stubGenerator_zero.cpp
  58 #include <setjmp.h>
  59 extern sigjmp_buf* get_jmp_buf_for_continuation();
  60 
  61 address os::current_stack_pointer() {
  62   address dummy = (address) &dummy;
  63   return dummy;
  64 }
  65 
  66 frame os::get_sender_for_C_frame(frame* fr) {
  67   ShouldNotCallThis();
  68 }
  69 
  70 frame os::current_frame() {
  71   // The only thing that calls this is the stack printing code in
  72   // VMError::report:
  73   //   - Step 110 (printing stack bounds) uses the sp in the frame
  74   //     to determine the amount of free space on the stack.  We
  75   //     set the sp to a close approximation of the real value in
  76   //     order to allow this step to complete.
  77   //   - Step 120 (printing native stack) tries to walk the stack.
  78   //     The frame we create has a NULL pc, which is ignored as an
  79   //     invalid frame.
  80   frame dummy = frame();
  81   dummy.set_sp((intptr_t *) current_stack_pointer());
  82   return dummy;
  83 }




  42 #include "runtime/arguments.hpp"
  43 #include "runtime/extendedPC.hpp"
  44 #include "runtime/frame.inline.hpp"
  45 #include "runtime/interfaceSupport.hpp"
  46 #include "runtime/java.hpp"
  47 #include "runtime/javaCalls.hpp"
  48 #include "runtime/mutexLocker.hpp"
  49 #include "runtime/osThread.hpp"
  50 #include "runtime/sharedRuntime.hpp"
  51 #include "runtime/stubRoutines.hpp"
  52 #include "runtime/thread.inline.hpp"
  53 #include "runtime/timer.hpp"
  54 #include "utilities/events.hpp"
  55 #include "utilities/vmError.hpp"
  56 
  57 // See stubGenerator_zero.cpp
  58 #include <setjmp.h>
  59 extern sigjmp_buf* get_jmp_buf_for_continuation();
  60 
  61 address os::current_stack_pointer() {
  62   // return the address of the current function
  63   return (address)__builtin_frame_address(0);
  64 }
  65 
  66 frame os::get_sender_for_C_frame(frame* fr) {
  67   ShouldNotCallThis();
  68 }
  69 
  70 frame os::current_frame() {
  71   // The only thing that calls this is the stack printing code in
  72   // VMError::report:
  73   //   - Step 110 (printing stack bounds) uses the sp in the frame
  74   //     to determine the amount of free space on the stack.  We
  75   //     set the sp to a close approximation of the real value in
  76   //     order to allow this step to complete.
  77   //   - Step 120 (printing native stack) tries to walk the stack.
  78   //     The frame we create has a NULL pc, which is ignored as an
  79   //     invalid frame.
  80   frame dummy = frame();
  81   dummy.set_sp((intptr_t *) current_stack_pointer());
  82   return dummy;
  83 }


< prev index next >