8252530: Fix inconsistencies in hotspot whitebox

Reviewed-by: dholmes, amenkov
This commit is contained in:
Philippe Marschall 2021-05-12 23:14:30 +00:00 committed by David Holmes
parent 2568d181a7
commit ab17be2835
6 changed files with 21 additions and 17 deletions

View file

@ -1969,7 +1969,7 @@ WB_ENTRY(jboolean, WB_AreOpenArchiveHeapObjectsMapped(JNIEnv* env))
return HeapShared::open_archive_heap_region_mapped(); return HeapShared::open_archive_heap_region_mapped();
WB_END WB_END
WB_ENTRY(jboolean, WB_IsCDSIncludedInVmBuild(JNIEnv* env)) WB_ENTRY(jboolean, WB_IsCDSIncluded(JNIEnv* env))
#if INCLUDE_CDS #if INCLUDE_CDS
return true; return true;
#else #else
@ -1977,7 +1977,7 @@ WB_ENTRY(jboolean, WB_IsCDSIncludedInVmBuild(JNIEnv* env))
#endif // INCLUDE_CDS #endif // INCLUDE_CDS
WB_END WB_END
WB_ENTRY(jboolean, WB_isC2OrJVMCIIncludedInVmBuild(JNIEnv* env)) WB_ENTRY(jboolean, WB_isC2OrJVMCIIncluded(JNIEnv* env))
#if COMPILER2_OR_JVMCI #if COMPILER2_OR_JVMCI
return true; return true;
#else #else
@ -1998,7 +1998,7 @@ WB_ENTRY(jboolean, WB_IsJavaHeapArchiveSupported(JNIEnv* env))
WB_END WB_END
WB_ENTRY(jboolean, WB_IsJFRIncludedInVmBuild(JNIEnv* env)) WB_ENTRY(jboolean, WB_IsJFRIncluded(JNIEnv* env))
#if INCLUDE_JFR #if INCLUDE_JFR
return true; return true;
#else #else
@ -2321,7 +2321,11 @@ WB_ENTRY(void, WB_VerifyFrames(JNIEnv* env, jobject wb, jboolean log))
WB_END WB_END
WB_ENTRY(jboolean, WB_IsJVMTIIncluded(JNIEnv* env, jobject wb)) WB_ENTRY(jboolean, WB_IsJVMTIIncluded(JNIEnv* env, jobject wb))
return INCLUDE_JVMTI ? JNI_TRUE : JNI_FALSE; #if INCLUDE_JVMTI
return JNI_TRUE;
#else
return JNI_FALSE;
#endif
WB_END WB_END
WB_ENTRY(void, WB_WaitUnsafe(JNIEnv* env, jobject wb, jint time)) WB_ENTRY(void, WB_WaitUnsafe(JNIEnv* env, jobject wb, jint time))
@ -2552,9 +2556,9 @@ static JNINativeMethod methods[] = {
{CC"getResolvedReferences", CC"(Ljava/lang/Class;)Ljava/lang/Object;", (void*)&WB_GetResolvedReferences}, {CC"getResolvedReferences", CC"(Ljava/lang/Class;)Ljava/lang/Object;", (void*)&WB_GetResolvedReferences},
{CC"linkClass", CC"(Ljava/lang/Class;)V", (void*)&WB_LinkClass}, {CC"linkClass", CC"(Ljava/lang/Class;)V", (void*)&WB_LinkClass},
{CC"areOpenArchiveHeapObjectsMapped", CC"()Z", (void*)&WB_AreOpenArchiveHeapObjectsMapped}, {CC"areOpenArchiveHeapObjectsMapped", CC"()Z", (void*)&WB_AreOpenArchiveHeapObjectsMapped},
{CC"isCDSIncludedInVmBuild", CC"()Z", (void*)&WB_IsCDSIncludedInVmBuild }, {CC"isCDSIncluded", CC"()Z", (void*)&WB_IsCDSIncluded },
{CC"isJFRIncludedInVmBuild", CC"()Z", (void*)&WB_IsJFRIncludedInVmBuild }, {CC"isJFRIncluded", CC"()Z", (void*)&WB_IsJFRIncluded },
{CC"isC2OrJVMCIIncludedInVmBuild", CC"()Z", (void*)&WB_isC2OrJVMCIIncludedInVmBuild }, {CC"isC2OrJVMCIIncluded", CC"()Z", (void*)&WB_isC2OrJVMCIIncluded },
{CC"isJVMCISupportedByGC", CC"()Z", (void*)&WB_IsJVMCISupportedByGC}, {CC"isJVMCISupportedByGC", CC"()Z", (void*)&WB_IsJVMCISupportedByGC},
{CC"isJavaHeapArchiveSupported", CC"()Z", (void*)&WB_IsJavaHeapArchiveSupported }, {CC"isJavaHeapArchiveSupported", CC"()Z", (void*)&WB_IsJavaHeapArchiveSupported },
{CC"cdsMemoryMappingFailed", CC"()Z", (void*)&WB_CDSMemoryMappingFailed }, {CC"cdsMemoryMappingFailed", CC"()Z", (void*)&WB_CDSMemoryMappingFailed },

View file

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

View file

@ -121,7 +121,7 @@ public class CommandLineFlagCombo {
} }
} }
if (!WhiteBox.getWhiteBox().isJFRIncludedInVmBuild()) if (!WhiteBox.getWhiteBox().isJFRIncluded())
{ {
System.out.println("JFR does not exist"); System.out.println("JFR does not exist");
return true; return true;

View file

@ -327,7 +327,7 @@ public class VMProps implements Callable<Map<String, String>> {
* support. * support.
*/ */
protected String vmHasJFR() { protected String vmHasJFR() {
return "" + WB.isJFRIncludedInVmBuild(); return "" + WB.isJFRIncluded();
} }
/** /**
@ -363,7 +363,7 @@ public class VMProps implements Callable<Map<String, String>> {
* @return true if CDS is supported by the VM to be tested. * @return true if CDS is supported by the VM to be tested.
*/ */
protected String vmCDS() { protected String vmCDS() {
return "" + WB.isCDSIncludedInVmBuild(); return "" + WB.isCDSIncluded();
} }
/** /**

View file

@ -231,7 +231,7 @@ public class WhiteBox {
public native void NMTArenaMalloc(long arena, long size); public native void NMTArenaMalloc(long arena, long size);
// Compiler // Compiler
public native boolean isC2OrJVMCIIncludedInVmBuild(); public native boolean isC2OrJVMCIIncluded();
public native boolean isJVMCISupportedByGC(); public native boolean isJVMCISupportedByGC();
public native int matchesMethod(Executable method, String pattern); public native int matchesMethod(Executable method, String pattern);
@ -591,8 +591,8 @@ public class WhiteBox {
public native boolean isShared(Object o); public native boolean isShared(Object o);
public native boolean isSharedClass(Class<?> c); public native boolean isSharedClass(Class<?> c);
public native boolean areSharedStringsIgnored(); public native boolean areSharedStringsIgnored();
public native boolean isCDSIncludedInVmBuild(); public native boolean isCDSIncluded();
public native boolean isJFRIncludedInVmBuild(); public native boolean isJFRIncluded();
public native boolean isJavaHeapArchiveSupported(); public native boolean isJavaHeapArchiveSupported();
public native Object getResolvedReferences(Class<?> c); public native Object getResolvedReferences(Class<?> c);
public native void linkClass(Class<?> c); public native void linkClass(Class<?> c);

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -39,8 +39,8 @@ public class Compiler {
* *
* @return true if either C2 or JVMCI were included in the VM build. * @return true if either C2 or JVMCI were included in the VM build.
*/ */
public static boolean isC2OrJVMCIIncludedInVmBuild() { public static boolean isC2OrJVMCIIncluded() {
return WB.isC2OrJVMCIIncludedInVmBuild(); return WB.isC2OrJVMCIIncluded();
} }
/** /**