hotspot/src/share/vm/utilities/exceptions.hpp
changeset 13396 1b2b5f740ee0
parent 13391 30245956af37
child 13728 882756847a04
equal deleted inserted replaced
13395:edf37d840190 13396:1b2b5f740ee0
   110     unsafe_to_utf8 = 1
   110     unsafe_to_utf8 = 1
   111   } ExceptionMsgToUtf8Mode;
   111   } ExceptionMsgToUtf8Mode;
   112   // Throw exceptions: w/o message, w/ message & with formatted message.
   112   // Throw exceptions: w/o message, w/ message & with formatted message.
   113   static void _throw_oop(Thread* thread, const char* file, int line, oop exception);
   113   static void _throw_oop(Thread* thread, const char* file, int line, oop exception);
   114   static void _throw(Thread* thread, const char* file, int line, Handle exception, const char* msg = NULL);
   114   static void _throw(Thread* thread, const char* file, int line, Handle exception, const char* msg = NULL);
   115   static void _throw_msg(Thread* thread, const char* file, int line,
   115 
   116                          Symbol* name, const char* message, Handle loader,
   116   static void _throw_msg(Thread* thread, const char* file, int line, Symbol* name, const char* message);
   117                          Handle protection_domain);
   117   static void _throw_msg(Thread* thread, const char* file, int line, Symbol* name, const char* message,
   118   static void _throw_msg(Thread* thread, const char* file, int line,
   118                          Handle loader, Handle protection_domain);
   119                          Symbol* name, const char* message);
   119 
       
   120   static void _throw_msg_cause(Thread* thread, const char* file, int line, Symbol* name, const char* message, Handle h_cause);
       
   121   static void _throw_msg_cause(Thread* thread, const char* file, int line, Symbol* name, const char* message, Handle h_cause,
       
   122                                Handle h_loader, Handle h_protection_domain);
       
   123 
       
   124   static void _throw_cause(Thread* thread, const char* file, int line, Symbol* name, Handle h_cause);
       
   125   static void _throw_cause(Thread* thread, const char* file, int line, Symbol* name, Handle h_cause,
       
   126                            Handle h_loader, Handle h_protection_domain);
       
   127 
   120   static void _throw_args(Thread* thread, const char* file, int line,
   128   static void _throw_args(Thread* thread, const char* file, int line,
   121                           Symbol* name, Symbol* signature,
   129                           Symbol* name, Symbol* signature,
   122                           JavaCallArguments* args);
   130                           JavaCallArguments* args);
   123   static void _throw_msg_cause(Thread* thread, const char* file,
       
   124                          int line, Symbol* h_name, const char* message,
       
   125                          Handle h_cause, Handle h_loader, Handle h_protection_domain);
       
   126   static void _throw_msg_cause(Thread* thread, const char* file, int line,
       
   127                             Symbol* name, const char* message, Handle cause);
       
   128 
   131 
   129   // There is no THROW... macro for this method. Caller should remember
   132   // There is no THROW... macro for this method. Caller should remember
   130   // to do a return after calling it.
   133   // to do a return after calling it.
   131   static void fthrow(Thread* thread, const char* file, int line, Symbol* name,
   134   static void fthrow(Thread* thread, const char* file, int line, Symbol* name,
   132                      const char* format, ...);
   135                      const char* format, ...);
   133 
   136 
   134   // Create and initialize a new exception
   137   // Create and initialize a new exception
   135   static Handle new_exception(Thread* thread, Symbol* name,
   138   static Handle new_exception(Thread* thread, Symbol* name,
   136                               Symbol* signature, JavaCallArguments* args,
   139                               Symbol* signature, JavaCallArguments* args,
   137                               Handle cause, Handle loader,
   140                               Handle loader, Handle protection_domain);
   138                               Handle protection_domain);
   141 
   139 
   142   static Handle new_exception(Thread* thread, Symbol* name,
   140   static Handle new_exception(Thread* thread, Symbol* name,
   143                               Symbol* signature, JavaCallArguments* args,
   141                               const char* message, Handle cause, Handle loader,
   144                               Handle cause,
   142                               Handle protection_domain,
   145                               Handle loader, Handle protection_domain);
       
   146 
       
   147   static Handle new_exception(Thread* thread, Symbol* name,
       
   148                               Handle cause,
       
   149                               Handle loader, Handle protection_domain,
   143                               ExceptionMsgToUtf8Mode to_utf8_safe = safe_to_utf8);
   150                               ExceptionMsgToUtf8Mode to_utf8_safe = safe_to_utf8);
   144 
   151 
   145  static Handle new_exception(Thread* thread, Symbol* name,
   152   static Handle new_exception(Thread* thread, Symbol* name,
   146                              const char* message,
   153                               const char* message, Handle cause,
   147                              ExceptionMsgToUtf8Mode to_utf8_safe = safe_to_utf8);
   154                               Handle loader, Handle protection_domain,
       
   155                               ExceptionMsgToUtf8Mode to_utf8_safe = safe_to_utf8);
       
   156 
       
   157   static Handle new_exception(Thread* thread, Symbol* name,
       
   158                               const char* message,
       
   159                               ExceptionMsgToUtf8Mode to_utf8_safe = safe_to_utf8);
   148 
   160 
   149   static void throw_stack_overflow_exception(Thread* thread, const char* file, int line, methodHandle method);
   161   static void throw_stack_overflow_exception(Thread* thread, const char* file, int line, methodHandle method);
   150 
   162 
   151   // for AbortVMOnException flag
   163   // for AbortVMOnException flag
   152   NOT_PRODUCT(static void debug_check_abort(Handle exception, const char* message = NULL);)
   164   NOT_PRODUCT(static void debug_check_abort(Handle exception, const char* message = NULL);)
   212   { Exceptions::_throw_msg(THREAD_AND_LOCATION, name, NULL); return;  }
   224   { Exceptions::_throw_msg(THREAD_AND_LOCATION, name, NULL); return;  }
   213 
   225 
   214 #define THROW_MSG(name, message)                    \
   226 #define THROW_MSG(name, message)                    \
   215   { Exceptions::_throw_msg(THREAD_AND_LOCATION, name, message); return;  }
   227   { Exceptions::_throw_msg(THREAD_AND_LOCATION, name, message); return;  }
   216 
   228 
       
   229 #define THROW_CAUSE(name, cause)   \
       
   230   { Exceptions::_throw_cause(THREAD_AND_LOCATION, name, cause); return; }
       
   231 
   217 #define THROW_MSG_LOADER(name, message, loader, protection_domain) \
   232 #define THROW_MSG_LOADER(name, message, loader, protection_domain) \
   218   { Exceptions::_throw_msg(THREAD_AND_LOCATION, name, message, loader, protection_domain); return;  }
   233   { Exceptions::_throw_msg(THREAD_AND_LOCATION, name, message, loader, protection_domain); return;  }
   219 
   234 
   220 #define THROW_ARG(name, signature, args) \
   235 #define THROW_ARG(name, signature, args) \
   221   { Exceptions::_throw_args(THREAD_AND_LOCATION, name, signature, args);   return; }
   236   { Exceptions::_throw_args(THREAD_AND_LOCATION, name, signature, args);   return; }
   222 
       
   223 #define THROW_MSG_CAUSE(name, message, cause) \
       
   224   { Exceptions::_throw_msg_cause(THREAD_AND_LOCATION, name, message, cause); return; }
       
   225 
   237 
   226 #define THROW_OOP_(e, result)                       \
   238 #define THROW_OOP_(e, result)                       \
   227   { Exceptions::_throw_oop(THREAD_AND_LOCATION, e);                           return result; }
   239   { Exceptions::_throw_oop(THREAD_AND_LOCATION, e);                           return result; }
   228 
   240 
   229 #define THROW_HANDLE_(e, result)                       \
   241 #define THROW_HANDLE_(e, result)                       \