Skip to content

Commit 960ad21

Browse files
committed
8349620: Add VMProps for static JDK
Reviewed-by: alanb, manc
1 parent 735805d commit 960ad21

File tree

6 files changed

+19
-3
lines changed

6 files changed

+19
-3
lines changed

src/hotspot/share/prims/whitebox.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include "gc/shared/gcConfig.hpp"
4848
#include "gc/shared/gcLocker.inline.hpp"
4949
#include "gc/shared/genArguments.hpp"
50+
#include "jvm.h"
5051
#include "jvmtifiles/jvmtiEnv.hpp"
5152
#include "logging/log.hpp"
5253
#include "memory/iterator.hpp"
@@ -1804,6 +1805,10 @@ WB_ENTRY(jlong, WB_RootChunkWordSize(JNIEnv* env))
18041805
return (jlong)Metaspace::reserve_alignment_words();
18051806
WB_END
18061807

1808+
WB_ENTRY(jboolean, WB_IsStaticallyLinked(JNIEnv* env, jobject wb))
1809+
return JVM_IsStaticallyLinked();
1810+
WB_END
1811+
18071812
//////////////
18081813

18091814
WB_ENTRY(jlong, WB_AllocateMetaspace(JNIEnv* env, jobject wb, jobject class_loader, jlong size))
@@ -3003,7 +3008,8 @@ static JNINativeMethod methods[] = {
30033008
{CC"printString", CC"(Ljava/lang/String;I)Ljava/lang/String;", (void*)&WB_PrintString},
30043009
{CC"lockAndStuckInSafepoint", CC"()V", (void*)&WB_TakeLockAndHangInSafepoint},
30053010
{CC"wordSize", CC"()J", (void*)&WB_WordSize},
3006-
{CC"rootChunkWordSize", CC"()J", (void*)&WB_RootChunkWordSize}
3011+
{CC"rootChunkWordSize", CC"()J", (void*)&WB_RootChunkWordSize},
3012+
{CC"isStatic", CC"()Z", (void*)&WB_IsStaticallyLinked}
30073013
};
30083014

30093015

test/hotspot/jtreg/TEST.ROOT

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ requires.properties= \
9292
systemd.support \
9393
jdk.containerized \
9494
jlink.runtime.linkable \
95-
jlink.packagedModules
95+
jlink.packagedModules \
96+
jdk.static
9697

9798
# Minimum jtreg version
9899
requiredVersion=7.5.1+1

test/hotspot/jtreg/runtime/modules/ModulesSymLink.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* @bug 8220095
2828
* @requires os.family == "linux" | os.family == "mac"
2929
* @requires vm.flagless
30+
* @requires !jdk.static
3031
* @library /test/lib
3132
* @modules java.management
3233
* jdk.jlink

test/jdk/TEST.ROOT

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ requires.properties= \
111111
jdk.containerized \
112112
jdk.foreign.linker \
113113
jlink.runtime.linkable \
114-
jlink.packagedModules
114+
jlink.packagedModules \
115+
jdk.static
115116

116117
# Minimum jtreg version
117118
requiredVersion=7.5.1+1

test/jtreg-ext/requires/VMProps.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ public Map<String, String> call() {
140140
map.put("vm.flagless", this::isFlagless);
141141
map.put("jdk.foreign.linker", this::jdkForeignLinker);
142142
map.put("jlink.packagedModules", this::packagedModules);
143+
map.put("jdk.static", this::isStatic);
143144
vmGC(map); // vm.gc.X = true/false
144145
vmGCforCDS(map); // may set vm.gc
145146
vmOptFinalFlags(map);
@@ -820,6 +821,10 @@ private String jdkForeignLinker() {
820821
return String.valueOf(CABI.current());
821822
}
822823

824+
private String isStatic() {
825+
return Boolean.toString(WB.isStatic());
826+
}
827+
823828
/**
824829
* Dumps the map to the file if the file name is given as the property.
825830
* This functionality could be helpful to know context in the real

test/lib/jdk/test/whitebox/WhiteBox.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,4 +798,6 @@ public native int validateCgroup(String procCgroups,
798798

799799
public native void preTouchMemory(long addr, long size);
800800
public native long rss();
801+
802+
public native boolean isStatic();
801803
}

0 commit comments

Comments
 (0)