129 Handle h_exception(thread, exception); |
129 Handle h_exception(thread, exception); |
130 _throw(thread, file, line, h_exception); |
130 _throw(thread, file, line, h_exception); |
131 } |
131 } |
132 |
132 |
133 void Exceptions::_throw(Thread* thread, const char* file, int line, Handle h_exception, const char* message) { |
133 void Exceptions::_throw(Thread* thread, const char* file, int line, Handle h_exception, const char* message) { |
134 ResourceMark rm; |
134 ResourceMark rm(thread); |
135 assert(h_exception() != NULL, "exception should not be NULL"); |
135 assert(h_exception() != NULL, "exception should not be NULL"); |
136 |
136 |
137 // tracing (do this up front - so it works during boot strapping) |
137 // tracing (do this up front - so it works during boot strapping) |
|
138 // Note, the print_value_string() argument is not called unless logging is enabled! |
138 log_info(exceptions)("Exception <%s%s%s> (" INTPTR_FORMAT ") \n" |
139 log_info(exceptions)("Exception <%s%s%s> (" INTPTR_FORMAT ") \n" |
139 "thrown [%s, line %d]\nfor thread " INTPTR_FORMAT, |
140 "thrown [%s, line %d]\nfor thread " INTPTR_FORMAT, |
140 h_exception->print_value_string(), |
141 h_exception->print_value_string(), |
141 message ? ": " : "", message ? message : "", |
142 message ? ": " : "", message ? message : "", |
142 p2i(h_exception()), file, line, p2i(thread)); |
143 p2i(h_exception()), file, line, p2i(thread)); |
|
144 |
143 // for AbortVMOnException flag |
145 // for AbortVMOnException flag |
144 Exceptions::debug_check_abort(h_exception, message); |
146 Exceptions::debug_check_abort(h_exception, message); |
145 |
147 |
146 // Check for special boot-strapping/vm-thread handling |
148 // Check for special boot-strapping/vm-thread handling |
147 if (special_exception(thread, file, line, h_exception)) { |
149 if (special_exception(thread, file, line, h_exception)) { |
160 |
162 |
161 // set the pending exception |
163 // set the pending exception |
162 thread->set_pending_exception(h_exception(), file, line); |
164 thread->set_pending_exception(h_exception(), file, line); |
163 |
165 |
164 // vm log |
166 // vm log |
165 if (LogEvents){ |
167 Events::log_exception(thread, h_exception, message, file, line); |
166 Events::log_exception(thread, "Exception <%s%s%s> (" INTPTR_FORMAT ") thrown at [%s, line %d]", |
|
167 h_exception->print_value_string(), message ? ": " : "", message ? message : "", |
|
168 p2i(h_exception()), file, line); |
|
169 } |
|
170 } |
168 } |
171 |
169 |
172 |
170 |
173 void Exceptions::_throw_msg(Thread* thread, const char* file, int line, Symbol* name, const char* message, |
171 void Exceptions::_throw_msg(Thread* thread, const char* file, int line, Symbol* name, const char* message, |
174 Handle h_loader, Handle h_protection_domain) { |
172 Handle h_loader, Handle h_protection_domain) { |