mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
8191227: issues with unsafe handle resolution
Added ThreadInVMfromNative or ThreadInVMfromUnknown support Reviewed-by: thartmann, vlivanov
This commit is contained in:
parent
925a508b2b
commit
250c05ee4c
2 changed files with 21 additions and 4 deletions
|
@ -28,6 +28,8 @@
|
|||
#include "code/nmethod.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/interfaceSupport.hpp"
|
||||
#include "runtime/thread.hpp"
|
||||
|
||||
// Constructors
|
||||
|
||||
|
@ -209,14 +211,24 @@ void ConstantDoubleValue::print_on(outputStream* st) const {
|
|||
// ConstantOopWriteValue
|
||||
|
||||
void ConstantOopWriteValue::write_on(DebugInfoWriteStream* stream) {
|
||||
assert(JNIHandles::resolve(value()) == NULL ||
|
||||
Universe::heap()->is_in_reserved(JNIHandles::resolve(value())),
|
||||
"Should be in heap");
|
||||
#ifdef ASSERT
|
||||
{
|
||||
// cannot use ThreadInVMfromNative here since in case of JVMCI compiler,
|
||||
// thread is already in VM state.
|
||||
ThreadInVMfromUnknown tiv;
|
||||
assert(JNIHandles::resolve(value()) == NULL ||
|
||||
Universe::heap()->is_in_reserved(JNIHandles::resolve(value())),
|
||||
"Should be in heap");
|
||||
}
|
||||
#endif
|
||||
stream->write_int(CONSTANT_OOP_CODE);
|
||||
stream->write_handle(value());
|
||||
}
|
||||
|
||||
void ConstantOopWriteValue::print_on(outputStream* st) const {
|
||||
// using ThreadInVMfromUnknown here since in case of JVMCI compiler,
|
||||
// thread is already in VM state.
|
||||
ThreadInVMfromUnknown tiv;
|
||||
JNIHandles::resolve(value())->print_value_on(st);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue