Skip to content

Commit

Permalink
[GR-52310] Backport to 23.1: switch aarch64registerconfig to check fo…
Browse files Browse the repository at this point in the history
…r darwin instead of not darwin.

PullRequest: graal/17132
  • Loading branch information
hamzaGhaissi committed Mar 5, 2024
2 parents b13aa2b + 4ad5d74 commit cee7cbd
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit cee7cbd

Please sign in to comment.