< prev index next >

src/hotspot/share/utilities/exceptions.hpp

Print this page

237 #define CHECK_AND_CLEAR_0                       CHECK_AND_CLEAR_(0)
238 #define CHECK_AND_CLEAR_NH                      CHECK_AND_CLEAR_(Handle())
239 #define CHECK_AND_CLEAR_NULL                    CHECK_AND_CLEAR_(NULL)
240 #define CHECK_AND_CLEAR_false                   CHECK_AND_CLEAR_(false)
241 
242 // CAUTION: These macros clears all exceptions except probable async exceptions j.l.InternalError and j.l.ThreadDeath.
243 // So use it with caution.
244 #define CLEAR_PENDING_NONASYNC_EXCEPTION        (((ThreadShadow*)THREAD)->clear_pending_nonasync_exception())
245 #define CHECK_AND_CLEAR_NONASYNC                THREAD); if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_NONASYNC_EXCEPTION; return; } (void)(0
246 #define CHECK_AND_CLEAR_NONASYNC_(result)       THREAD); if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_NONASYNC_EXCEPTION; return result; } (void)(0
247 #define CHECK_AND_CLEAR_NONASYNC_0              CHECK_AND_CLEAR_NONASYNC_(0)
248 #define CHECK_AND_CLEAR_NONASYNC_NH             CHECK_AND_CLEAR_NONASYNC_(Handle())
249 #define CHECK_AND_CLEAR_NONASYNC_NULL           CHECK_AND_CLEAR_NONASYNC_(NULL)
250 #define CHECK_AND_CLEAR_NONASYNC_false          CHECK_AND_CLEAR_NONASYNC_(false)
251 
252 // The THROW... macros should be used to throw an exception. They require a THREAD variable to be
253 // visible within the scope containing the THROW. Usually this is achieved by declaring the function
254 // with a TRAPS argument.
255 
256 #define THREAD_AND_LOCATION                      THREAD, __FILE__, __LINE__


257 
258 #define THROW_OOP(e)                                \
259   { Exceptions::_throw_oop(THREAD_AND_LOCATION, e);                             return;  }
260 
261 #define THROW_HANDLE(e)                                \
262   { Exceptions::_throw(THREAD_AND_LOCATION, e);                             return;  }
263 
264 #define THROW(name)                                 \
265   { Exceptions::_throw_msg(THREAD_AND_LOCATION, name, NULL); return;  }
266 
267 #define THROW_MSG(name, message)                    \
268   { Exceptions::_throw_msg(THREAD_AND_LOCATION, name, message); return;  }
269 
270 #define THROW_CAUSE(name, cause)   \
271   { Exceptions::_throw_cause(THREAD_AND_LOCATION, name, cause); return; }
272 
273 #define THROW_MSG_LOADER(name, message, loader, protection_domain) \
274   { Exceptions::_throw_msg(THREAD_AND_LOCATION, name, message, loader, protection_domain); return;  }
275 
276 #define THROW_ARG(name, signature, args) \

237 #define CHECK_AND_CLEAR_0                       CHECK_AND_CLEAR_(0)
238 #define CHECK_AND_CLEAR_NH                      CHECK_AND_CLEAR_(Handle())
239 #define CHECK_AND_CLEAR_NULL                    CHECK_AND_CLEAR_(NULL)
240 #define CHECK_AND_CLEAR_false                   CHECK_AND_CLEAR_(false)
241 
242 // CAUTION: These macros clears all exceptions except probable async exceptions j.l.InternalError and j.l.ThreadDeath.
243 // So use it with caution.
244 #define CLEAR_PENDING_NONASYNC_EXCEPTION        (((ThreadShadow*)THREAD)->clear_pending_nonasync_exception())
245 #define CHECK_AND_CLEAR_NONASYNC                THREAD); if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_NONASYNC_EXCEPTION; return; } (void)(0
246 #define CHECK_AND_CLEAR_NONASYNC_(result)       THREAD); if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_NONASYNC_EXCEPTION; return result; } (void)(0
247 #define CHECK_AND_CLEAR_NONASYNC_0              CHECK_AND_CLEAR_NONASYNC_(0)
248 #define CHECK_AND_CLEAR_NONASYNC_NH             CHECK_AND_CLEAR_NONASYNC_(Handle())
249 #define CHECK_AND_CLEAR_NONASYNC_NULL           CHECK_AND_CLEAR_NONASYNC_(NULL)
250 #define CHECK_AND_CLEAR_NONASYNC_false          CHECK_AND_CLEAR_NONASYNC_(false)
251 
252 // The THROW... macros should be used to throw an exception. They require a THREAD variable to be
253 // visible within the scope containing the THROW. Usually this is achieved by declaring the function
254 // with a TRAPS argument.
255 
256 #define THREAD_AND_LOCATION                      THREAD, __FILE__, __LINE__
257 #define THREAD_AND_LOCATION_DECL                 TRAPS, const char* file, int line
258 #define THREAD_AND_LOCATION_ARGS                 THREAD, file, line
259 
260 #define THROW_OOP(e)                                \
261   { Exceptions::_throw_oop(THREAD_AND_LOCATION, e);                             return;  }
262 
263 #define THROW_HANDLE(e)                                \
264   { Exceptions::_throw(THREAD_AND_LOCATION, e);                             return;  }
265 
266 #define THROW(name)                                 \
267   { Exceptions::_throw_msg(THREAD_AND_LOCATION, name, NULL); return;  }
268 
269 #define THROW_MSG(name, message)                    \
270   { Exceptions::_throw_msg(THREAD_AND_LOCATION, name, message); return;  }
271 
272 #define THROW_CAUSE(name, cause)   \
273   { Exceptions::_throw_cause(THREAD_AND_LOCATION, name, cause); return; }
274 
275 #define THROW_MSG_LOADER(name, message, loader, protection_domain) \
276   { Exceptions::_throw_msg(THREAD_AND_LOCATION, name, message, loader, protection_domain); return;  }
277 
278 #define THROW_ARG(name, signature, args) \
< prev index next >