36 #include "gc/shared/workgroup.hpp" |
36 #include "gc/shared/workgroup.hpp" |
37 #include "interpreter/interpreter.hpp" |
37 #include "interpreter/interpreter.hpp" |
38 #include "interpreter/linkResolver.hpp" |
38 #include "interpreter/linkResolver.hpp" |
39 #include "interpreter/oopMapCache.hpp" |
39 #include "interpreter/oopMapCache.hpp" |
40 #include "jvmtifiles/jvmtiEnv.hpp" |
40 #include "jvmtifiles/jvmtiEnv.hpp" |
|
41 #include "logging/log.hpp" |
41 #include "logging/logConfiguration.hpp" |
42 #include "logging/logConfiguration.hpp" |
42 #include "memory/metaspaceShared.hpp" |
43 #include "memory/metaspaceShared.hpp" |
43 #include "memory/oopFactory.hpp" |
44 #include "memory/oopFactory.hpp" |
44 #include "memory/universe.inline.hpp" |
45 #include "memory/universe.inline.hpp" |
45 #include "oops/instanceKlass.hpp" |
46 #include "oops/instanceKlass.hpp" |
2060 // |
2061 // |
2061 RegisterMap map(this, false); |
2062 RegisterMap map(this, false); |
2062 frame caller_fr = last_frame().sender(&map); |
2063 frame caller_fr = last_frame().sender(&map); |
2063 assert(caller_fr.is_compiled_frame(), "what?"); |
2064 assert(caller_fr.is_compiled_frame(), "what?"); |
2064 if (caller_fr.is_deoptimized_frame()) { |
2065 if (caller_fr.is_deoptimized_frame()) { |
2065 if (TraceExceptions) { |
2066 log_info(exceptions)("deferred async exception at compiled safepoint"); |
2066 ResourceMark rm; |
|
2067 tty->print_cr("deferred async exception at compiled safepoint"); |
|
2068 } |
|
2069 return; |
2067 return; |
2070 } |
2068 } |
2071 } |
2069 } |
2072 } |
2070 } |
2073 |
2071 |
2089 if (!has_pending_exception() || !pending_exception()->is_a(SystemDictionary::ThreadDeath_klass())) { |
2087 if (!has_pending_exception() || !pending_exception()->is_a(SystemDictionary::ThreadDeath_klass())) { |
2090 |
2088 |
2091 // We cannot call Exceptions::_throw(...) here because we cannot block |
2089 // We cannot call Exceptions::_throw(...) here because we cannot block |
2092 set_pending_exception(_pending_async_exception, __FILE__, __LINE__); |
2090 set_pending_exception(_pending_async_exception, __FILE__, __LINE__); |
2093 |
2091 |
2094 if (TraceExceptions) { |
2092 if (log_is_enabled(Info, exceptions)) { |
2095 ResourceMark rm; |
2093 ResourceMark rm; |
2096 tty->print("Async. exception installed at runtime exit (" INTPTR_FORMAT ")", p2i(this)); |
2094 outputStream* logstream = LogHandle(exceptions)::info_stream(); |
2097 if (has_last_Java_frame()) { |
2095 logstream->print("Async. exception installed at runtime exit (" INTPTR_FORMAT ")", p2i(this)); |
2098 frame f = last_frame(); |
2096 if (has_last_Java_frame()) { |
2099 tty->print(" (pc: " INTPTR_FORMAT " sp: " INTPTR_FORMAT " )", p2i(f.pc()), p2i(f.sp())); |
2097 frame f = last_frame(); |
2100 } |
2098 logstream->print(" (pc: " INTPTR_FORMAT " sp: " INTPTR_FORMAT " )", p2i(f.pc()), p2i(f.sp())); |
2101 tty->print_cr(" of type: %s", _pending_async_exception->klass()->external_name()); |
2099 } |
|
2100 logstream->print_cr(" of type: %s", _pending_async_exception->klass()->external_name()); |
2102 } |
2101 } |
2103 _pending_async_exception = NULL; |
2102 _pending_async_exception = NULL; |
2104 clear_has_async_exception(); |
2103 clear_has_async_exception(); |
2105 } |
2104 } |
2106 } |
2105 } |
2212 } |
2211 } |
2213 |
2212 |
2214 // Set async. pending exception in thread. |
2213 // Set async. pending exception in thread. |
2215 set_pending_async_exception(java_throwable); |
2214 set_pending_async_exception(java_throwable); |
2216 |
2215 |
2217 if (TraceExceptions) { |
2216 if (log_is_enabled(Info, exceptions)) { |
2218 ResourceMark rm; |
2217 ResourceMark rm; |
2219 tty->print_cr("Pending Async. exception installed of type: %s", _pending_async_exception->klass()->external_name()); |
2218 log_info(exceptions)("Pending Async. exception installed of type: %s", |
|
2219 InstanceKlass::cast(_pending_async_exception->klass())->external_name()); |
2220 } |
2220 } |
2221 // for AbortVMOnException flag |
2221 // for AbortVMOnException flag |
2222 Exceptions::debug_check_abort(_pending_async_exception->klass()->external_name()); |
2222 Exceptions::debug_check_abort(_pending_async_exception->klass()->external_name()); |
2223 } |
2223 } |
2224 } |
2224 } |