diff --git a/substratevm/src/com.oracle.svm.core.graal.aarch64/src/com/oracle/svm/core/graal/aarch64/SubstrateAArch64RegisterConfig.java b/substratevm/src/com.oracle.svm.core.graal.aarch64/src/com/oracle/svm/core/graal/aarch64/SubstrateAArch64RegisterConfig.java index 22291ee1929..a45118b7ea4 100755 --- a/substratevm/src/com.oracle.svm.core.graal.aarch64/src/com/oracle/svm/core/graal/aarch64/SubstrateAArch64RegisterConfig.java +++ b/substratevm/src/com.oracle.svm.core.graal.aarch64/src/com/oracle/svm/core/graal/aarch64/SubstrateAArch64RegisterConfig.java @@ -296,6 +296,7 @@ public CallingConvention getCallingConvention(Type t, JavaType returnType, JavaT int currentStackOffset = (type.nativeABI() ? nativeParamsStackOffset : target.wordSize); JavaKind[] kinds = new JavaKind[locations.length]; + boolean isDarwinPlatform = Platform.includedIn(Platform.DARWIN.class); for (int i = 0; i < parameterTypes.length; i++) { JavaKind kind = ObjectLayout.getCallSignatureKind(isEntryPoint, (ResolvedJavaType) parameterTypes[i], metaAccess, target); kinds[i] = kind; @@ -340,16 +341,14 @@ public CallingConvention getCallingConvention(Type t, JavaType returnType, JavaT * Darwin deviates from the call standard and requires the caller to extend subword * values. */ - boolean useJavaKind = isEntryPoint && (Platform.includedIn(Platform.LINUX.class) || Platform.includedIn(Platform.WINDOWS.class)); + boolean useJavaKind = isEntryPoint && !isDarwinPlatform; locations[i] = register.asValue(valueKindFactory.getValueKind(useJavaKind ? kind : kind.getStackKind())); } else { if (type.nativeABI()) { - if (Platform.includedIn(Platform.LINUX.class)) { - currentStackOffset = linuxNativeStackParameterAssignment(valueKindFactory, locations, i, kind, currentStackOffset, type.outgoing); - } else if (Platform.includedIn(Platform.DARWIN.class)) { + if (isDarwinPlatform) { currentStackOffset = darwinNativeStackParameterAssignment(valueKindFactory, locations, i, kind, currentStackOffset, type.outgoing); } else { - throw VMError.unsupportedPlatform(); // ExcludeFromJacocoGeneratedReport + currentStackOffset = linuxNativeStackParameterAssignment(valueKindFactory, locations, i, kind, currentStackOffset, type.outgoing); } } else { currentStackOffset = javaStackParameterAssignment(valueKindFactory, locations, i, kind, currentStackOffset, type.outgoing);