8330049: Remove unused AbstractLinker::linkerByteOrder

Reviewed-by: mcimadamore
This commit is contained in:
Jorn Vernee 2024-04-11 20:54:09 +00:00
parent 5808f30b89
commit 0db42906e3
12 changed files with 11 additions and 69 deletions

@ -141,9 +141,6 @@ public abstract sealed class AbstractLinker implements Linker permits LinuxAArch
return SystemLookup.getInstance();
}
/** {@return byte order used by this linker} */
protected abstract ByteOrder linkerByteOrder();
// C spec mandates that variadic arguments smaller than int are promoted to int,
// and float is promoted to double
// See: https://en.cppreference.com/w/c/language/conversion#Default_argument_promotions

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2021, Arm Limited. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -69,11 +69,6 @@ public final class LinuxAArch64Linker extends AbstractLinker {
return CallArranger.LINUX.arrangeUpcall(targetType, function, options);
}
@Override
protected ByteOrder linkerByteOrder() {
return ByteOrder.LITTLE_ENDIAN;
}
@Override
public Map<String, MemoryLayout> canonicalLayouts() {
return CANONICAL_LAYOUTS;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, Arm Limited. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -69,11 +69,6 @@ public final class MacOsAArch64Linker extends AbstractLinker {
return CallArranger.MACOS.arrangeUpcall(targetType, function, options);
}
@Override
protected ByteOrder linkerByteOrder() {
return ByteOrder.LITTLE_ENDIAN;
}
@Override
public Map<String, MemoryLayout> canonicalLayouts() {
return CANONICAL_LAYOUTS;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, Arm Limited. All rights reserved.
* Copyright (c) 2021, 2022, Microsoft. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@ -65,11 +65,6 @@ public final class WindowsAArch64Linker extends AbstractLinker {
return CallArranger.WINDOWS.arrangeUpcall(targetType, function, options);
}
@Override
protected ByteOrder linkerByteOrder() {
return ByteOrder.LITTLE_ENDIAN;
}
@Override
public Map<String, MemoryLayout> canonicalLayouts() {
return CANONICAL_LAYOUTS;

@ -123,11 +123,6 @@ public final class FallbackLinker extends AbstractLinker {
};
}
@Override
protected ByteOrder linkerByteOrder() {
return ByteOrder.nativeOrder();
}
private static MemorySegment makeCif(MethodType methodType, FunctionDescriptor function, LinkerOptions options, Arena scope) {
FFIABI abi = FFIABI.DEFAULT;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -65,7 +65,7 @@ public final class AixPPC64Linker extends AbstractLinker {
if (vl.byteAlignment() != 4) {
throw new IllegalArgumentException("double struct member " + vl + " at offset " + offset + " should be 4-byte aligned");
}
if (vl.order() != linkerByteOrder()) {
if (vl.order() != ByteOrder.BIG_ENDIAN) {
throw new IllegalArgumentException("double struct member " + vl + " at offset " + offset + " has an unexpected byte order");
}
} else {
@ -83,11 +83,6 @@ public final class AixPPC64Linker extends AbstractLinker {
return CallArranger.AIX.arrangeUpcall(targetType, function, options);
}
@Override
protected ByteOrder linkerByteOrder() {
return ByteOrder.BIG_ENDIAN;
}
@Override
public Map<String, MemoryLayout> canonicalLayouts() {
return CANONICAL_LAYOUTS;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -65,11 +65,6 @@ public final class LinuxPPC64Linker extends AbstractLinker {
return CallArranger.ABIv1.arrangeUpcall(targetType, function, options);
}
@Override
protected ByteOrder linkerByteOrder() {
return ByteOrder.BIG_ENDIAN;
}
@Override
public Map<String, MemoryLayout> canonicalLayouts() {
return CANONICAL_LAYOUTS;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -65,11 +65,6 @@ public final class LinuxPPC64leLinker extends AbstractLinker {
return CallArranger.ABIv2.arrangeUpcall(targetType, function, options);
}
@Override
protected ByteOrder linkerByteOrder() {
return ByteOrder.LITTLE_ENDIAN;
}
@Override
public Map<String, MemoryLayout> canonicalLayouts() {
return CANONICAL_LAYOUTS;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, Institute of Software, Chinese Academy of Sciences.
* All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@ -67,11 +67,6 @@ public final class LinuxRISCV64Linker extends AbstractLinker {
return LinuxRISCV64CallArranger.arrangeUpcall(targetType, function, options);
}
@Override
protected ByteOrder linkerByteOrder() {
return ByteOrder.LITTLE_ENDIAN;
}
@Override
public Map<String, MemoryLayout> canonicalLayouts() {
return CANONICAL_LAYOUTS;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023 IBM Corp. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -64,11 +64,6 @@ public final class LinuxS390Linker extends AbstractLinker {
return LinuxS390CallArranger.arrangeUpcall(targetType, function, options);
}
@Override
protected ByteOrder linkerByteOrder() {
return ByteOrder.BIG_ENDIAN;
}
@Override
public Map<String, MemoryLayout> canonicalLayouts() {
return CANONICAL_LAYOUTS;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -67,11 +67,6 @@ public final class SysVx64Linker extends AbstractLinker {
return CallArranger.arrangeUpcall(targetType, function, options);
}
@Override
protected ByteOrder linkerByteOrder() {
return ByteOrder.LITTLE_ENDIAN;
}
@Override
public Map<String, MemoryLayout> canonicalLayouts() {
return CANONICAL_LAYOUTS;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -66,11 +66,6 @@ public final class Windowsx64Linker extends AbstractLinker {
return CallArranger.arrangeUpcall(targetType, function, options);
}
@Override
protected ByteOrder linkerByteOrder() {
return ByteOrder.LITTLE_ENDIAN;
}
@Override
public Map<String, MemoryLayout> canonicalLayouts() {
return CANONICAL_LAYOUTS;