220 221 #define CHECK THREAD); if (HAS_PENDING_EXCEPTION) return ; (void)(0 222 #define CHECK_(result) THREAD); if (HAS_PENDING_EXCEPTION) return result; (void)(0 223 #define CHECK_0 CHECK_(0) 224 #define CHECK_NH CHECK_(Handle()) 225 #define CHECK_NULL CHECK_(NULL) 226 #define CHECK_false CHECK_(false) 227 #define CHECK_JNI_ERR CHECK_(JNI_ERR) 228 229 #define CHECK_AND_CLEAR THREAD); if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_EXCEPTION; return; } (void)(0 230 #define CHECK_AND_CLEAR_(result) THREAD); if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_EXCEPTION; return result; } (void)(0 231 #define CHECK_AND_CLEAR_0 CHECK_AND_CLEAR_(0) 232 #define CHECK_AND_CLEAR_NH CHECK_AND_CLEAR_(Handle()) 233 #define CHECK_AND_CLEAR_NULL CHECK_AND_CLEAR_(NULL) 234 #define CHECK_AND_CLEAR_false CHECK_AND_CLEAR_(false) 235 236 // The THROW... macros should be used to throw an exception. They require a THREAD variable to be 237 // visible within the scope containing the THROW. Usually this is achieved by declaring the function 238 // with a TRAPS argument. 239 240 #ifdef THIS_FILE 241 #define THREAD_AND_LOCATION THREAD, THIS_FILE, __LINE__ 242 #else 243 #define THREAD_AND_LOCATION THREAD, __FILE__, __LINE__ 244 #endif 245 246 #define THROW_OOP(e) \ 247 { Exceptions::_throw_oop(THREAD_AND_LOCATION, e); return; } 248 249 #define THROW_HANDLE(e) \ 250 { Exceptions::_throw(THREAD_AND_LOCATION, e); return; } 251 252 #define THROW(name) \ 253 { Exceptions::_throw_msg(THREAD_AND_LOCATION, name, NULL); return; } 254 255 #define THROW_MSG(name, message) \ 256 { Exceptions::_throw_msg(THREAD_AND_LOCATION, name, message); return; } 257 258 #define THROW_CAUSE(name, cause) \ 259 { Exceptions::_throw_cause(THREAD_AND_LOCATION, name, cause); return; } 260 261 #define THROW_MSG_LOADER(name, message, loader, protection_domain) \ 262 { Exceptions::_throw_msg(THREAD_AND_LOCATION, name, message, loader, protection_domain); return; } 263 264 #define THROW_ARG(name, signature, args) \ | 220 221 #define CHECK THREAD); if (HAS_PENDING_EXCEPTION) return ; (void)(0 222 #define CHECK_(result) THREAD); if (HAS_PENDING_EXCEPTION) return result; (void)(0 223 #define CHECK_0 CHECK_(0) 224 #define CHECK_NH CHECK_(Handle()) 225 #define CHECK_NULL CHECK_(NULL) 226 #define CHECK_false CHECK_(false) 227 #define CHECK_JNI_ERR CHECK_(JNI_ERR) 228 229 #define CHECK_AND_CLEAR THREAD); if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_EXCEPTION; return; } (void)(0 230 #define CHECK_AND_CLEAR_(result) THREAD); if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_EXCEPTION; return result; } (void)(0 231 #define CHECK_AND_CLEAR_0 CHECK_AND_CLEAR_(0) 232 #define CHECK_AND_CLEAR_NH CHECK_AND_CLEAR_(Handle()) 233 #define CHECK_AND_CLEAR_NULL CHECK_AND_CLEAR_(NULL) 234 #define CHECK_AND_CLEAR_false CHECK_AND_CLEAR_(false) 235 236 // The THROW... macros should be used to throw an exception. They require a THREAD variable to be 237 // visible within the scope containing the THROW. Usually this is achieved by declaring the function 238 // with a TRAPS argument. 239 240 #define THREAD_AND_LOCATION THREAD, THIS_FILE, __LINE__ 241 242 #define THROW_OOP(e) \ 243 { Exceptions::_throw_oop(THREAD_AND_LOCATION, e); return; } 244 245 #define THROW_HANDLE(e) \ 246 { Exceptions::_throw(THREAD_AND_LOCATION, e); return; } 247 248 #define THROW(name) \ 249 { Exceptions::_throw_msg(THREAD_AND_LOCATION, name, NULL); return; } 250 251 #define THROW_MSG(name, message) \ 252 { Exceptions::_throw_msg(THREAD_AND_LOCATION, name, message); return; } 253 254 #define THROW_CAUSE(name, cause) \ 255 { Exceptions::_throw_cause(THREAD_AND_LOCATION, name, cause); return; } 256 257 #define THROW_MSG_LOADER(name, message, loader, protection_domain) \ 258 { Exceptions::_throw_msg(THREAD_AND_LOCATION, name, message, loader, protection_domain); return; } 259 260 #define THROW_ARG(name, signature, args) \ |