--- old/src/share/vm/runtime/thread.hpp 2015-09-01 21:16:46.000000000 -0700 +++ new/src/share/vm/runtime/thread.hpp 2015-09-01 21:16:46.000000000 -0700 @@ -368,9 +368,14 @@ inline void clear_critical_native_unlock(); // Support for Unhandled Oop detection -#ifdef CHECK_UNHANDLED_OOPS +#ifdef ASSERT private: UnhandledOops* _unhandled_oops; +#endif +#ifdef CHECK_UNHANDLED_OOPS +#ifndef ASSERT +#error "CHECK_UNHANDLED_OOPS should be defined only in debug VM" +#endif public: UnhandledOops* unhandled_oops() { return _unhandled_oops; } // Mark oop safe for gc. It may be stack allocated but won't move.