Skip to content

Commit

Permalink
JBR-3393 gc/concurrent_phase_control tests fail in JBR 11
Browse files Browse the repository at this point in the history
Add the W^X (write-or-execute) thread state transition to synthetic tests
in order to make the state change verification code happy.
  • Loading branch information
mkartashev committed Jul 1, 2021
1 parent 84baaca commit 9d7b365
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/hotspot/share/prims/whitebox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ WB_ENTRY(jobjectArray, WB_GetConcurrentGCPhases(JNIEnv* env, jobject o))

ResourceMark rm(thread);
ThreadToNativeFromVM ttn(thread);
Thread::WXExecFromWriteSetter wx_exec;
jclass clazz = env->FindClass(vmSymbols::java_lang_Object()->as_C_string());
CHECK_JNI_EXCEPTION_(env, NULL);

Expand Down
2 changes: 2 additions & 0 deletions test/hotspot/gtest/runtime/test_safefetch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ TEST_VM(os, safefetch_can_use) {

TEST_VM(os, safefetch_positive) {
intptr_t v = pattern;
Thread::WXWriteFromExecSetter wx_write;
intptr_t a = SafeFetchN(&v, 1);
ASSERT_EQ(v, a);
}

TEST_VM(os, safefetch_negative) {
Thread::WXWriteFromExecSetter wx_write;
intptr_t a = SafeFetchN(invalid_address, pattern);
ASSERT_EQ(pattern, a);
a = SafeFetchN(invalid_address, ~pattern);
Expand Down

0 comments on commit 9d7b365

Please sign in to comment.