Skip to content
Permalink
Browse files
8275286: Check current thread when calling JRT methods that expect it
Reviewed-by: zgu, coleenp, dholmes
  • Loading branch information
shipilev committed Oct 15, 2021
1 parent c0f3e1d commit ced79091f6ce1791f33c3e5e153eb0535c4d53db
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/hotspot/share/runtime/interfaceSupport.inline.hpp
@@ -300,6 +300,7 @@ class VMNativeEntryWrapper {

#define JRT_ENTRY(result_type, header) \
result_type header { \
assert(current == JavaThread::current(), "Must be"); \
MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, current)); \
ThreadInVMfromJava __tiv(current); \
VM_ENTRY_BASE(result_type, header, current) \
@@ -327,6 +328,7 @@ class VMNativeEntryWrapper {

#define JRT_ENTRY_NO_ASYNC(result_type, header) \
result_type header { \
assert(current == JavaThread::current(), "Must be"); \
MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, current)); \
ThreadInVMfromJava __tiv(current, false /* check asyncs */); \
VM_ENTRY_BASE(result_type, header, current) \
@@ -336,17 +338,20 @@ class VMNativeEntryWrapper {
// to get back into Java from the VM
#define JRT_BLOCK_ENTRY(result_type, header) \
result_type header { \
assert(current == JavaThread::current(), "Must be"); \
MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, current)); \
HandleMarkCleaner __hm(current);

#define JRT_BLOCK \
{ \
assert(current == JavaThread::current(), "Must be"); \
ThreadInVMfromJava __tiv(current); \
JavaThread* THREAD = current; /* For exception macros. */ \
debug_only(VMEntryWrapper __vew;)

#define JRT_BLOCK_NO_ASYNC \
{ \
assert(current == JavaThread::current(), "Must be"); \
ThreadInVMfromJava __tiv(current, false /* check asyncs */); \
JavaThread* THREAD = current; /* For exception macros. */ \
debug_only(VMEntryWrapper __vew;)

1 comment on commit ced7909

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on ced7909 Oct 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.