93 94 // Tells whether the platform is Windows 2003 95 static bool is_windows_2003() { return _is_windows_2003; } 96 97 // Tells whether there can be the race bug during process exit on this platform 98 static bool has_exit_bug() { return _has_exit_bug; } 99 100 // Returns the byte size of a virtual memory page 101 static int vm_page_size() { return _vm_page_size; } 102 103 // Returns the size in bytes of memory blocks which can be allocated. 104 static int vm_allocation_granularity() { return _vm_allocation_granularity; } 105 106 // Read the headers for the executable that started the current process into 107 // the structure passed in (see winnt.h). 108 static void read_executable_headers(PIMAGE_NT_HEADERS); 109 110 // Default stack size for the current process. 111 static size_t default_stack_size() { return _default_stack_size; } 112 113 #ifndef _WIN64 114 // A wrapper to install a structured exception handler for fast JNI accesors. 115 static address fast_jni_accessor_wrapper(BasicType); 116 #endif 117 118 // filter function to ignore faults on serializations page 119 static LONG WINAPI serialize_fault_filter(struct _EXCEPTION_POINTERS* e); 120 }; 121 122 /* 123 * Crash protection for the watcher thread. Wrap the callback 124 * with a __try { call() } 125 * To be able to use this - don't take locks, don't rely on destructors, 126 * don't make OS library calls, don't allocate memory, don't print, 127 * don't call code that could leave the heap / memory in an inconsistent state, 128 * or anything else where we are not in control if we suddenly jump out. 129 */ 130 class WatcherThreadCrashProtection : public StackObj { 131 public: 132 WatcherThreadCrashProtection(); | 93 94 // Tells whether the platform is Windows 2003 95 static bool is_windows_2003() { return _is_windows_2003; } 96 97 // Tells whether there can be the race bug during process exit on this platform 98 static bool has_exit_bug() { return _has_exit_bug; } 99 100 // Returns the byte size of a virtual memory page 101 static int vm_page_size() { return _vm_page_size; } 102 103 // Returns the size in bytes of memory blocks which can be allocated. 104 static int vm_allocation_granularity() { return _vm_allocation_granularity; } 105 106 // Read the headers for the executable that started the current process into 107 // the structure passed in (see winnt.h). 108 static void read_executable_headers(PIMAGE_NT_HEADERS); 109 110 // Default stack size for the current process. 111 static size_t default_stack_size() { return _default_stack_size; } 112 113 static bool get_frame_at_stack_banging_point(JavaThread* thread, 114 struct _EXCEPTION_POINTERS* exceptionInfo, 115 address pc, frame* fr); 116 117 #ifndef _WIN64 118 // A wrapper to install a structured exception handler for fast JNI accesors. 119 static address fast_jni_accessor_wrapper(BasicType); 120 #endif 121 122 // filter function to ignore faults on serializations page 123 static LONG WINAPI serialize_fault_filter(struct _EXCEPTION_POINTERS* e); 124 }; 125 126 /* 127 * Crash protection for the watcher thread. Wrap the callback 128 * with a __try { call() } 129 * To be able to use this - don't take locks, don't rely on destructors, 130 * don't make OS library calls, don't allocate memory, don't print, 131 * don't call code that could leave the heap / memory in an inconsistent state, 132 * or anything else where we are not in control if we suddenly jump out. 133 */ 134 class WatcherThreadCrashProtection : public StackObj { 135 public: 136 WatcherThreadCrashProtection(); |