< prev index next >

src/os/windows/vm/os_windows.cpp

Print this page




4026 
4027   // for debugging float code generation bugs
4028   if (ForceFloatExceptions) {
4029 #ifndef  _WIN64
4030     static long fp_control_word = 0;
4031     __asm { fstcw fp_control_word }
4032     // see Intel PPro Manual, Vol. 2, p 7-16
4033     const long precision = 0x20;
4034     const long underflow = 0x10;
4035     const long overflow  = 0x08;
4036     const long zero_div  = 0x04;
4037     const long denorm    = 0x02;
4038     const long invalid   = 0x01;
4039     fp_control_word |= invalid;
4040     __asm { fldcw fp_control_word }
4041 #endif
4042   }
4043 
4044   // If stack_commit_size is 0, windows will reserve the default size,
4045   // but only commit a small portion of it.
4046   size_t stack_commit_size = round_to(ThreadStackSize*K, os::vm_page_size());
4047   size_t default_reserve_size = os::win32::default_stack_size();
4048   size_t actual_reserve_size = stack_commit_size;
4049   if (stack_commit_size < default_reserve_size) {
4050     // If stack_commit_size == 0, we want this too
4051     actual_reserve_size = default_reserve_size;
4052   }
4053 
4054   // Check minimum allowable stack size for thread creation and to initialize
4055   // the java system classes, including StackOverflowError - depends on page
4056   // size.  Add two 4K pages for compiler2 recursion in main thread.
4057   // Add in 4*BytesPerWord 4K pages to account for VM stack during
4058   // class initialization depending on 32 or 64 bit VM.
4059   size_t min_stack_allowed =
4060             (size_t)(JavaThread::stack_guard_zone_size() +
4061                      JavaThread::stack_shadow_zone_size() +
4062                      (4*BytesPerWord COMPILER2_PRESENT(+2)) * 4 * K);
4063 
4064   min_stack_allowed = align_size_up(min_stack_allowed, os::vm_page_size());
4065 
4066   if (actual_reserve_size < min_stack_allowed) {




4026 
4027   // for debugging float code generation bugs
4028   if (ForceFloatExceptions) {
4029 #ifndef  _WIN64
4030     static long fp_control_word = 0;
4031     __asm { fstcw fp_control_word }
4032     // see Intel PPro Manual, Vol. 2, p 7-16
4033     const long precision = 0x20;
4034     const long underflow = 0x10;
4035     const long overflow  = 0x08;
4036     const long zero_div  = 0x04;
4037     const long denorm    = 0x02;
4038     const long invalid   = 0x01;
4039     fp_control_word |= invalid;
4040     __asm { fldcw fp_control_word }
4041 #endif
4042   }
4043 
4044   // If stack_commit_size is 0, windows will reserve the default size,
4045   // but only commit a small portion of it.
4046   size_t stack_commit_size = align_size_up_((size_t)ThreadStackSize * K, (size_t)os::vm_page_size());
4047   size_t default_reserve_size = os::win32::default_stack_size();
4048   size_t actual_reserve_size = stack_commit_size;
4049   if (stack_commit_size < default_reserve_size) {
4050     // If stack_commit_size == 0, we want this too
4051     actual_reserve_size = default_reserve_size;
4052   }
4053 
4054   // Check minimum allowable stack size for thread creation and to initialize
4055   // the java system classes, including StackOverflowError - depends on page
4056   // size.  Add two 4K pages for compiler2 recursion in main thread.
4057   // Add in 4*BytesPerWord 4K pages to account for VM stack during
4058   // class initialization depending on 32 or 64 bit VM.
4059   size_t min_stack_allowed =
4060             (size_t)(JavaThread::stack_guard_zone_size() +
4061                      JavaThread::stack_shadow_zone_size() +
4062                      (4*BytesPerWord COMPILER2_PRESENT(+2)) * 4 * K);
4063 
4064   min_stack_allowed = align_size_up(min_stack_allowed, os::vm_page_size());
4065 
4066   if (actual_reserve_size < min_stack_allowed) {


< prev index next >