1.1 --- a/src/share/vm/code/debugInfo.cpp Tue Dec 03 20:13:16 2019 +0300 1.2 +++ b/src/share/vm/code/debugInfo.cpp Mon Nov 27 03:11:38 2017 -0800 1.3 @@ -27,6 +27,8 @@ 1.4 #include "code/debugInfoRec.hpp" 1.5 #include "code/nmethod.hpp" 1.6 #include "runtime/handles.inline.hpp" 1.7 +#include "runtime/interfaceSupport.hpp" 1.8 +#include "runtime/thread.hpp" 1.9 1.10 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 1.11 1.12 @@ -204,14 +206,24 @@ 1.13 // ConstantOopWriteValue 1.14 1.15 void ConstantOopWriteValue::write_on(DebugInfoWriteStream* stream) { 1.16 - assert(JNIHandles::resolve(value()) == NULL || 1.17 - Universe::heap()->is_in_reserved(JNIHandles::resolve(value())), 1.18 - "Should be in heap"); 1.19 +#ifdef ASSERT 1.20 + { 1.21 + // cannot use ThreadInVMfromNative here since in case of JVMCI compiler, 1.22 + // thread is already in VM state. 1.23 + ThreadInVMfromUnknown tiv; 1.24 + assert(JNIHandles::resolve(value()) == NULL || 1.25 + Universe::heap()->is_in_reserved(JNIHandles::resolve(value())), 1.26 + "Should be in heap"); 1.27 + } 1.28 +#endif 1.29 stream->write_int(CONSTANT_OOP_CODE); 1.30 stream->write_handle(value()); 1.31 } 1.32 1.33 void ConstantOopWriteValue::print_on(outputStream* st) const { 1.34 + // using ThreadInVMfromUnknown here since in case of JVMCI compiler, 1.35 + // thread is already in VM state. 1.36 + ThreadInVMfromUnknown tiv; 1.37 JNIHandles::resolve(value())->print_value_on(st); 1.38 } 1.39