208 // types of VM error - originally in vmError.hpp 209 enum VMErrorType { 210 INTERNAL_ERROR = 0xe0000000, 211 OOM_MALLOC_ERROR = 0xe0000001, 212 OOM_MMAP_ERROR = 0xe0000002 213 }; 214 215 // error reporting helper functions 216 void report_vm_error(const char* file, int line, const char* error_msg, 217 const char* detail_msg = NULL); 218 void report_fatal(const char* file, int line, const char* message); 219 void report_vm_out_of_memory(const char* file, int line, size_t size, 220 VMErrorType vm_err_type, const char* message); 221 void report_should_not_call(const char* file, int line); 222 void report_should_not_reach_here(const char* file, int line); 223 void report_unimplemented(const char* file, int line); 224 void report_untested(const char* file, int line, const char* message); 225 226 void warning(const char* format, ...); 227 228 // out of shared space reporting 229 enum SharedSpaceType { 230 SharedPermGen, 231 SharedReadOnly, 232 SharedReadWrite, 233 SharedMiscData 234 }; 235 236 void report_out_of_shared_space(SharedSpaceType space_type); 237 238 // out of memory reporting 239 void report_java_out_of_memory(const char* message); 240 241 // Support for self-destruct 242 bool is_error_reported(); 243 void set_error_reported(); 244 245 /* Test assert(), fatal(), guarantee(), etc. */ 246 NOT_PRODUCT(void test_error_handler();) 247 | 208 // types of VM error - originally in vmError.hpp 209 enum VMErrorType { 210 INTERNAL_ERROR = 0xe0000000, 211 OOM_MALLOC_ERROR = 0xe0000001, 212 OOM_MMAP_ERROR = 0xe0000002 213 }; 214 215 // error reporting helper functions 216 void report_vm_error(const char* file, int line, const char* error_msg, 217 const char* detail_msg = NULL); 218 void report_fatal(const char* file, int line, const char* message); 219 void report_vm_out_of_memory(const char* file, int line, size_t size, 220 VMErrorType vm_err_type, const char* message); 221 void report_should_not_call(const char* file, int line); 222 void report_should_not_reach_here(const char* file, int line); 223 void report_unimplemented(const char* file, int line); 224 void report_untested(const char* file, int line, const char* message); 225 226 void warning(const char* format, ...); 227 228 #ifdef ASSERT 229 // Compile-time asserts. 230 template <bool> struct StaticAssert; 231 template <> struct StaticAssert<true> {}; 232 233 // Only StaticAssert<true> is defined, so if cond evaluates to false we get 234 // a compile time exception when trying to use StaticAssert<false>. 235 #define STATIC_ASSERT(cond) \ 236 do { \ 237 StaticAssert<(cond)> DUMMY_STATIC_ASSERT; \ 238 (void)DUMMY_STATIC_ASSERT; /* ignore */ \ 239 } while (false) 240 #else 241 #define STATIC_ASSERT(cond) 242 #endif 243 244 // out of shared space reporting 245 enum SharedSpaceType { 246 SharedPermGen, 247 SharedReadOnly, 248 SharedReadWrite, 249 SharedMiscData 250 }; 251 252 void report_out_of_shared_space(SharedSpaceType space_type); 253 254 // out of memory reporting 255 void report_java_out_of_memory(const char* message); 256 257 // Support for self-destruct 258 bool is_error_reported(); 259 void set_error_reported(); 260 261 /* Test assert(), fatal(), guarantee(), etc. */ 262 NOT_PRODUCT(void test_error_handler();) 263 |