Skip to content

Commit 74e981e

Browse files
author
Yudi Zheng
committed
8353735: [JVMCI] Allow specifying storage kind of the callee save register
Reviewed-by: dnsimon, cslucas
1 parent c88f94c commit 74e981e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/RegisterConfig.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2009, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -94,6 +94,16 @@ default int getMaximumFrameSize() {
9494
*/
9595
RegisterArray getCalleeSaveRegisters();
9696

97+
/**
98+
* Returns the storage kind for a callee-save register, which determines how the register is
99+
* saved and restored. For example, according to the Windows x64 ABI, the upper portions of
100+
* XMM0-XMM15 are considered destroyed, so saving the full width of these registers is not
101+
* necessary.
102+
*/
103+
default PlatformKind getCalleeSaveRegisterStorageKind(Architecture arch, Register calleeSaveRegister) {
104+
return arch.getLargestStorableKind(calleeSaveRegister.getRegisterCategory());
105+
}
106+
97107
/**
98108
* Gets a map from register {@linkplain Register#number numbers} to register
99109
* {@linkplain RegisterAttributes attributes} for this register configuration.

0 commit comments

Comments
 (0)