annotate graal/com.oracle.jvmci.hotspot.amd64/src/com/oracle/jvmci/hotspot/amd64/AMD64HotSpotRegisterConfig.java @ 21756:30b4de402a58

Fix a regression caused by the implicit null check changes.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Fri, 05 Jun 2015 17:11:50 +0200
parents e0b5d4fcd929
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
1 /*
16104
4dd2cedc7f57 Revert using LIRKind.reference(Kind.Int) instead of hotspot specific NarrowOop kind (part of c0b8d395368b).
Roland Schatz <roland.schatz@oracle.com>
parents: 16094
diff changeset
2 * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
4 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
8 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
13 * accompanied this code).
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
14 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
18 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
21 * questions.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
22 */
21674
e0b5d4fcd929 moved HotSpotTargetDescription and [AMD64|SPARC]HotSpotRegisterConfig into JVMCI namespace (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21673
diff changeset
23 package com.oracle.jvmci.hotspot.amd64;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
24
21673
5024c80224c7 moved com.oracle.graal.[amd64|sparc] to com.oracle.jvmci.[amd64|sparc] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21556
diff changeset
25 import com.oracle.jvmci.amd64.*;
21556
48c1ebd24120 renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21551
diff changeset
26 import com.oracle.jvmci.code.Register;
48c1ebd24120 renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21551
diff changeset
27 import com.oracle.jvmci.code.RegisterConfig;
48c1ebd24120 renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21551
diff changeset
28 import com.oracle.jvmci.code.TargetDescription;
48c1ebd24120 renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21551
diff changeset
29 import com.oracle.jvmci.code.CallingConvention;
48c1ebd24120 renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21551
diff changeset
30 import com.oracle.jvmci.code.StackSlot;
48c1ebd24120 renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21551
diff changeset
31 import com.oracle.jvmci.code.RegisterAttributes;
48c1ebd24120 renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21551
diff changeset
32 import com.oracle.jvmci.code.CalleeSaveLayout;
48c1ebd24120 renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21551
diff changeset
33 import com.oracle.jvmci.code.Architecture;
48c1ebd24120 renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21551
diff changeset
34 import com.oracle.jvmci.meta.JavaType;
48c1ebd24120 renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21551
diff changeset
35 import com.oracle.jvmci.meta.Value;
48c1ebd24120 renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21551
diff changeset
36 import com.oracle.jvmci.meta.PlatformKind;
48c1ebd24120 renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21551
diff changeset
37 import com.oracle.jvmci.meta.AllocatableValue;
48c1ebd24120 renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21551
diff changeset
38 import com.oracle.jvmci.meta.Kind;
21673
5024c80224c7 moved com.oracle.graal.[amd64|sparc] to com.oracle.jvmci.[amd64|sparc] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21556
diff changeset
39
5024c80224c7 moved com.oracle.graal.[amd64|sparc] to com.oracle.jvmci.[amd64|sparc] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21556
diff changeset
40 import static com.oracle.jvmci.amd64.AMD64.*;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
41
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
42 import java.util.*;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
43
21556
48c1ebd24120 renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21551
diff changeset
44 import com.oracle.jvmci.code.CallingConvention.Type;
21543
93c50cefb9e8 moved GraalInternalError to com.oracle.jvmci.common and renamed it to JVMCIError (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21526
diff changeset
45 import com.oracle.jvmci.common.*;
21551
5324104ac4f3 moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21543
diff changeset
46 import com.oracle.jvmci.hotspot.*;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
47
6494
df02fa2bce58 refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents: 6493
diff changeset
48 public class AMD64HotSpotRegisterConfig implements RegisterConfig {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
49
9425
3ec29630cfb4 Use register categories instead of register flags.
Roland Schatz <roland.schatz@oracle.com>
parents: 9423
diff changeset
50 private final Architecture architecture;
3ec29630cfb4 Use register categories instead of register flags.
Roland Schatz <roland.schatz@oracle.com>
parents: 9423
diff changeset
51
9886
d14b65dac937 Reserve r12 for heap base address when compressed oops are enabled
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9717
diff changeset
52 private final Register[] allocatable;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
53
14989
a0dbb3628f2a Allow limiting maximum frame size in register configuration and bailout if it exceeds the specified limit.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 14906
diff changeset
54 private final int maxFrameSize;
a0dbb3628f2a Allow limiting maximum frame size in register configuration and bailout if it exceeds the specified limit.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 14906
diff changeset
55
13343
5dd9670009df fixed: parameter registers missing from caller saved set if excluded with the RegisterPressure option
Erik Eckstein <erik.eckstein@oracle.com>
parents: 9896
diff changeset
56 /**
21674
e0b5d4fcd929 moved HotSpotTargetDescription and [AMD64|SPARC]HotSpotRegisterConfig into JVMCI namespace (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21673
diff changeset
57 * The caller saved registers always include all parameter registers.
13343
5dd9670009df fixed: parameter registers missing from caller saved set if excluded with the RegisterPressure option
Erik Eckstein <erik.eckstein@oracle.com>
parents: 9896
diff changeset
58 */
5dd9670009df fixed: parameter registers missing from caller saved set if excluded with the RegisterPressure option
Erik Eckstein <erik.eckstein@oracle.com>
parents: 9896
diff changeset
59 private final Register[] callerSaved;
5dd9670009df fixed: parameter registers missing from caller saved set if excluded with the RegisterPressure option
Erik Eckstein <erik.eckstein@oracle.com>
parents: 9896
diff changeset
60
14614
abf7cf57df5e added RegisterConfig.areAllAllocatableRegistersCallerSaved()
Doug Simon <doug.simon@oracle.com>
parents: 14560
diff changeset
61 private final boolean allAllocatableAreCallerSaved;
abf7cf57df5e added RegisterConfig.areAllAllocatableRegistersCallerSaved()
Doug Simon <doug.simon@oracle.com>
parents: 14560
diff changeset
62
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5540
diff changeset
63 private final RegisterAttributes[] attributesMap;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
64
14989
a0dbb3628f2a Allow limiting maximum frame size in register configuration and bailout if it exceeds the specified limit.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 14906
diff changeset
65 public int getMaximumFrameSize() {
a0dbb3628f2a Allow limiting maximum frame size in register configuration and bailout if it exceeds the specified limit.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 14906
diff changeset
66 return maxFrameSize;
a0dbb3628f2a Allow limiting maximum frame size in register configuration and bailout if it exceeds the specified limit.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 14906
diff changeset
67 }
a0dbb3628f2a Allow limiting maximum frame size in register configuration and bailout if it exceeds the specified limit.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 14906
diff changeset
68
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
69 @Override
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5540
diff changeset
70 public Register[] getAllocatableRegisters() {
9414
a58860b72b1f made AMD64HotSpotRegisterConfig return copies of internal arrays to prevent clients from modifying them
Doug Simon <doug.simon@oracle.com>
parents: 9296
diff changeset
71 return allocatable.clone();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
72 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
73
20916
661ed7d3d10d RegisterConfig: rename getAllocatableRegisters(PK,R[) to filterAllocatableRegisters and remove caching from implementors.
Josef Eisl <josef.eisl@jku.at>
parents: 20913
diff changeset
74 public Register[] filterAllocatableRegisters(PlatformKind kind, Register[] registers) {
9425
3ec29630cfb4 Use register categories instead of register flags.
Roland Schatz <roland.schatz@oracle.com>
parents: 9423
diff changeset
75 ArrayList<Register> list = new ArrayList<>();
20913
9b6ea36013c4 RegisterConfig: pass registers array to getAllocatableRegisters(PlatformKind).
Josef Eisl <josef.eisl@jku.at>
parents: 18878
diff changeset
76 for (Register reg : registers) {
16116
9e5a323e0a1e Remove hotspot specific NarrowOop kind, use LIRKind.reference(Kind.Int) instead.
Roland Schatz <roland.schatz@oracle.com>
parents: 16104
diff changeset
77 if (architecture.canStoreValue(reg.getRegisterCategory(), kind)) {
9425
3ec29630cfb4 Use register categories instead of register flags.
Roland Schatz <roland.schatz@oracle.com>
parents: 9423
diff changeset
78 list.add(reg);
3ec29630cfb4 Use register categories instead of register flags.
Roland Schatz <roland.schatz@oracle.com>
parents: 9423
diff changeset
79 }
3ec29630cfb4 Use register categories instead of register flags.
Roland Schatz <roland.schatz@oracle.com>
parents: 9423
diff changeset
80 }
3ec29630cfb4 Use register categories instead of register flags.
Roland Schatz <roland.schatz@oracle.com>
parents: 9423
diff changeset
81
18355
9a11c4086341 size array appropriately when creating categorized register array
Doug Simon <doug.simon@oracle.com>
parents: 16116
diff changeset
82 Register[] ret = list.toArray(new Register[list.size()]);
9425
3ec29630cfb4 Use register categories instead of register flags.
Roland Schatz <roland.schatz@oracle.com>
parents: 9423
diff changeset
83 return ret;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
84 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
85
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
86 @Override
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5540
diff changeset
87 public RegisterAttributes[] getAttributesMap() {
9414
a58860b72b1f made AMD64HotSpotRegisterConfig return copies of internal arrays to prevent clients from modifying them
Doug Simon <doug.simon@oracle.com>
parents: 9296
diff changeset
88 return attributesMap.clone();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
89 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
90
7364
1489cd4eabe7 added support for making calls with the native/C ABI
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
91 private final Register[] javaGeneralParameterRegisters;
1489cd4eabe7 added support for making calls with the native/C ABI
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
92 private final Register[] nativeGeneralParameterRegisters;
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5540
diff changeset
93 private final Register[] xmmParameterRegisters = {xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7};
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
94
18598
d806707624bb amd64 register config: reserve "home space" on windows in frame.
Bernhard Urban <bernhard.urban@jku.at>
parents: 18355
diff changeset
95 /*
d806707624bb amd64 register config: reserve "home space" on windows in frame.
Bernhard Urban <bernhard.urban@jku.at>
parents: 18355
diff changeset
96 * Some ABIs (e.g. Windows) require a so-called "home space", that is a save area on the stack
d806707624bb amd64 register config: reserve "home space" on windows in frame.
Bernhard Urban <bernhard.urban@jku.at>
parents: 18355
diff changeset
97 * to store the argument registers
d806707624bb amd64 register config: reserve "home space" on windows in frame.
Bernhard Urban <bernhard.urban@jku.at>
parents: 18355
diff changeset
98 */
d806707624bb amd64 register config: reserve "home space" on windows in frame.
Bernhard Urban <bernhard.urban@jku.at>
parents: 18355
diff changeset
99 private final boolean needsNativeStackHomeSpace;
d806707624bb amd64 register config: reserve "home space" on windows in frame.
Bernhard Urban <bernhard.urban@jku.at>
parents: 18355
diff changeset
100
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5540
diff changeset
101 private final CalleeSaveLayout csl;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
102
9886
d14b65dac937 Reserve r12 for heap base address when compressed oops are enabled
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9717
diff changeset
103 private static Register[] initAllocatable(boolean reserveForHeapBase) {
d14b65dac937 Reserve r12 for heap base address when compressed oops are enabled
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9717
diff changeset
104 Register[] registers = null;
9717
f8e0bf2c70e2 consolidated the two RegisterConfig instances for HotSpotRuntime into one
Doug Simon <doug.simon@oracle.com>
parents: 9693
diff changeset
105 // @formatter:off
9886
d14b65dac937 Reserve r12 for heap base address when compressed oops are enabled
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9717
diff changeset
106 if (reserveForHeapBase) {
d14b65dac937 Reserve r12 for heap base address when compressed oops are enabled
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9717
diff changeset
107 registers = new Register[] {
d14b65dac937 Reserve r12 for heap base address when compressed oops are enabled
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9717
diff changeset
108 rax, rbx, rcx, rdx, /*rsp,*/ rbp, rsi, rdi, r8, r9, r10, r11, /*r12,*/ r13, r14, /*r15, */
d14b65dac937 Reserve r12 for heap base address when compressed oops are enabled
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9717
diff changeset
109 xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,
d14b65dac937 Reserve r12 for heap base address when compressed oops are enabled
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9717
diff changeset
110 xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15
d14b65dac937 Reserve r12 for heap base address when compressed oops are enabled
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9717
diff changeset
111 };
d14b65dac937 Reserve r12 for heap base address when compressed oops are enabled
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9717
diff changeset
112 } else {
d14b65dac937 Reserve r12 for heap base address when compressed oops are enabled
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9717
diff changeset
113 registers = new Register[] {
8338
16e34a47039b Make r10 allocatable.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 8335
diff changeset
114 rax, rbx, rcx, rdx, /*rsp,*/ rbp, rsi, rdi, r8, r9, r10, r11, r12, r13, r14, /*r15, */
8222
7a81fbcd67bb Debug option to reduce available registers.
Roland Schatz <roland.schatz@oracle.com>
parents: 8140
diff changeset
115 xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,
7a81fbcd67bb Debug option to reduce available registers.
Roland Schatz <roland.schatz@oracle.com>
parents: 8140
diff changeset
116 xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15
9886
d14b65dac937 Reserve r12 for heap base address when compressed oops are enabled
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9717
diff changeset
117 };
d14b65dac937 Reserve r12 for heap base address when compressed oops are enabled
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9717
diff changeset
118 }
d14b65dac937 Reserve r12 for heap base address when compressed oops are enabled
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9717
diff changeset
119 // @formatter:on
d14b65dac937 Reserve r12 for heap base address when compressed oops are enabled
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9717
diff changeset
120 return registers;
8222
7a81fbcd67bb Debug option to reduce available registers.
Roland Schatz <roland.schatz@oracle.com>
parents: 8140
diff changeset
121 }
7a81fbcd67bb Debug option to reduce available registers.
Roland Schatz <roland.schatz@oracle.com>
parents: 8140
diff changeset
122
9717
f8e0bf2c70e2 consolidated the two RegisterConfig instances for HotSpotRuntime into one
Doug Simon <doug.simon@oracle.com>
parents: 9693
diff changeset
123 public AMD64HotSpotRegisterConfig(Architecture architecture, HotSpotVMConfig config) {
15011
c8e575742f36 allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents: 14989
diff changeset
124 this(architecture, config, initAllocatable(config.useCompressedOops));
21674
e0b5d4fcd929 moved HotSpotTargetDescription and [AMD64|SPARC]HotSpotRegisterConfig into JVMCI namespace (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21673
diff changeset
125 assert callerSaved.length >= allocatable.length;
15011
c8e575742f36 allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents: 14989
diff changeset
126 }
c8e575742f36 allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents: 14989
diff changeset
127
c8e575742f36 allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents: 14989
diff changeset
128 public AMD64HotSpotRegisterConfig(Architecture architecture, HotSpotVMConfig config, Register[] allocatable) {
9425
3ec29630cfb4 Use register categories instead of register flags.
Roland Schatz <roland.schatz@oracle.com>
parents: 9423
diff changeset
129 this.architecture = architecture;
14989
a0dbb3628f2a Allow limiting maximum frame size in register configuration and bailout if it exceeds the specified limit.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 14906
diff changeset
130 this.maxFrameSize = config.maxFrameSize;
9425
3ec29630cfb4 Use register categories instead of register flags.
Roland Schatz <roland.schatz@oracle.com>
parents: 9423
diff changeset
131
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
132 if (config.windowsOs) {
9717
f8e0bf2c70e2 consolidated the two RegisterConfig instances for HotSpotRuntime into one
Doug Simon <doug.simon@oracle.com>
parents: 9693
diff changeset
133 javaGeneralParameterRegisters = new Register[]{rdx, r8, r9, rdi, rsi, rcx};
f8e0bf2c70e2 consolidated the two RegisterConfig instances for HotSpotRuntime into one
Doug Simon <doug.simon@oracle.com>
parents: 9693
diff changeset
134 nativeGeneralParameterRegisters = new Register[]{rcx, rdx, r8, r9};
18598
d806707624bb amd64 register config: reserve "home space" on windows in frame.
Bernhard Urban <bernhard.urban@jku.at>
parents: 18355
diff changeset
135 this.needsNativeStackHomeSpace = true;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
136 } else {
9717
f8e0bf2c70e2 consolidated the two RegisterConfig instances for HotSpotRuntime into one
Doug Simon <doug.simon@oracle.com>
parents: 9693
diff changeset
137 javaGeneralParameterRegisters = new Register[]{rsi, rdx, rcx, r8, r9, rdi};
f8e0bf2c70e2 consolidated the two RegisterConfig instances for HotSpotRuntime into one
Doug Simon <doug.simon@oracle.com>
parents: 9693
diff changeset
138 nativeGeneralParameterRegisters = new Register[]{rdi, rsi, rdx, rcx, r8, r9};
18598
d806707624bb amd64 register config: reserve "home space" on windows in frame.
Bernhard Urban <bernhard.urban@jku.at>
parents: 18355
diff changeset
139 this.needsNativeStackHomeSpace = false;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
140 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
141
9717
f8e0bf2c70e2 consolidated the two RegisterConfig instances for HotSpotRuntime into one
Doug Simon <doug.simon@oracle.com>
parents: 9693
diff changeset
142 csl = null;
15011
c8e575742f36 allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents: 14989
diff changeset
143 this.allocatable = allocatable.clone();
13343
5dd9670009df fixed: parameter registers missing from caller saved set if excluded with the RegisterPressure option
Erik Eckstein <erik.eckstein@oracle.com>
parents: 9896
diff changeset
144 Set<Register> callerSaveSet = new HashSet<>();
5dd9670009df fixed: parameter registers missing from caller saved set if excluded with the RegisterPressure option
Erik Eckstein <erik.eckstein@oracle.com>
parents: 9896
diff changeset
145 Collections.addAll(callerSaveSet, allocatable);
5dd9670009df fixed: parameter registers missing from caller saved set if excluded with the RegisterPressure option
Erik Eckstein <erik.eckstein@oracle.com>
parents: 9896
diff changeset
146 Collections.addAll(callerSaveSet, xmmParameterRegisters);
5dd9670009df fixed: parameter registers missing from caller saved set if excluded with the RegisterPressure option
Erik Eckstein <erik.eckstein@oracle.com>
parents: 9896
diff changeset
147 Collections.addAll(callerSaveSet, javaGeneralParameterRegisters);
5dd9670009df fixed: parameter registers missing from caller saved set if excluded with the RegisterPressure option
Erik Eckstein <erik.eckstein@oracle.com>
parents: 9896
diff changeset
148 Collections.addAll(callerSaveSet, nativeGeneralParameterRegisters);
5dd9670009df fixed: parameter registers missing from caller saved set if excluded with the RegisterPressure option
Erik Eckstein <erik.eckstein@oracle.com>
parents: 9896
diff changeset
149 callerSaved = callerSaveSet.toArray(new Register[callerSaveSet.size()]);
5dd9670009df fixed: parameter registers missing from caller saved set if excluded with the RegisterPressure option
Erik Eckstein <erik.eckstein@oracle.com>
parents: 9896
diff changeset
150
14614
abf7cf57df5e added RegisterConfig.areAllAllocatableRegistersCallerSaved()
Doug Simon <doug.simon@oracle.com>
parents: 14560
diff changeset
151 allAllocatableAreCallerSaved = true;
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5540
diff changeset
152 attributesMap = RegisterAttributes.createMap(this, AMD64.allRegisters);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
153 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
154
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
155 @Override
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5540
diff changeset
156 public Register[] getCallerSaveRegisters() {
13343
5dd9670009df fixed: parameter registers missing from caller saved set if excluded with the RegisterPressure option
Erik Eckstein <erik.eckstein@oracle.com>
parents: 9896
diff changeset
157 return callerSaved;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
158 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
159
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
160 @Override
14614
abf7cf57df5e added RegisterConfig.areAllAllocatableRegistersCallerSaved()
Doug Simon <doug.simon@oracle.com>
parents: 14560
diff changeset
161 public boolean areAllAllocatableRegistersCallerSaved() {
abf7cf57df5e added RegisterConfig.areAllAllocatableRegistersCallerSaved()
Doug Simon <doug.simon@oracle.com>
parents: 14560
diff changeset
162 return allAllocatableAreCallerSaved;
abf7cf57df5e added RegisterConfig.areAllAllocatableRegistersCallerSaved()
Doug Simon <doug.simon@oracle.com>
parents: 14560
diff changeset
163 }
abf7cf57df5e added RegisterConfig.areAllAllocatableRegistersCallerSaved()
Doug Simon <doug.simon@oracle.com>
parents: 14560
diff changeset
164
abf7cf57df5e added RegisterConfig.areAllAllocatableRegistersCallerSaved()
Doug Simon <doug.simon@oracle.com>
parents: 14560
diff changeset
165 @Override
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5540
diff changeset
166 public Register getRegisterForRole(int index) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
167 throw new UnsupportedOperationException();
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
168 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
169
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
170 @Override
7300
2912b72d840a More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents: 7098
diff changeset
171 public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target, boolean stackOnly) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
172 if (type == Type.NativeCall) {
7364
1489cd4eabe7 added support for making calls with the native/C ABI
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
173 return callingConvention(nativeGeneralParameterRegisters, returnType, parameterTypes, type, target, stackOnly);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
174 }
9717
f8e0bf2c70e2 consolidated the two RegisterConfig instances for HotSpotRuntime into one
Doug Simon <doug.simon@oracle.com>
parents: 9693
diff changeset
175 // On x64, parameter locations are the same whether viewed
f8e0bf2c70e2 consolidated the two RegisterConfig instances for HotSpotRuntime into one
Doug Simon <doug.simon@oracle.com>
parents: 9693
diff changeset
176 // from the caller or callee perspective
7364
1489cd4eabe7 added support for making calls with the native/C ABI
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
177 return callingConvention(javaGeneralParameterRegisters, returnType, parameterTypes, type, target, stackOnly);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
178 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
179
9425
3ec29630cfb4 Use register categories instead of register flags.
Roland Schatz <roland.schatz@oracle.com>
parents: 9423
diff changeset
180 public Register[] getCallingConventionRegisters(Type type, Kind kind) {
3ec29630cfb4 Use register categories instead of register flags.
Roland Schatz <roland.schatz@oracle.com>
parents: 9423
diff changeset
181 if (architecture.canStoreValue(XMM, kind)) {
6521
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6495
diff changeset
182 return xmmParameterRegisters;
2a0c9f20baa1 consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents: 6495
diff changeset
183 }
9425
3ec29630cfb4 Use register categories instead of register flags.
Roland Schatz <roland.schatz@oracle.com>
parents: 9423
diff changeset
184 assert architecture.canStoreValue(CPU, kind);
7364
1489cd4eabe7 added support for making calls with the native/C ABI
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
185 return type == Type.NativeCall ? nativeGeneralParameterRegisters : javaGeneralParameterRegisters;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
186 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
187
7364
1489cd4eabe7 added support for making calls with the native/C ABI
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
188 private CallingConvention callingConvention(Register[] generalParameterRegisters, JavaType returnType, JavaType[] parameterTypes, Type type, TargetDescription target, boolean stackOnly) {
9296
1342574c4f7d Move targets can only be AllocatableValues.
Roland Schatz <roland.schatz@oracle.com>
parents: 8338
diff changeset
189 AllocatableValue[] locations = new AllocatableValue[parameterTypes.length];
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
190
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
191 int currentGeneral = 0;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
192 int currentXMM = 0;
18598
d806707624bb amd64 register config: reserve "home space" on windows in frame.
Bernhard Urban <bernhard.urban@jku.at>
parents: 18355
diff changeset
193 int currentStackOffset = type == Type.NativeCall && needsNativeStackHomeSpace ? generalParameterRegisters.length * target.wordSize : 0;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
194
7300
2912b72d840a More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents: 7098
diff changeset
195 for (int i = 0; i < parameterTypes.length; i++) {
2912b72d840a More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents: 7098
diff changeset
196 final Kind kind = parameterTypes[i].getKind();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
197
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
198 switch (kind) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
199 case Byte:
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
200 case Boolean:
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
201 case Short:
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
202 case Char:
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
203 case Int:
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
204 case Long:
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
205 case Object:
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
206 if (!stackOnly && currentGeneral < generalParameterRegisters.length) {
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5540
diff changeset
207 Register register = generalParameterRegisters[currentGeneral++];
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 15259
diff changeset
208 locations[i] = register.asValue(target.getLIRKind(kind));
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
209 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
210 break;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
211 case Float:
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
212 case Double:
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
213 if (!stackOnly && currentXMM < xmmParameterRegisters.length) {
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5540
diff changeset
214 Register register = xmmParameterRegisters[currentXMM++];
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 15259
diff changeset
215 locations[i] = register.asValue(target.getLIRKind(kind));
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
216 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
217 break;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
218 default:
21543
93c50cefb9e8 moved GraalInternalError to com.oracle.jvmci.common and renamed it to JVMCIError (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21526
diff changeset
219 throw JVMCIError.shouldNotReachHere();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
220 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
221
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
222 if (locations[i] == null) {
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 15259
diff changeset
223 locations[i] = StackSlot.get(target.getLIRKind(kind.getStackKind()), currentStackOffset, !type.out);
14559
883fbd3e06e0 Make size of PlatformKind overridable by VM specific code.
Roland Schatz <roland.schatz@oracle.com>
parents: 14003
diff changeset
224 currentStackOffset += Math.max(target.getSizeInBytes(kind), target.wordSize);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
225 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
226 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
227
7300
2912b72d840a More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents: 7098
diff changeset
228 Kind returnKind = returnType == null ? Kind.Void : returnType.getKind();
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 15259
diff changeset
229 AllocatableValue returnLocation = returnKind == Kind.Void ? Value.ILLEGAL : getReturnRegister(returnKind).asValue(target.getLIRKind(returnKind.getStackKind()));
6470
b1010f7bc0bf expanded CallingConvention API class to also include the location of the value (if any) returned by a call
Doug Simon <doug.simon@oracle.com>
parents: 6413
diff changeset
230 return new CallingConvention(currentStackOffset, returnLocation, locations);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
231 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
232
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
233 @Override
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5540
diff changeset
234 public Register getReturnRegister(Kind kind) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
235 switch (kind) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
236 case Boolean:
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
237 case Byte:
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
238 case Char:
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
239 case Short:
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
240 case Int:
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
241 case Long:
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
242 case Object:
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
243 return rax;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
244 case Float:
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
245 case Double:
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
246 return xmm0;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
247 case Void:
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
248 case Illegal:
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
249 return null;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
250 default:
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
251 throw new UnsupportedOperationException("no return register for type " + kind);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
252 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
253 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
254
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
255 @Override
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5540
diff changeset
256 public Register getFrameRegister() {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
257 return rsp;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
258 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
259
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5540
diff changeset
260 public CalleeSaveLayout getCalleeSaveLayout() {
5233
efbb1e33e2f3 removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
261 return csl;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
262 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
263
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
264 @Override
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
265 public String toString() {
9717
f8e0bf2c70e2 consolidated the two RegisterConfig instances for HotSpotRuntime into one
Doug Simon <doug.simon@oracle.com>
parents: 9693
diff changeset
266 return String.format("Allocatable: " + Arrays.toString(getAllocatableRegisters()) + "%n" + "CallerSave: " + Arrays.toString(getCallerSaveRegisters()) + "%n");
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
267 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
268 }