3894 &main_thread, THREAD_ALL_ACCESS, false, 0)) {
3895 fatal("DuplicateHandle failed\n");
3896 }
3897 main_thread_id = (int) GetCurrentThreadId();
3898
3899 // initialize fast thread access - only used for 32-bit
3900 win32::initialize_thread_ptr_offset();
3901 }
3902
3903 // To install functions for atexit processing
3904 extern "C" {
3905 static void perfMemory_exit_helper() {
3906 perfMemory_exit();
3907 }
3908 }
3909
3910 static jint initSock();
3911
3912 // this is called _after_ the global arguments have been parsed
3913 jint os::init_2(void) {
3914 // Allocate a single page and mark it as readable for safepoint polling
3915 address polling_page = (address)VirtualAlloc(NULL, os::vm_page_size(), MEM_RESERVE, PAGE_READONLY);
3916 guarantee(polling_page != NULL, "Reserve Failed for polling page");
3917
3918 address return_page = (address)VirtualAlloc(polling_page, os::vm_page_size(), MEM_COMMIT, PAGE_READONLY);
3919 guarantee(return_page != NULL, "Commit Failed for polling page");
3920
3921 os::set_polling_page(polling_page);
3922 log_info(os)("SafePoint Polling address: " INTPTR_FORMAT, p2i(polling_page));
3923
3924 if (!UseMembar) {
3925 address mem_serialize_page = (address)VirtualAlloc(NULL, os::vm_page_size(), MEM_RESERVE, PAGE_READWRITE);
3926 guarantee(mem_serialize_page != NULL, "Reserve Failed for memory serialize page");
3927
3928 return_page = (address)VirtualAlloc(mem_serialize_page, os::vm_page_size(), MEM_COMMIT, PAGE_READWRITE);
3929 guarantee(return_page != NULL, "Commit Failed for memory serialize page");
3930
3931 os::set_memory_serialize_page(mem_serialize_page);
3932 log_info(os)("Memory Serialize Page address: " INTPTR_FORMAT, p2i(mem_serialize_page));
3933 }
3934
3935 // Setup Windows Exceptions
3936
3937 // for debugging float code generation bugs
3938 if (ForceFloatExceptions) {
3939 #ifndef _WIN64
3940 static long fp_control_word = 0;
3941 __asm { fstcw fp_control_word }
3942 // see Intel PPro Manual, Vol. 2, p 7-16
3943 const long precision = 0x20;
3944 const long underflow = 0x10;
3945 const long overflow = 0x08;
3946 const long zero_div = 0x04;
3947 const long denorm = 0x02;
3948 const long invalid = 0x01;
3949 fp_control_word |= invalid;
3950 __asm { fldcw fp_control_word }
3951 #endif
3952 }
3953
3954 // If stack_commit_size is 0, windows will reserve the default size,
|
3894 &main_thread, THREAD_ALL_ACCESS, false, 0)) {
3895 fatal("DuplicateHandle failed\n");
3896 }
3897 main_thread_id = (int) GetCurrentThreadId();
3898
3899 // initialize fast thread access - only used for 32-bit
3900 win32::initialize_thread_ptr_offset();
3901 }
3902
3903 // To install functions for atexit processing
3904 extern "C" {
3905 static void perfMemory_exit_helper() {
3906 perfMemory_exit();
3907 }
3908 }
3909
3910 static jint initSock();
3911
3912 // this is called _after_ the global arguments have been parsed
3913 jint os::init_2(void) {
3914 // Setup Windows Exceptions
3915
3916 // for debugging float code generation bugs
3917 if (ForceFloatExceptions) {
3918 #ifndef _WIN64
3919 static long fp_control_word = 0;
3920 __asm { fstcw fp_control_word }
3921 // see Intel PPro Manual, Vol. 2, p 7-16
3922 const long precision = 0x20;
3923 const long underflow = 0x10;
3924 const long overflow = 0x08;
3925 const long zero_div = 0x04;
3926 const long denorm = 0x02;
3927 const long invalid = 0x01;
3928 fp_control_word |= invalid;
3929 __asm { fldcw fp_control_word }
3930 #endif
3931 }
3932
3933 // If stack_commit_size is 0, windows will reserve the default size,
|