--- a/hotspot/src/share/vm/utilities/exceptions.cpp Mon Oct 19 12:30:17 2015 -0700
+++ b/hotspot/src/share/vm/utilities/exceptions.cpp Tue Oct 20 11:17:19 2015 -0400
@@ -145,7 +145,7 @@
p2i(h_exception()), file, line, p2i(thread));
}
// for AbortVMOnException flag
- NOT_PRODUCT(Exceptions::debug_check_abort(h_exception, message));
+ Exceptions::debug_check_abort(h_exception, message);
// Check for special boot-strapping/vm-thread handling
if (special_exception(thread, file, line, h_exception)) {
@@ -477,13 +477,12 @@
// ----------------------------------------------------------------------------------------
-#ifndef PRODUCT
// caller frees value_string if necessary
void Exceptions::debug_check_abort(const char *value_string, const char* message) {
if (AbortVMOnException != NULL && value_string != NULL &&
strstr(value_string, AbortVMOnException)) {
- if (AbortVMOnExceptionMessage == NULL || message == NULL ||
- strcmp(message, AbortVMOnExceptionMessage) == 0) {
+ if (AbortVMOnExceptionMessage == NULL || (message != NULL &&
+ strstr(message, AbortVMOnExceptionMessage))) {
fatal("Saw %s, aborting", value_string);
}
}
@@ -491,14 +490,17 @@
void Exceptions::debug_check_abort(Handle exception, const char* message) {
if (AbortVMOnException != NULL) {
- ResourceMark rm;
- if (message == NULL && exception->is_a(SystemDictionary::Throwable_klass())) {
- oop msg = java_lang_Throwable::message(exception);
- if (msg != NULL) {
- message = java_lang_String::as_utf8_string(msg);
- }
- }
- debug_check_abort(InstanceKlass::cast(exception()->klass())->external_name(), message);
+ debug_check_abort_helper(exception, message);
}
}
-#endif
+
+void Exceptions::debug_check_abort_helper(Handle exception, const char* message) {
+ ResourceMark rm;
+ if (message == NULL && exception->is_a(SystemDictionary::Throwable_klass())) {
+ oop msg = java_lang_Throwable::message(exception);
+ if (msg != NULL) {
+ message = java_lang_String::as_utf8_string(msg);
+ }
+ }
+ debug_check_abort(InstanceKlass::cast(exception()->klass())->external_name(), message);
+}