8385747: Test gc/g1/TestGCLogMessages.java failed: 'Update Derived Pointers' found in stdout

Reviewed-by: dholmes, tschatzl
This commit is contained in:
Stefan Karlsson 2026-06-02 14:46:25 +00:00
parent e5d8e33205
commit cb502e7993
4 changed files with 21 additions and 1 deletions

View File

@ -747,6 +747,14 @@ WB_ENTRY(void, WB_NMTArenaMalloc(JNIEnv* env, jobject o, jlong arena, jlong size
a->Amalloc(size_t(size));
WB_END
WB_ENTRY(jboolean, WB_isC2Included(JNIEnv* env))
#ifdef COMPILER2
return true;
#else
return false;
#endif
WB_END
static jmethodID reflected_method_to_jmid(JavaThread* thread, JNIEnv* env, jobject method) {
assert(method != nullptr, "method should not be null");
ThreadToNativeFromVM ttn(thread);
@ -2843,6 +2851,7 @@ static JNINativeMethod methods[] = {
{CC"NMTNewArena", CC"(J)J", (void*)&WB_NMTNewArena },
{CC"NMTFreeArena", CC"(J)V", (void*)&WB_NMTFreeArena },
{CC"NMTArenaMalloc", CC"(JJ)V", (void*)&WB_NMTArenaMalloc },
{CC"isC2Included", CC"()Z", (void*)&WB_isC2Included },
{CC"deoptimizeFrames", CC"(Z)I", (void*)&WB_DeoptimizeFrames },
{CC"isFrameDeoptimized", CC"(I)Z", (void*)&WB_IsFrameDeoptimized},
{CC"deoptimizeAll", CC"()V", (void*)&WB_DeoptimizeAll },

View File

@ -86,7 +86,7 @@ public class TestGCLogMessages {
}
public boolean isAvailable() {
return Compiler.isC2Enabled();
return Compiler.isC2Included();
}
}

View File

@ -336,6 +336,8 @@ public class WhiteBox {
// Compiler
public native boolean isC2Included();
public native int matchesMethod(Executable method, String pattern);
public native int matchesInline(Executable method, String pattern);
public native boolean shouldPrintAssembly(Executable method, int comp_level);

View File

@ -34,6 +34,15 @@ public class Compiler {
private static final WhiteBox WB = WhiteBox.getWhiteBox();
/**
* Check if C2 was included in the VM build
*
* @return true if C2 was included in the VM build.
*/
public static boolean isC2Included() {
return WB.isC2Included();
}
/**
* Check if C2 is used as JIT compiler.
*