0
hotspot/src/share/vm/utilities/exceptions.hpp
에서
에서`__the_thread__` 매크로 란, 몇 가지 코드가있다 :이 OpenJDK8
// The THREAD & TRAPS macros facilitate the declaration of functions that throw exceptions.
// Convention: Use the TRAPS macro as the last argument of such a function; e.g.:
//
// int this_function_may_trap(int x, float y, TRAPS)
#define THREAD __the_thread__
#define TRAPS Thread* THREAD
THREAD
매크로 예외가 던져에만 사용
// The THROW... macros should be used to throw an exception. They require a THREAD variable to be
// visible within the scope containing the THROW. Usually this is achieved by declaring the function
// with a TRAPS argument.
#define THREAD_AND_LOCATION THREAD, __FILE__, __LINE__
#define THROW_OOP(e) \
{ Exceptions::_throw_oop(THREAD_AND_LOCATION, e); return; }
#define THROW_HANDLE(e) \
{ Exceptions::_throw(THREAD_AND_LOCATION, e); return; }
// the real place to use __the_thread__ macro
void Exceptions::_throw(Thread* thread, const char* file, int line, Handle h_exception, const char* message) {......}
그러나, 내가 검색 grep
를 사용을 모든 OpenJDK8의 코드는 여기에 단 한 곳 밖에 없다는 것을 알아 내기 위해 __the_thread__
매크로를 가지고 있습니다. 실제 매크로가 무엇을 정의 할 수 있습니까?