annotate src/share/vm/utilities/exceptions.cpp @ 5711:de5e8c8a9b87

8165807: PPC64: Backport PPC64 port to OpenJDK 7 Summary: Backport initial PPC64 port changes without bug IDs Reviewed-by: goetz
author andrew
date Sat, 10 Sep 2016 21:36:58 +0100
parents 93c71eb28866
children
rev   line source
duke@0 1 /*
never@3157 2 * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
duke@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@0 4 *
duke@0 5 * This code is free software; you can redistribute it and/or modify it
duke@0 6 * under the terms of the GNU General Public License version 2 only, as
duke@0 7 * published by the Free Software Foundation.
duke@0 8 *
duke@0 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@0 13 * accompanied this code).
duke@0 14 *
duke@0 15 * You should have received a copy of the GNU General Public License version
duke@0 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@0 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 18 *
trims@1472 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1472 20 * or visit www.oracle.com if you need additional information or have any
trims@1472 21 * questions.
duke@0 22 *
duke@0 23 */
duke@0 24
stefank@1879 25 #include "precompiled.hpp"
stefank@1879 26 #include "classfile/systemDictionary.hpp"
stefank@1879 27 #include "classfile/vmSymbols.hpp"
stefank@1879 28 #include "compiler/compileBroker.hpp"
stefank@1879 29 #include "oops/oop.inline.hpp"
stefank@1879 30 #include "runtime/init.hpp"
stefank@1879 31 #include "runtime/java.hpp"
stefank@1879 32 #include "runtime/javaCalls.hpp"
stefank@1879 33 #include "runtime/threadCritical.hpp"
stefank@1879 34 #include "utilities/events.hpp"
stefank@1879 35 #include "utilities/exceptions.hpp"
stefank@1879 36 #ifdef TARGET_OS_FAMILY_linux
stefank@1879 37 # include "thread_linux.inline.hpp"
stefank@1879 38 #endif
stefank@1879 39 #ifdef TARGET_OS_FAMILY_solaris
stefank@1879 40 # include "thread_solaris.inline.hpp"
stefank@1879 41 #endif
stefank@1879 42 #ifdef TARGET_OS_FAMILY_windows
stefank@1879 43 # include "thread_windows.inline.hpp"
stefank@1879 44 #endif
andrew@5711 45 #ifdef TARGET_OS_FAMILY_aix
andrew@5711 46 # include "thread_aix.inline.hpp"
andrew@5711 47 #endif
never@2796 48 #ifdef TARGET_OS_FAMILY_bsd
never@2796 49 # include "thread_bsd.inline.hpp"
never@2796 50 #endif
duke@0 51
duke@0 52
duke@0 53 // Implementation of ThreadShadow
duke@0 54 void check_ThreadShadow() {
duke@0 55 const ByteSize offset1 = byte_offset_of(ThreadShadow, _pending_exception);
duke@0 56 const ByteSize offset2 = Thread::pending_exception_offset();
duke@0 57 if (offset1 != offset2) fatal("ThreadShadow::_pending_exception is not positioned correctly");
duke@0 58 }
duke@0 59
duke@0 60
duke@0 61 void ThreadShadow::set_pending_exception(oop exception, const char* file, int line) {
duke@0 62 assert(exception != NULL && exception->is_oop(), "invalid exception oop");
duke@0 63 _pending_exception = exception;
duke@0 64 _exception_file = file;
duke@0 65 _exception_line = line;
duke@0 66 }
duke@0 67
duke@0 68 void ThreadShadow::clear_pending_exception() {
duke@0 69 if (TraceClearedExceptions) {
duke@0 70 if (_pending_exception != NULL) {
duke@0 71 tty->print_cr("Thread::clear_pending_exception: cleared exception:");
duke@0 72 _pending_exception->print();
duke@0 73 }
duke@0 74 }
duke@0 75 _pending_exception = NULL;
duke@0 76 _exception_file = NULL;
duke@0 77 _exception_line = 0;
duke@0 78 }
duke@0 79 // Implementation of Exceptions
duke@0 80
duke@0 81 bool Exceptions::special_exception(Thread* thread, const char* file, int line, Handle h_exception) {
duke@0 82 // bootstrapping check
duke@0 83 if (!Universe::is_fully_initialized()) {
duke@0 84 vm_exit_during_initialization(h_exception);
duke@0 85 ShouldNotReachHere();
duke@0 86 }
duke@0 87
coleenp@1787 88 #ifdef ASSERT
coleenp@1787 89 // Check for trying to throw stack overflow before initialization is complete
coleenp@1787 90 // to prevent infinite recursion trying to initialize stack overflow without
coleenp@1787 91 // adequate stack space.
coleenp@1787 92 // This can happen with stress testing a large value of StackShadowPages
coleenp@1787 93 if (h_exception()->klass() == SystemDictionary::StackOverflowError_klass()) {
coleenp@1787 94 instanceKlass* ik = instanceKlass::cast(h_exception->klass());
coleenp@1787 95 assert(ik->is_initialized(),
coleenp@1787 96 "need to increase min_stack_allowed calculation");
coleenp@1787 97 }
coleenp@1787 98 #endif // ASSERT
coleenp@1787 99
duke@0 100 if (thread->is_VM_thread()
duke@0 101 || thread->is_Compiler_thread() ) {
duke@0 102 // We do not care what kind of exception we get for the vm-thread or a thread which
duke@0 103 // is compiling. We just install a dummy exception object
duke@0 104 thread->set_pending_exception(Universe::vm_exception(), file, line);
duke@0 105 return true;
duke@0 106 }
duke@0 107
duke@0 108 return false;
duke@0 109 }
duke@0 110
coleenp@2062 111 bool Exceptions::special_exception(Thread* thread, const char* file, int line, Symbol* h_name, const char* message) {
duke@0 112 // bootstrapping check
duke@0 113 if (!Universe::is_fully_initialized()) {
coleenp@2062 114 if (h_name == NULL) {
duke@0 115 // atleast an informative message.
duke@0 116 vm_exit_during_initialization("Exception", message);
duke@0 117 } else {
duke@0 118 vm_exit_during_initialization(h_name, message);
duke@0 119 }
duke@0 120 ShouldNotReachHere();
duke@0 121 }
duke@0 122
duke@0 123 if (thread->is_VM_thread()
duke@0 124 || thread->is_Compiler_thread() ) {
duke@0 125 // We do not care what kind of exception we get for the vm-thread or a thread which
duke@0 126 // is compiling. We just install a dummy exception object
duke@0 127 thread->set_pending_exception(Universe::vm_exception(), file, line);
duke@0 128 return true;
duke@0 129 }
duke@0 130 return false;
duke@0 131 }
duke@0 132
duke@0 133 // This method should only be called from generated code,
duke@0 134 // therefore the exception oop should be in the oopmap.
duke@0 135 void Exceptions::_throw_oop(Thread* thread, const char* file, int line, oop exception) {
duke@0 136 assert(exception != NULL, "exception should not be NULL");
duke@0 137 Handle h_exception = Handle(thread, exception);
duke@0 138 _throw(thread, file, line, h_exception);
duke@0 139 }
duke@0 140
never@1011 141 void Exceptions::_throw(Thread* thread, const char* file, int line, Handle h_exception, const char* message) {
duke@0 142 assert(h_exception() != NULL, "exception should not be NULL");
duke@0 143
duke@0 144 // tracing (do this up front - so it works during boot strapping)
duke@0 145 if (TraceExceptions) {
duke@0 146 ttyLocker ttyl;
duke@0 147 ResourceMark rm;
never@1011 148 tty->print_cr("Exception <%s>%s%s (" INTPTR_FORMAT " ) \n"
never@1011 149 "thrown [%s, line %d]\nfor thread " INTPTR_FORMAT,
never@1011 150 h_exception->print_value_string(),
never@1011 151 message ? ": " : "", message ? message : "",
never@1011 152 (address)h_exception(), file, line, thread);
duke@0 153 }
duke@0 154 // for AbortVMOnException flag
kvn@1604 155 NOT_PRODUCT(Exceptions::debug_check_abort(h_exception, message));
duke@0 156
duke@0 157 // Check for special boot-strapping/vm-thread handling
duke@0 158 if (special_exception(thread, file, line, h_exception)) return;
duke@0 159
never@1142 160 assert(h_exception->is_a(SystemDictionary::Throwable_klass()), "exception is not a subclass of java/lang/Throwable");
duke@0 161
duke@0 162 // set the pending exception
duke@0 163 thread->set_pending_exception(h_exception(), file, line);
duke@0 164
duke@0 165 // vm log
never@3157 166 Events::log_exception(thread, "Threw " INTPTR_FORMAT " at %s:%d", (address)h_exception(), file, line);
duke@0 167 }
duke@0 168
duke@0 169
twisti@3937 170 void Exceptions::_throw_msg(Thread* thread, const char* file, int line, Symbol* name, const char* message,
twisti@3937 171 Handle h_loader, Handle h_protection_domain) {
duke@0 172 // Check for special boot-strapping/vm-thread handling
twisti@3937 173 if (special_exception(thread, file, line, name, message)) return;
duke@0 174 // Create and throw exception
duke@0 175 Handle h_cause(thread, NULL);
twisti@3937 176 Handle h_exception = new_exception(thread, name, message, h_cause, h_loader, h_protection_domain);
never@1011 177 _throw(thread, file, line, h_exception, message);
duke@0 178 }
duke@0 179
twisti@3937 180 void Exceptions::_throw_msg_cause(Thread* thread, const char* file, int line, Symbol* name, const char* message, Handle h_cause,
twisti@3937 181 Handle h_loader, Handle h_protection_domain) {
duke@0 182 // Check for special boot-strapping/vm-thread handling
twisti@3937 183 if (special_exception(thread, file, line, name, message)) return;
duke@0 184 // Create and throw exception and init cause
twisti@3937 185 Handle h_exception = new_exception(thread, name, message, h_cause, h_loader, h_protection_domain);
never@1011 186 _throw(thread, file, line, h_exception, message);
duke@0 187 }
duke@0 188
twisti@3937 189 void Exceptions::_throw_cause(Thread* thread, const char* file, int line, Symbol* name, Handle h_cause,
twisti@3937 190 Handle h_loader, Handle h_protection_domain) {
twisti@3937 191 // Check for special boot-strapping/vm-thread handling
twisti@3937 192 if (special_exception(thread, file, line, h_cause)) return;
twisti@3937 193 // Create and throw exception
twisti@3937 194 Handle h_exception = new_exception(thread, name, h_cause, h_loader, h_protection_domain);
twisti@3937 195 _throw(thread, file, line, h_exception, NULL);
duke@0 196 }
duke@0 197
twisti@3937 198 void Exceptions::_throw_args(Thread* thread, const char* file, int line, Symbol* name, Symbol* signature, JavaCallArguments *args) {
duke@0 199 // Check for special boot-strapping/vm-thread handling
twisti@3937 200 if (special_exception(thread, file, line, name, NULL)) return;
duke@0 201 // Create and throw exception
duke@0 202 Handle h_loader(thread, NULL);
duke@0 203 Handle h_prot(thread, NULL);
twisti@3937 204 Handle exception = new_exception(thread, name, signature, args, h_loader, h_prot);
duke@0 205 _throw(thread, file, line, exception);
duke@0 206 }
duke@0 207
duke@0 208
twisti@3937 209 // Methods for default parameters.
twisti@3937 210 // NOTE: These must be here (and not in the header file) because of include circularities.
twisti@3937 211 void Exceptions::_throw_msg_cause(Thread* thread, const char* file, int line, Symbol* name, const char* message, Handle h_cause) {
twisti@3937 212 _throw_msg_cause(thread, file, line, name, message, h_cause, Handle(thread, NULL), Handle(thread, NULL));
twisti@3937 213 }
twisti@3937 214 void Exceptions::_throw_msg(Thread* thread, const char* file, int line, Symbol* name, const char* message) {
twisti@3937 215 _throw_msg(thread, file, line, name, message, Handle(thread, NULL), Handle(thread, NULL));
twisti@3937 216 }
twisti@3937 217 void Exceptions::_throw_cause(Thread* thread, const char* file, int line, Symbol* name, Handle h_cause) {
twisti@3937 218 _throw_cause(thread, file, line, name, h_cause, Handle(thread, NULL), Handle(thread, NULL));
twisti@3937 219 }
twisti@3937 220
twisti@3937 221
coleenp@2369 222 void Exceptions::throw_stack_overflow_exception(Thread* THREAD, const char* file, int line, methodHandle method) {
duke@0 223 Handle exception;
duke@0 224 if (!THREAD->has_pending_exception()) {
duke@0 225 klassOop k = SystemDictionary::StackOverflowError_klass();
duke@0 226 oop e = instanceKlass::cast(k)->allocate_instance(CHECK);
duke@0 227 exception = Handle(THREAD, e); // fill_in_stack trace does gc
coleenp@1787 228 assert(instanceKlass::cast(k)->is_initialized(), "need to increase min_stack_allowed calculation");
duke@0 229 if (StackTraceInThrowable) {
coleenp@2369 230 java_lang_Throwable::fill_in_stack_trace(exception, method());
duke@0 231 }
duke@0 232 } else {
duke@0 233 // if prior exception, throw that one instead
duke@0 234 exception = Handle(THREAD, THREAD->pending_exception());
duke@0 235 }
coleenp@2369 236 _throw(THREAD, file, line, exception);
duke@0 237 }
duke@0 238
coleenp@2062 239 void Exceptions::fthrow(Thread* thread, const char* file, int line, Symbol* h_name, const char* format, ...) {
duke@0 240 const int max_msg_size = 1024;
duke@0 241 va_list ap;
duke@0 242 va_start(ap, format);
duke@0 243 char msg[max_msg_size];
duke@0 244 vsnprintf(msg, max_msg_size, format, ap);
duke@0 245 msg[max_msg_size-1] = '\0';
duke@0 246 va_end(ap);
duke@0 247 _throw_msg(thread, file, line, h_name, msg);
duke@0 248 }
duke@0 249
duke@0 250 // Creates an exception oop, calls the <init> method with the given signature.
duke@0 251 // and returns a Handle
twisti@3937 252 Handle Exceptions::new_exception(Thread *thread, Symbol* name,
twisti@3937 253 Symbol* signature, JavaCallArguments *args,
twisti@3937 254 Handle h_loader, Handle h_protection_domain) {
duke@0 255 assert(Universe::is_fully_initialized(),
duke@0 256 "cannot be called during initialization");
duke@0 257 assert(thread->is_Java_thread(), "can only be called by a Java thread");
duke@0 258 assert(!thread->has_pending_exception(), "already has exception");
duke@0 259
duke@0 260 Handle h_exception;
duke@0 261
duke@0 262 // Resolve exception klass
twisti@3937 263 klassOop ik = SystemDictionary::resolve_or_fail(name, h_loader, h_protection_domain, true, thread);
twisti@3937 264 instanceKlassHandle klass(thread, ik);
duke@0 265
duke@0 266 if (!thread->has_pending_exception()) {
duke@0 267 assert(klass.not_null(), "klass must exist");
duke@0 268 // We are about to create an instance - so make sure that klass is initialized
duke@0 269 klass->initialize(thread);
duke@0 270 if (!thread->has_pending_exception()) {
duke@0 271 // Allocate new exception
duke@0 272 h_exception = klass->allocate_instance_handle(thread);
duke@0 273 if (!thread->has_pending_exception()) {
duke@0 274 JavaValue result(T_VOID);
duke@0 275 args->set_receiver(h_exception);
duke@0 276 // Call constructor
duke@0 277 JavaCalls::call_special(&result, klass,
coleenp@2062 278 vmSymbols::object_initializer_name(),
duke@0 279 signature,
duke@0 280 args,
duke@0 281 thread);
duke@0 282 }
duke@0 283 }
duke@0 284 }
duke@0 285
duke@0 286 // Check if another exception was thrown in the process, if so rethrow that one
duke@0 287 if (thread->has_pending_exception()) {
duke@0 288 h_exception = Handle(thread, thread->pending_exception());
duke@0 289 thread->clear_pending_exception();
duke@0 290 }
duke@0 291 return h_exception;
duke@0 292 }
duke@0 293
twisti@3937 294 // Creates an exception oop, calls the <init> method with the given signature.
twisti@3937 295 // and returns a Handle
twisti@3937 296 // Initializes the cause if cause non-null
twisti@3937 297 Handle Exceptions::new_exception(Thread *thread, Symbol* name,
twisti@3937 298 Symbol* signature, JavaCallArguments *args,
twisti@3937 299 Handle h_cause,
twisti@3937 300 Handle h_loader, Handle h_protection_domain) {
twisti@3937 301 Handle h_exception = new_exception(thread, name, signature, args, h_loader, h_protection_domain);
twisti@3937 302
twisti@3937 303 // Future: object initializer should take a cause argument
twisti@3937 304 if (h_cause.not_null()) {
twisti@3937 305 assert(h_cause->is_a(SystemDictionary::Throwable_klass()),
twisti@3937 306 "exception cause is not a subclass of java/lang/Throwable");
twisti@3937 307 JavaValue result1(T_OBJECT);
twisti@3937 308 JavaCallArguments args1;
twisti@3937 309 args1.set_receiver(h_exception);
twisti@3937 310 args1.push_oop(h_cause);
twisti@3937 311 JavaCalls::call_virtual(&result1, h_exception->klass(),
twisti@3937 312 vmSymbols::initCause_name(),
twisti@3937 313 vmSymbols::throwable_throwable_signature(),
twisti@3937 314 &args1,
twisti@3937 315 thread);
twisti@3937 316 }
twisti@3937 317
twisti@3937 318 // Check if another exception was thrown in the process, if so rethrow that one
twisti@3937 319 if (thread->has_pending_exception()) {
twisti@3937 320 h_exception = Handle(thread, thread->pending_exception());
twisti@3937 321 thread->clear_pending_exception();
twisti@3937 322 }
twisti@3937 323 return h_exception;
twisti@3937 324 }
twisti@3937 325
twisti@3937 326 // Convenience method. Calls either the <init>() or <init>(Throwable) method when
twisti@3937 327 // creating a new exception
twisti@3937 328 Handle Exceptions::new_exception(Thread* thread, Symbol* name,
twisti@3937 329 Handle h_cause,
twisti@3937 330 Handle h_loader, Handle h_protection_domain,
twisti@3937 331 ExceptionMsgToUtf8Mode to_utf8_safe) {
twisti@3937 332 JavaCallArguments args;
twisti@3937 333 Symbol* signature = NULL;
twisti@3937 334 if (h_cause.is_null()) {
twisti@3937 335 signature = vmSymbols::void_method_signature();
twisti@3937 336 } else {
twisti@3937 337 signature = vmSymbols::throwable_void_signature();
twisti@3937 338 args.push_oop(h_cause);
twisti@3937 339 }
twisti@3937 340 return new_exception(thread, name, signature, &args, h_loader, h_protection_domain);
twisti@3937 341 }
twisti@3937 342
duke@0 343 // Convenience method. Calls either the <init>() or <init>(String) method when
duke@0 344 // creating a new exception
twisti@3937 345 Handle Exceptions::new_exception(Thread* thread, Symbol* name,
duke@0 346 const char* message, Handle h_cause,
twisti@3937 347 Handle h_loader, Handle h_protection_domain,
duke@0 348 ExceptionMsgToUtf8Mode to_utf8_safe) {
duke@0 349 JavaCallArguments args;
coleenp@2062 350 Symbol* signature = NULL;
duke@0 351 if (message == NULL) {
coleenp@2062 352 signature = vmSymbols::void_method_signature();
duke@0 353 } else {
duke@0 354 // We want to allocate storage, but we can't do that if there's
duke@0 355 // a pending exception, so we preserve any pending exception
duke@0 356 // around the allocation.
duke@0 357 // If we get an exception from the allocation, prefer that to
duke@0 358 // the exception we are trying to build, or the pending exception.
duke@0 359 // This is sort of like what PRESERVE_EXCEPTION_MARK does, except
duke@0 360 // for the preferencing and the early returns.
twisti@3937 361 Handle incoming_exception(thread, NULL);
duke@0 362 if (thread->has_pending_exception()) {
duke@0 363 incoming_exception = Handle(thread, thread->pending_exception());
duke@0 364 thread->clear_pending_exception();
duke@0 365 }
duke@0 366 Handle msg;
duke@0 367 if (to_utf8_safe == safe_to_utf8) {
duke@0 368 // Make a java UTF8 string.
duke@0 369 msg = java_lang_String::create_from_str(message, thread);
duke@0 370 } else {
duke@0 371 // Make a java string keeping the encoding scheme of the original string.
duke@0 372 msg = java_lang_String::create_from_platform_dependent_str(message, thread);
duke@0 373 }
duke@0 374 if (thread->has_pending_exception()) {
duke@0 375 Handle exception(thread, thread->pending_exception());
duke@0 376 thread->clear_pending_exception();
duke@0 377 return exception;
duke@0 378 }
duke@0 379 if (incoming_exception.not_null()) {
duke@0 380 return incoming_exception;
duke@0 381 }
duke@0 382 args.push_oop(msg);
coleenp@2062 383 signature = vmSymbols::string_void_signature();
duke@0 384 }
twisti@3937 385 return new_exception(thread, name, signature, &args, h_cause, h_loader, h_protection_domain);
duke@0 386 }
duke@0 387
duke@0 388 // Another convenience method that creates handles for null class loaders and
duke@0 389 // protection domains and null causes.
duke@0 390 // If the last parameter 'to_utf8_mode' is safe_to_utf8,
duke@0 391 // it means we can safely ignore the encoding scheme of the message string and
duke@0 392 // convert it directly to a java UTF8 string. Otherwise, we need to take the
duke@0 393 // encoding scheme of the string into account. One thing we should do at some
duke@0 394 // point is to push this flag down to class java_lang_String since other
duke@0 395 // classes may need similar functionalities.
twisti@3937 396 Handle Exceptions::new_exception(Thread* thread, Symbol* name,
duke@0 397 const char* message,
duke@0 398 ExceptionMsgToUtf8Mode to_utf8_safe) {
duke@0 399
duke@0 400 Handle h_loader(thread, NULL);
duke@0 401 Handle h_prot(thread, NULL);
duke@0 402 Handle h_cause(thread, NULL);
coleenp@2062 403 return Exceptions::new_exception(thread, name, message, h_cause, h_loader,
duke@0 404 h_prot, to_utf8_safe);
duke@0 405 }
duke@0 406
duke@0 407 // Implementation of ExceptionMark
duke@0 408
duke@0 409 ExceptionMark::ExceptionMark(Thread*& thread) {
duke@0 410 thread = Thread::current();
duke@0 411 _thread = thread;
duke@0 412 if (_thread->has_pending_exception()) {
duke@0 413 oop exception = _thread->pending_exception();
duke@0 414 _thread->clear_pending_exception(); // Needed to avoid infinite recursion
duke@0 415 exception->print();
duke@0 416 fatal("ExceptionMark constructor expects no pending exceptions");
duke@0 417 }
duke@0 418 }
duke@0 419
duke@0 420
duke@0 421 ExceptionMark::~ExceptionMark() {
duke@0 422 if (_thread->has_pending_exception()) {
duke@0 423 Handle exception(_thread, _thread->pending_exception());
duke@0 424 _thread->clear_pending_exception(); // Needed to avoid infinite recursion
duke@0 425 if (is_init_completed()) {
duke@0 426 exception->print();
duke@0 427 fatal("ExceptionMark destructor expects no pending exceptions");
duke@0 428 } else {
duke@0 429 vm_exit_during_initialization(exception);
duke@0 430 }
duke@0 431 }
duke@0 432 }
duke@0 433
duke@0 434 // ----------------------------------------------------------------------------------------
duke@0 435
duke@0 436 #ifndef PRODUCT
duke@0 437 // caller frees value_string if necessary
kvn@1604 438 void Exceptions::debug_check_abort(const char *value_string, const char* message) {
duke@0 439 if (AbortVMOnException != NULL && value_string != NULL &&
duke@0 440 strstr(value_string, AbortVMOnException)) {
kvn@1604 441 if (AbortVMOnExceptionMessage == NULL || message == NULL ||
kvn@1604 442 strcmp(message, AbortVMOnExceptionMessage) == 0) {
kvn@1604 443 fatal(err_msg("Saw %s, aborting", value_string));
kvn@1604 444 }
duke@0 445 }
duke@0 446 }
duke@0 447
kvn@1604 448 void Exceptions::debug_check_abort(Handle exception, const char* message) {
duke@0 449 if (AbortVMOnException != NULL) {
duke@0 450 ResourceMark rm;
kvn@1604 451 if (message == NULL && exception->is_a(SystemDictionary::Throwable_klass())) {
kvn@1604 452 oop msg = java_lang_Throwable::message(exception);
kvn@1604 453 if (msg != NULL) {
kvn@1604 454 message = java_lang_String::as_utf8_string(msg);
kvn@1604 455 }
kvn@1604 456 }
kvn@1604 457 debug_check_abort(instanceKlass::cast(exception()->klass())->external_name(), message);
duke@0 458 }
duke@0 459 }
duke@0 460 #endif