8254827: JVMCI: Enable it for Windows+AArch64
Reviewed-by: ihse, never, kvn
This commit is contained in:
parent
f64a15d62e
commit
88ee973334
@ -306,7 +306,7 @@ AC_DEFUN_ONCE([JVM_FEATURES_CHECK_GRAAL],
|
|||||||
# Graal is only available where JVMCI is available since it requires JVMCI.
|
# Graal is only available where JVMCI is available since it requires JVMCI.
|
||||||
if test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
|
if test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
elif test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-aarch64"; then
|
elif test "x$OPENJDK_TARGET_CPU" = "xaarch64"; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([no, $OPENJDK_TARGET_CPU])
|
AC_MSG_RESULT([no, $OPENJDK_TARGET_CPU])
|
||||||
@ -340,7 +340,7 @@ AC_DEFUN_ONCE([JVM_FEATURES_CHECK_JVMCI],
|
|||||||
AC_MSG_CHECKING([if platform is supported by JVMCI])
|
AC_MSG_CHECKING([if platform is supported by JVMCI])
|
||||||
if test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
|
if test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
elif test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-aarch64"; then
|
elif test "x$OPENJDK_TARGET_CPU" = "xaarch64"; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([no, $OPENJDK_TARGET_CPU])
|
AC_MSG_RESULT([no, $OPENJDK_TARGET_CPU])
|
||||||
|
@ -21,8 +21,9 @@
|
|||||||
* questions.
|
* questions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "jvmci/jvmci.hpp"
|
#include "precompiled.hpp"
|
||||||
#include "jvmci/jvmciCodeInstaller.hpp"
|
#include "jvmci/jvmci.hpp"
|
||||||
|
#include "jvmci/jvmciCodeInstaller.hpp"
|
||||||
#include "jvmci/jvmciRuntime.hpp"
|
#include "jvmci/jvmciRuntime.hpp"
|
||||||
#include "jvmci/jvmciCompilerToVM.hpp"
|
#include "jvmci/jvmciCompilerToVM.hpp"
|
||||||
#include "jvmci/jvmciJavaClasses.hpp"
|
#include "jvmci/jvmciJavaClasses.hpp"
|
||||||
|
@ -122,7 +122,11 @@ public class AArch64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFac
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static RegisterConfig createRegisterConfig(AArch64HotSpotVMConfig config, TargetDescription target) {
|
private static RegisterConfig createRegisterConfig(AArch64HotSpotVMConfig config, TargetDescription target) {
|
||||||
return new AArch64HotSpotRegisterConfig(target, config.useCompressedOops);
|
// ARMv8 defines r18 as being available to the platform ABI. Windows
|
||||||
|
// and Darwin use it for such. Linux doesn't assign it and thus r18 can
|
||||||
|
// be used as an additional register.
|
||||||
|
boolean canUsePlatformRegister = config.linuxOs;
|
||||||
|
return new AArch64HotSpotRegisterConfig(target, config.useCompressedOops, canUsePlatformRegister);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntime runtime, TargetDescription target, RegisterConfig regConfig) {
|
protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntime runtime, TargetDescription target, RegisterConfig regConfig) {
|
||||||
|
@ -34,6 +34,7 @@ import static jdk.vm.ci.aarch64.AArch64.r7;
|
|||||||
import static jdk.vm.ci.aarch64.AArch64.rscratch1;
|
import static jdk.vm.ci.aarch64.AArch64.rscratch1;
|
||||||
import static jdk.vm.ci.aarch64.AArch64.rscratch2;
|
import static jdk.vm.ci.aarch64.AArch64.rscratch2;
|
||||||
import static jdk.vm.ci.aarch64.AArch64.r12;
|
import static jdk.vm.ci.aarch64.AArch64.r12;
|
||||||
|
import static jdk.vm.ci.aarch64.AArch64.r18;
|
||||||
import static jdk.vm.ci.aarch64.AArch64.r27;
|
import static jdk.vm.ci.aarch64.AArch64.r27;
|
||||||
import static jdk.vm.ci.aarch64.AArch64.r28;
|
import static jdk.vm.ci.aarch64.AArch64.r28;
|
||||||
import static jdk.vm.ci.aarch64.AArch64.r29;
|
import static jdk.vm.ci.aarch64.AArch64.r29;
|
||||||
@ -122,15 +123,21 @@ public class AArch64HotSpotRegisterConfig implements RegisterConfig {
|
|||||||
*/
|
*/
|
||||||
public static final Register metaspaceMethodRegister = r12;
|
public static final Register metaspaceMethodRegister = r12;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The platform ABI can use r18 to carry inter-procedural state (e.g. thread
|
||||||
|
* context). If not defined as such by the platform ABI, it can be used as
|
||||||
|
* additional temporary register.
|
||||||
|
*/
|
||||||
|
public static final Register platformRegister = r18;
|
||||||
public static final Register heapBaseRegister = r27;
|
public static final Register heapBaseRegister = r27;
|
||||||
public static final Register threadRegister = r28;
|
public static final Register threadRegister = r28;
|
||||||
public static final Register fp = r29;
|
public static final Register fp = r29;
|
||||||
|
|
||||||
private static final RegisterArray reservedRegisters = new RegisterArray(rscratch1, rscratch2, threadRegister, fp, lr, r31, zr, sp);
|
private static final RegisterArray reservedRegisters = new RegisterArray(rscratch1, rscratch2, threadRegister, fp, lr, r31, zr, sp);
|
||||||
|
|
||||||
private static RegisterArray initAllocatable(Architecture arch, boolean reserveForHeapBase) {
|
private static RegisterArray initAllocatable(Architecture arch, boolean reserveForHeapBase, boolean canUsePlatformRegister) {
|
||||||
RegisterArray allRegisters = arch.getAvailableValueRegisters();
|
RegisterArray allRegisters = arch.getAvailableValueRegisters();
|
||||||
Register[] registers = new Register[allRegisters.size() - reservedRegisters.size() - (reserveForHeapBase ? 1 : 0)];
|
Register[] registers = new Register[allRegisters.size() - reservedRegisters.size() - (reserveForHeapBase ? 1 : 0) - (!canUsePlatformRegister ? 1 : 0)];
|
||||||
List<Register> reservedRegistersList = reservedRegisters.asList();
|
List<Register> reservedRegistersList = reservedRegisters.asList();
|
||||||
|
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
@ -139,6 +146,9 @@ public class AArch64HotSpotRegisterConfig implements RegisterConfig {
|
|||||||
// skip reserved registers
|
// skip reserved registers
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!canUsePlatformRegister && reg.equals(platformRegister)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
assert !(reg.equals(threadRegister) || reg.equals(fp) || reg.equals(lr) || reg.equals(r31) || reg.equals(zr) || reg.equals(sp));
|
assert !(reg.equals(threadRegister) || reg.equals(fp) || reg.equals(lr) || reg.equals(r31) || reg.equals(zr) || reg.equals(sp));
|
||||||
if (reserveForHeapBase && reg.equals(heapBaseRegister)) {
|
if (reserveForHeapBase && reg.equals(heapBaseRegister)) {
|
||||||
// skip heap base register
|
// skip heap base register
|
||||||
@ -152,8 +162,8 @@ public class AArch64HotSpotRegisterConfig implements RegisterConfig {
|
|||||||
return new RegisterArray(registers);
|
return new RegisterArray(registers);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AArch64HotSpotRegisterConfig(TargetDescription target, boolean useCompressedOops) {
|
public AArch64HotSpotRegisterConfig(TargetDescription target, boolean useCompressedOops, boolean canUsePlatformRegister) {
|
||||||
this(target, initAllocatable(target.arch, useCompressedOops));
|
this(target, initAllocatable(target.arch, useCompressedOops, canUsePlatformRegister));
|
||||||
assert callerSaved.size() >= allocatable.size();
|
assert callerSaved.size() >= allocatable.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user