Skip to content

Commit ec9177f

Browse files
committed
Move WINDOWS_BASE to InternalPlatform.
1 parent b45413c commit ec9177f

File tree

26 files changed

+68
-54
lines changed

26 files changed

+68
-54
lines changed

sdk/src/org.graalvm.nativeimage/snapshot.sigtest

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,14 +421,14 @@ CLSS public abstract interface static org.graalvm.nativeimage.Platform$RISCV64
421421
intf org.graalvm.nativeimage.Platform
422422
meth public java.lang.String getArchitecture()
423423

424-
CLSS public abstract interface static org.graalvm.nativeimage.Platform$WINDOWS_BASE
424+
CLSS public abstract interface static org.graalvm.nativeimage.impl.InternalPlatform$WINDOWS_BASE
425425
outer org.graalvm.nativeimage.Platform
426426
intf org.graalvm.nativeimage.impl.InternalPlatform$NATIVE_ONLY
427427
meth public java.lang.String getOS()
428428

429429
CLSS public abstract interface static org.graalvm.nativeimage.Platform$WINDOWS
430430
outer org.graalvm.nativeimage.Platform
431-
intf org.graalvm.nativeimage.Platform$WINDOWS_BASE
431+
intf org.graalvm.nativeimage.impl.InternalPlatform$WINDOWS_BASE
432432
intf org.graalvm.nativeimage.impl.InternalPlatform$PLATFORM_JNI
433433

434434
CLSS public final static org.graalvm.nativeimage.Platform$WINDOWS_AARCH64

sdk/src/org.graalvm.nativeimage/src/org/graalvm/nativeimage/Platform.java

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -242,29 +242,12 @@ default String getOS() {
242242
}
243243
}
244244

245-
/**
246-
* Supported operating system: Windows, without registering OS-specific providers or making use
247-
* of (or support for) JNI libraries.
248-
*
249-
* @since 25.0
250-
*/
251-
interface WINDOWS_BASE extends InternalPlatform.NATIVE_ONLY {
252-
/**
253-
* Returns string representing WINDOWS OS.
254-
*
255-
* @since 21.0
256-
*/
257-
default String getOS() {
258-
return "windows";
259-
}
260-
}
261-
262245
/**
263246
* Supported operating system: Windows.
264247
*
265248
* @since 19.0
266249
*/
267-
interface WINDOWS extends WINDOWS_BASE, InternalPlatform.PLATFORM_JNI {
250+
interface WINDOWS extends InternalPlatform.WINDOWS_BASE, InternalPlatform.PLATFORM_JNI {
268251
}
269252

270253
/**

sdk/src/org.graalvm.nativeimage/src/org/graalvm/nativeimage/impl/InternalPlatform.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,21 @@ interface PLATFORM_JNI extends Platform {
6060
interface NATIVE_ONLY extends Platform {
6161

6262
}
63+
64+
/**
65+
* Supported operating system: Windows, without registering OS-specific providers or making use
66+
* of (or support for) JNI libraries.
67+
*
68+
* @since 25.0
69+
*/
70+
interface WINDOWS_BASE extends NATIVE_ONLY {
71+
/**
72+
* Returns string representing WINDOWS OS.
73+
*
74+
* @since 21.0
75+
*/
76+
default String getOS() {
77+
return "windows";
78+
}
79+
}
6380
}

substratevm/src/com.oracle.svm.agent/src/com/oracle/svm/agent/NativeImageAgent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ private static String[] getClasspathEntries(JvmtiEnv jvmti) {
514514
if (sep == null) {
515515
if (Platform.includedIn(Platform.LINUX.class) || Platform.includedIn(Platform.DARWIN.class)) {
516516
sep = ":";
517-
} else if (Platform.includedIn(Platform.WINDOWS_BASE.class)) {
517+
} else if (Platform.includedIn(Platform.WINDOWS.class)) {
518518
sep = "[:;]";
519519
} else {
520520
warn("Running on unknown platform. Could not process classpath.");

substratevm/src/com.oracle.svm.core.graal.aarch64/src/com/oracle/svm/core/graal/aarch64/SubstrateAArch64RegisterConfig.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
import java.util.Set;
7373

7474
import org.graalvm.nativeimage.Platform;
75+
import org.graalvm.nativeimage.impl.InternalPlatform;
7576

7677
import com.oracle.svm.core.ReservedRegisters;
7778
import com.oracle.svm.core.aarch64.SubstrateAArch64MacroAssembler;
@@ -163,7 +164,7 @@ public SubstrateAArch64RegisterConfig(ConfigKind config, MetaAccessProvider meta
163164
*
164165
* https://developer.android.com/ndk/guides/abis#arm64-v8a
165166
*/
166-
if (Platform.includedIn(Platform.DARWIN.class) || Platform.includedIn(Platform.WINDOWS_BASE.class) || Platform.includedIn(Platform.ANDROID.class)) {
167+
if (Platform.includedIn(Platform.DARWIN.class) || Platform.includedIn(InternalPlatform.WINDOWS_BASE.class) || Platform.includedIn(Platform.ANDROID.class)) {
167168
regs.remove(r18);
168169
}
169170
allocatableRegs = List.copyOf(regs);

substratevm/src/com.oracle.svm.core.graal.amd64/src/com/oracle/svm/core/graal/amd64/AMD64InterpreterStubs.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import org.graalvm.nativeimage.c.struct.RawField;
3535
import org.graalvm.nativeimage.c.struct.RawStructure;
3636
import org.graalvm.nativeimage.c.struct.SizeOf;
37+
import org.graalvm.nativeimage.impl.InternalPlatform;
3738
import org.graalvm.word.Pointer;
3839
import org.graalvm.word.PointerBase;
3940

@@ -119,7 +120,7 @@ public void enter(CompilationResultBuilder crb) {
119120
masm.movq(createAddress(offsetAbiFpArg6()), fps.get(6));
120121
masm.movq(createAddress(offsetAbiFpArg7()), fps.get(7));
121122
} else {
122-
assert Platform.includedIn(Platform.WINDOWS_BASE.class);
123+
assert Platform.includedIn(InternalPlatform.WINDOWS_BASE.class);
123124
VMError.guarantee(fps.size() == 4);
124125
}
125126

@@ -558,7 +559,7 @@ public long setGpArgumentAt(AllocatableValue ccArg, Pointer data, int pos, long
558559

559560
private static int upperFpEnd() {
560561
/* only 4 floating point regs on Windows, 8 otherwise */
561-
return Platform.includedIn(Platform.WINDOWS_BASE.class) ? 3 : 7;
562+
return Platform.includedIn(InternalPlatform.WINDOWS_BASE.class) ? 3 : 7;
562563
}
563564

564565
@Override

substratevm/src/com.oracle.svm.core.graal.amd64/src/com/oracle/svm/core/graal/amd64/SubstrateAMD64RegisterConfig.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
import java.util.Set;
7474

7575
import org.graalvm.nativeimage.Platform;
76+
import org.graalvm.nativeimage.impl.InternalPlatform;
7677

7778
import com.oracle.svm.core.ReservedRegisters;
7879
import com.oracle.svm.core.SubstrateUtil;
@@ -146,7 +147,7 @@ public SubstrateAMD64RegisterConfig(ConfigKind config, MetaAccessProvider metaAc
146147
}
147148
}
148149

149-
if (Platform.includedIn(Platform.WINDOWS_BASE.class)) {
150+
if (Platform.includedIn(InternalPlatform.WINDOWS_BASE.class)) {
150151
// This is the Windows 64-bit ABI for parameters.
151152
// Note that float parameters also "consume" a general register and vice versa in the
152153
// native ABI.
@@ -195,7 +196,7 @@ public SubstrateAMD64RegisterConfig(ConfigKind config, MetaAccessProvider metaAc
195196
* rbp must be last in the list, so that it gets the location closest to the saved
196197
* return address.
197198
*/
198-
if (Platform.includedIn(Platform.WINDOWS_BASE.class)) {
199+
if (Platform.includedIn(InternalPlatform.WINDOWS_BASE.class)) {
199200
calleeSaveRegisters = List.of(rbx, rdi, rsi, r12, r13, r14, r15, rbp,
200201
xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15);
201202
} else {
@@ -321,7 +322,7 @@ public CallingConvention getCallingConvention(Type t, JavaType returnType, JavaT
321322
JavaKind kind = ObjectLayout.getCallSignatureKind(isEntryPoint, parameterTypes[i], metaAccess, target);
322323
kinds[i] = kind;
323324

324-
if (type.nativeABI() && Platform.includedIn(Platform.WINDOWS_BASE.class)) {
325+
if (type.nativeABI() && Platform.includedIn(InternalPlatform.WINDOWS_BASE.class)) {
325326
// Strictly positional: float parameters consume a general register and vice
326327
// versa
327328
currentGeneral = i;

substratevm/src/com.oracle.svm.core.windows/src/com/oracle/svm/core/windows/headers/WindowsDirectives.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
import org.graalvm.nativeimage.Platform;
3232
import org.graalvm.nativeimage.c.CContext;
33+
import org.graalvm.nativeimage.impl.InternalPlatform;
3334

3435
import com.oracle.svm.core.util.VMError;
3536

@@ -48,12 +49,12 @@ public class WindowsDirectives implements CContext.Directives {
4849

4950
@Override
5051
public boolean isInConfiguration() {
51-
return Platform.includedIn(Platform.WINDOWS_BASE.class);
52+
return Platform.includedIn(InternalPlatform.WINDOWS_BASE.class);
5253
}
5354

5455
@Override
5556
public List<String> getHeaderFiles() {
56-
if (Platform.includedIn(Platform.WINDOWS_BASE.class)) {
57+
if (Platform.includedIn(InternalPlatform.WINDOWS_BASE.class)) {
5758
return new ArrayList<>(Arrays.asList(windowsLibs));
5859
} else {
5960
throw VMError.shouldNotReachHere("Unsupported OS");

substratevm/src/com.oracle.svm.core.windows/src/com/oracle/svm/core/windows/headers/package-info.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
* questions.
2424
*/
2525

26-
@Platforms(Platform.WINDOWS_BASE.class)
26+
@Platforms(InternalPlatform.WINDOWS_BASE.class)
2727
package com.oracle.svm.core.windows.headers;
2828

29-
import org.graalvm.nativeimage.Platform;
3029
import org.graalvm.nativeimage.Platforms;
30+
import org.graalvm.nativeimage.impl.InternalPlatform;

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/DumpRuntimeCompilationOnSignalFeature.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
package com.oracle.svm.core;
2727

2828
import org.graalvm.nativeimage.Platform;
29-
import org.graalvm.nativeimage.Platform.WINDOWS_BASE;
29+
import org.graalvm.nativeimage.impl.InternalPlatform.WINDOWS_BASE;
3030

3131
import com.oracle.svm.core.feature.AutomaticallyRegisteredFeature;
3232
import com.oracle.svm.core.feature.InternalFeature;

0 commit comments

Comments
 (0)