hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
changeset 35201 996db89f378e
parent 35077 8b86440d3bf1
child 37430 fd743dadef12
--- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Fri Dec 18 13:38:49 2015 +0000
+++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Sun Dec 20 10:37:23 2015 -0500
@@ -346,10 +346,9 @@
       address addr = (address) info->si_addr;
 
       // check if fault address is within thread stack
-      if (addr < thread->stack_base() &&
-          addr >= thread->stack_base() - thread->stack_size()) {
+      if (thread->on_local_stack(addr)) {
         // stack overflow
-        if (thread->in_stack_yellow_zone(addr)) {
+        if (thread->in_stack_yellow_reserved_zone(addr)) {
           if (thread->thread_state() == _thread_in_Java) {
             if (thread->in_stack_reserved_zone(addr)) {
               frame fr;
@@ -371,11 +370,11 @@
             }
             // Throw a stack overflow exception.  Guard pages will be reenabled
             // while unwinding the stack.
-            thread->disable_stack_yellow_zone();
+            thread->disable_stack_yellow_reserved_zone();
             stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW);
           } else {
             // Thread was in the vm or native code.  Return and try to finish.
-            thread->disable_stack_yellow_zone();
+            thread->disable_stack_yellow_reserved_zone();
             return 1;
           }
         } else if (thread->in_stack_red_zone(addr)) {
@@ -931,10 +930,10 @@
    * If we are embedded in an app other than launcher (initial != main stack),
    * we don't have much control or understanding of the address space, just let it slide.
    */
-  char* hint = (char*) (Linux::initial_thread_stack_bottom() -
-                        ((StackReservedPages + StackYellowPages + StackRedPages + 1) * page_size));
+  char* hint = (char*)(Linux::initial_thread_stack_bottom() -
+                       (JavaThread::stack_guard_zone_size() + page_size));
   char* codebuf = os::attempt_reserve_memory_at(page_size, hint);
-  if ( (codebuf == NULL) || (!os::commit_memory(codebuf, page_size, true)) ) {
+  if ((codebuf == NULL) || (!os::commit_memory(codebuf, page_size, true))) {
     return; // No matter, we tried, best effort.
   }