hotspot/src/share/vm/runtime/thread.cpp
changeset 46974 2c6c8846e176
parent 46968 9119841280f4
child 47089 27050b653624
equal deleted inserted replaced
46972:3e88de95fccf 46974:2c6c8846e176
  2512 void JavaThread::create_stack_guard_pages() {
  2512 void JavaThread::create_stack_guard_pages() {
  2513   if (!os::uses_stack_guard_pages() || _stack_guard_state != stack_guard_unused) { return; }
  2513   if (!os::uses_stack_guard_pages() || _stack_guard_state != stack_guard_unused) { return; }
  2514   address low_addr = stack_end();
  2514   address low_addr = stack_end();
  2515   size_t len = stack_guard_zone_size();
  2515   size_t len = stack_guard_zone_size();
  2516 
  2516 
       
  2517   assert(is_aligned(low_addr, os::vm_page_size()), "Stack base should be the start of a page");
       
  2518   assert(is_aligned(len, os::vm_page_size()), "Stack size should be a multiple of page size");
       
  2519 
  2517   int must_commit = os::must_commit_stack_guard_pages();
  2520   int must_commit = os::must_commit_stack_guard_pages();
  2518   // warning("Guarding at " PTR_FORMAT " for len " SIZE_FORMAT "\n", low_addr, len);
  2521   // warning("Guarding at " PTR_FORMAT " for len " SIZE_FORMAT "\n", low_addr, len);
  2519 
  2522 
  2520   if (must_commit && !os::create_stack_guard_pages((char *) low_addr, len)) {
  2523   if (must_commit && !os::create_stack_guard_pages((char *) low_addr, len)) {
  2521     log_warning(os, thread)("Attempt to allocate stack guard pages failed.");
  2524     log_warning(os, thread)("Attempt to allocate stack guard pages failed.");