< prev index next >

src/hotspot/share/utilities/exceptions.hpp

Print this page




 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, __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) \




 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, __FILE__, __LINE__
 241 #define THREAD_AND_LOCATION_DECL                 TRAPS, const char* file, int line
 242 #define THREAD_AND_LOCATION_ARGS                 THREAD, file, line
 243 
 244 #define THROW_OOP(e)                                \
 245   { Exceptions::_throw_oop(THREAD_AND_LOCATION, e);                             return;  }
 246 
 247 #define THROW_HANDLE(e)                                \
 248   { Exceptions::_throw(THREAD_AND_LOCATION, e);                             return;  }
 249 
 250 #define THROW(name)                                 \
 251   { Exceptions::_throw_msg(THREAD_AND_LOCATION, name, NULL); return;  }
 252 
 253 #define THROW_MSG(name, message)                    \
 254   { Exceptions::_throw_msg(THREAD_AND_LOCATION, name, message); return;  }
 255 
 256 #define THROW_CAUSE(name, cause)   \
 257   { Exceptions::_throw_cause(THREAD_AND_LOCATION, name, cause); return; }
 258 
 259 #define THROW_MSG_LOADER(name, message, loader, protection_domain) \
 260   { Exceptions::_throw_msg(THREAD_AND_LOCATION, name, message, loader, protection_domain); return;  }
 261 
 262 #define THROW_ARG(name, signature, args) \


< prev index next >