equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
100 // used directly if the macros below are insufficient. |
100 // used directly if the macros below are insufficient. |
101 |
101 |
102 class Exceptions { |
102 class Exceptions { |
103 static bool special_exception(Thread *thread, const char* file, int line, Handle exception); |
103 static bool special_exception(Thread *thread, const char* file, int line, Handle exception); |
104 static bool special_exception(Thread* thread, const char* file, int line, Symbol* name, const char* message); |
104 static bool special_exception(Thread* thread, const char* file, int line, Symbol* name, const char* message); |
|
105 |
|
106 // Count out of memory errors that are interesting in error diagnosis |
|
107 static volatile int _out_of_memory_error_java_heap_errors; |
|
108 static volatile int _out_of_memory_error_metaspace_errors; |
|
109 static volatile int _out_of_memory_error_class_metaspace_errors; |
105 public: |
110 public: |
106 // this enum is defined to indicate whether it is safe to |
111 // this enum is defined to indicate whether it is safe to |
107 // ignore the encoding scheme of the original message string. |
112 // ignore the encoding scheme of the original message string. |
108 typedef enum { |
113 typedef enum { |
109 safe_to_utf8 = 0, |
114 safe_to_utf8 = 0, |
158 const char* message, |
163 const char* message, |
159 ExceptionMsgToUtf8Mode to_utf8_safe = safe_to_utf8); |
164 ExceptionMsgToUtf8Mode to_utf8_safe = safe_to_utf8); |
160 |
165 |
161 static void throw_stack_overflow_exception(Thread* thread, const char* file, int line, methodHandle method); |
166 static void throw_stack_overflow_exception(Thread* thread, const char* file, int line, methodHandle method); |
162 |
167 |
|
168 // Exception counting for error files of interesting exceptions that may have |
|
169 // caused a problem for the jvm |
|
170 static volatile int _stack_overflow_errors; |
|
171 |
|
172 static bool has_exception_counts(); |
|
173 static void count_out_of_memory_exceptions(Handle exception); |
|
174 static void print_exception_counts_on_error(outputStream* st); |
|
175 |
163 // for AbortVMOnException flag |
176 // for AbortVMOnException flag |
164 NOT_PRODUCT(static void debug_check_abort(Handle exception, const char* message = NULL);) |
177 NOT_PRODUCT(static void debug_check_abort(Handle exception, const char* message = NULL);) |
165 NOT_PRODUCT(static void debug_check_abort(const char *value_string, const char* message = NULL);) |
178 NOT_PRODUCT(static void debug_check_abort(const char *value_string, const char* message = NULL);) |
166 }; |
179 }; |
167 |
180 |