80 static bool is_windows_2003() { return _is_windows_2003; } 81 82 // Returns the byte size of a virtual memory page 83 static int vm_page_size() { return _vm_page_size; } 84 85 // Returns the size in bytes of memory blocks which can be allocated. 86 static int vm_allocation_granularity() { return _vm_allocation_granularity; } 87 88 // Read the headers for the executable that started the current process into 89 // the structure passed in (see winnt.h). 90 static void read_executable_headers(PIMAGE_NT_HEADERS); 91 92 // Default stack size for the current process. 93 static size_t default_stack_size() { return _default_stack_size; } 94 95 #ifndef _WIN64 96 // A wrapper to install a structured exception handler for fast JNI accesors. 97 static address fast_jni_accessor_wrapper(BasicType); 98 #endif 99 100 #ifndef PRODUCT 101 static void call_test_func_with_wrapper(void (*funcPtr)(void)); 102 #endif 103 104 // filter function to ignore faults on serializations page 105 static LONG WINAPI serialize_fault_filter(struct _EXCEPTION_POINTERS* e); 106 }; 107 108 /* 109 * Crash protection for the watcher thread. Wrap the callback 110 * with a __try { call() } 111 * To be able to use this - don't take locks, don't rely on destructors, 112 * don't make OS library calls, don't allocate memory, don't print, 113 * don't call code that could leave the heap / memory in an inconsistent state, 114 * or anything else where we are not in control if we suddenly jump out. 115 */ 116 class WatcherThreadCrashProtection : public StackObj { 117 public: 118 WatcherThreadCrashProtection(); 119 bool call(os::CrashProtectionCallback& cb); 120 }; 121 122 class PlatformEvent : public CHeapObj<mtInternal> { | 80 static bool is_windows_2003() { return _is_windows_2003; } 81 82 // Returns the byte size of a virtual memory page 83 static int vm_page_size() { return _vm_page_size; } 84 85 // Returns the size in bytes of memory blocks which can be allocated. 86 static int vm_allocation_granularity() { return _vm_allocation_granularity; } 87 88 // Read the headers for the executable that started the current process into 89 // the structure passed in (see winnt.h). 90 static void read_executable_headers(PIMAGE_NT_HEADERS); 91 92 // Default stack size for the current process. 93 static size_t default_stack_size() { return _default_stack_size; } 94 95 #ifndef _WIN64 96 // A wrapper to install a structured exception handler for fast JNI accesors. 97 static address fast_jni_accessor_wrapper(BasicType); 98 #endif 99 100 static void call_test_func_with_wrapper(void (*funcPtr)(void)); 101 102 // filter function to ignore faults on serializations page 103 static LONG WINAPI serialize_fault_filter(struct _EXCEPTION_POINTERS* e); 104 }; 105 106 /* 107 * Crash protection for the watcher thread. Wrap the callback 108 * with a __try { call() } 109 * To be able to use this - don't take locks, don't rely on destructors, 110 * don't make OS library calls, don't allocate memory, don't print, 111 * don't call code that could leave the heap / memory in an inconsistent state, 112 * or anything else where we are not in control if we suddenly jump out. 113 */ 114 class WatcherThreadCrashProtection : public StackObj { 115 public: 116 WatcherThreadCrashProtection(); 117 bool call(os::CrashProtectionCallback& cb); 118 }; 119 120 class PlatformEvent : public CHeapObj<mtInternal> { |