< prev index next >

src/hotspot/share/utilities/exceptions.cpp

Print this page

143 void Exceptions::_throw(JavaThread* thread, const char* file, int line, Handle h_exception, const char* message) {
144   ResourceMark rm(thread);
145   assert(h_exception() != NULL, "exception should not be NULL");
146 
147   // tracing (do this up front - so it works during boot strapping)
148   // Note, the print_value_string() argument is not called unless logging is enabled!
149   log_info(exceptions)("Exception <%s%s%s> (" PTR_FORMAT ") \n"
150                        "thrown [%s, line %d]\nfor thread " PTR_FORMAT,
151                        h_exception->print_value_string(),
152                        message ? ": " : "", message ? message : "",
153                        p2i(h_exception()), file, line, p2i(thread));
154 
155   // for AbortVMOnException flag
156   Exceptions::debug_check_abort(h_exception, message);
157 
158   // Check for special boot-strapping/compiler-thread handling
159   if (special_exception(thread, file, line, h_exception)) {
160     return;
161   }
162 
163   if (h_exception->is_a(vmClasses::OutOfMemoryError_klass())) {
164     count_out_of_memory_exceptions(h_exception);






165   }
166 
167   if (h_exception->is_a(vmClasses::LinkageError_klass())) {
168     Atomic::inc(&_linkage_errors, memory_order_relaxed);
169   }
170 
171   assert(h_exception->is_a(vmClasses::Throwable_klass()), "exception is not a subclass of java/lang/Throwable");
172 
173   // set the pending exception
174   thread->set_pending_exception(h_exception(), file, line);
175 
176   // vm log
177   Events::log_exception(thread, h_exception, message, file, line);
178 }
179 
180 
181 void Exceptions::_throw_msg(JavaThread* thread, const char* file, int line, Symbol* name, const char* message,
182                             Handle h_loader, Handle h_protection_domain) {
183   // Check for special boot-strapping/compiler-thread handling
184   if (special_exception(thread, file, line, name, message)) return;

143 void Exceptions::_throw(JavaThread* thread, const char* file, int line, Handle h_exception, const char* message) {
144   ResourceMark rm(thread);
145   assert(h_exception() != NULL, "exception should not be NULL");
146 
147   // tracing (do this up front - so it works during boot strapping)
148   // Note, the print_value_string() argument is not called unless logging is enabled!
149   log_info(exceptions)("Exception <%s%s%s> (" PTR_FORMAT ") \n"
150                        "thrown [%s, line %d]\nfor thread " PTR_FORMAT,
151                        h_exception->print_value_string(),
152                        message ? ": " : "", message ? message : "",
153                        p2i(h_exception()), file, line, p2i(thread));
154 
155   // for AbortVMOnException flag
156   Exceptions::debug_check_abort(h_exception, message);
157 
158   // Check for special boot-strapping/compiler-thread handling
159   if (special_exception(thread, file, line, h_exception)) {
160     return;
161   }
162 
163   if (h_exception->is_a(vmClasses::VirtualMachineError_klass())) {
164     // Remove the ScopedValue bindings in case we got a virtual machine
165     // Error while we were trying to manipulate ScopedValue bindings.
166     thread->clear_scopedValueBindings();
167 
168     if (h_exception->is_a(vmClasses::OutOfMemoryError_klass())) {
169       count_out_of_memory_exceptions(h_exception);
170     }
171   }
172 
173   if (h_exception->is_a(vmClasses::LinkageError_klass())) {
174     Atomic::inc(&_linkage_errors, memory_order_relaxed);
175   }
176 
177   assert(h_exception->is_a(vmClasses::Throwable_klass()), "exception is not a subclass of java/lang/Throwable");
178 
179   // set the pending exception
180   thread->set_pending_exception(h_exception(), file, line);
181 
182   // vm log
183   Events::log_exception(thread, h_exception, message, file, line);
184 }
185 
186 
187 void Exceptions::_throw_msg(JavaThread* thread, const char* file, int line, Symbol* name, const char* message,
188                             Handle h_loader, Handle h_protection_domain) {
189   // Check for special boot-strapping/compiler-thread handling
190   if (special_exception(thread, file, line, name, message)) return;
< prev index next >