Mercurial > hg > graal-jvmci-8
annotate jvmci/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotRegisterConfig.java @ 22681:c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
author | Stefan Anzinger <stefan.anzinger@oracle.com> |
---|---|
date | Tue, 13 Oct 2015 18:22:26 +0200 |
parents | 4688478ecb7b |
children | 5ba5ff0fda9e |
rev | line source |
---|---|
10459 | 1 /* |
22536
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22535
diff
changeset
|
2 * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. |
10459 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
20 * or visit www.oracle.com if you need additional information or have any | |
21 * questions. | |
22 */ | |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
23 package jdk.vm.ci.hotspot.sparc; |
10459 | 24 |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
25 import static jdk.vm.ci.sparc.SPARC.d0; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
26 import static jdk.vm.ci.sparc.SPARC.d2; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
27 import static jdk.vm.ci.sparc.SPARC.d32; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
28 import static jdk.vm.ci.sparc.SPARC.d34; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
29 import static jdk.vm.ci.sparc.SPARC.d36; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
30 import static jdk.vm.ci.sparc.SPARC.d38; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
31 import static jdk.vm.ci.sparc.SPARC.d4; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
32 import static jdk.vm.ci.sparc.SPARC.d40; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
33 import static jdk.vm.ci.sparc.SPARC.d42; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
34 import static jdk.vm.ci.sparc.SPARC.d44; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
35 import static jdk.vm.ci.sparc.SPARC.d46; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
36 import static jdk.vm.ci.sparc.SPARC.d48; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
37 import static jdk.vm.ci.sparc.SPARC.d50; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
38 import static jdk.vm.ci.sparc.SPARC.d52; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
39 import static jdk.vm.ci.sparc.SPARC.d54; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
40 import static jdk.vm.ci.sparc.SPARC.d56; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
41 import static jdk.vm.ci.sparc.SPARC.d58; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
42 import static jdk.vm.ci.sparc.SPARC.d6; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
43 import static jdk.vm.ci.sparc.SPARC.d60; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
44 import static jdk.vm.ci.sparc.SPARC.d62; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
45 import static jdk.vm.ci.sparc.SPARC.f0; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
46 import static jdk.vm.ci.sparc.SPARC.f1; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
47 import static jdk.vm.ci.sparc.SPARC.f10; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
48 import static jdk.vm.ci.sparc.SPARC.f11; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
49 import static jdk.vm.ci.sparc.SPARC.f12; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
50 import static jdk.vm.ci.sparc.SPARC.f13; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
51 import static jdk.vm.ci.sparc.SPARC.f14; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
52 import static jdk.vm.ci.sparc.SPARC.f15; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
53 import static jdk.vm.ci.sparc.SPARC.f16; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
54 import static jdk.vm.ci.sparc.SPARC.f17; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
55 import static jdk.vm.ci.sparc.SPARC.f18; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
56 import static jdk.vm.ci.sparc.SPARC.f19; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
57 import static jdk.vm.ci.sparc.SPARC.f2; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
58 import static jdk.vm.ci.sparc.SPARC.f20; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
59 import static jdk.vm.ci.sparc.SPARC.f21; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
60 import static jdk.vm.ci.sparc.SPARC.f22; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
61 import static jdk.vm.ci.sparc.SPARC.f23; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
62 import static jdk.vm.ci.sparc.SPARC.f24; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
63 import static jdk.vm.ci.sparc.SPARC.f25; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
64 import static jdk.vm.ci.sparc.SPARC.f26; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
65 import static jdk.vm.ci.sparc.SPARC.f27; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
66 import static jdk.vm.ci.sparc.SPARC.f28; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
67 import static jdk.vm.ci.sparc.SPARC.f29; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
68 import static jdk.vm.ci.sparc.SPARC.f3; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
69 import static jdk.vm.ci.sparc.SPARC.f30; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
70 import static jdk.vm.ci.sparc.SPARC.f31; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
71 import static jdk.vm.ci.sparc.SPARC.f4; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
72 import static jdk.vm.ci.sparc.SPARC.f5; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
73 import static jdk.vm.ci.sparc.SPARC.f6; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
74 import static jdk.vm.ci.sparc.SPARC.f7; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
75 import static jdk.vm.ci.sparc.SPARC.f8; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
76 import static jdk.vm.ci.sparc.SPARC.f9; |
22681
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
77 import static jdk.vm.ci.sparc.SPARC.g0; |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
78 import static jdk.vm.ci.sparc.SPARC.g1; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
79 import static jdk.vm.ci.sparc.SPARC.g2; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
80 import static jdk.vm.ci.sparc.SPARC.g3; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
81 import static jdk.vm.ci.sparc.SPARC.g4; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
82 import static jdk.vm.ci.sparc.SPARC.g5; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
83 import static jdk.vm.ci.sparc.SPARC.g6; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
84 import static jdk.vm.ci.sparc.SPARC.g7; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
85 import static jdk.vm.ci.sparc.SPARC.i0; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
86 import static jdk.vm.ci.sparc.SPARC.i1; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
87 import static jdk.vm.ci.sparc.SPARC.i2; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
88 import static jdk.vm.ci.sparc.SPARC.i3; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
89 import static jdk.vm.ci.sparc.SPARC.i4; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
90 import static jdk.vm.ci.sparc.SPARC.i5; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
91 import static jdk.vm.ci.sparc.SPARC.i6; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
92 import static jdk.vm.ci.sparc.SPARC.i7; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
93 import static jdk.vm.ci.sparc.SPARC.l0; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
94 import static jdk.vm.ci.sparc.SPARC.l1; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
95 import static jdk.vm.ci.sparc.SPARC.l2; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
96 import static jdk.vm.ci.sparc.SPARC.l3; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
97 import static jdk.vm.ci.sparc.SPARC.l4; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
98 import static jdk.vm.ci.sparc.SPARC.l5; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
99 import static jdk.vm.ci.sparc.SPARC.l6; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
100 import static jdk.vm.ci.sparc.SPARC.l7; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
101 import static jdk.vm.ci.sparc.SPARC.o0; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
102 import static jdk.vm.ci.sparc.SPARC.o1; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
103 import static jdk.vm.ci.sparc.SPARC.o2; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
104 import static jdk.vm.ci.sparc.SPARC.o3; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
105 import static jdk.vm.ci.sparc.SPARC.o4; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
106 import static jdk.vm.ci.sparc.SPARC.o5; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
107 import static jdk.vm.ci.sparc.SPARC.o7; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
108 import static jdk.vm.ci.sparc.SPARC.sp; |
10459 | 109 |
22569
ec96f33a101d
updated imports to be explicit and added checkstyle rule to forbid * imports
Doug Simon <doug.simon@oracle.com>
parents:
22557
diff
changeset
|
110 import java.util.ArrayList; |
ec96f33a101d
updated imports to be explicit and added checkstyle rule to forbid * imports
Doug Simon <doug.simon@oracle.com>
parents:
22557
diff
changeset
|
111 import java.util.Arrays; |
ec96f33a101d
updated imports to be explicit and added checkstyle rule to forbid * imports
Doug Simon <doug.simon@oracle.com>
parents:
22557
diff
changeset
|
112 |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
113 import jdk.vm.ci.code.Architecture; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
114 import jdk.vm.ci.code.CallingConvention; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
115 import jdk.vm.ci.code.CallingConvention.Type; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
116 import jdk.vm.ci.code.Register; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
117 import jdk.vm.ci.code.RegisterAttributes; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
118 import jdk.vm.ci.code.RegisterConfig; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
119 import jdk.vm.ci.code.StackSlot; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
120 import jdk.vm.ci.code.TargetDescription; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
121 import jdk.vm.ci.common.JVMCIError; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
122 import jdk.vm.ci.hotspot.HotSpotVMConfig; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
123 import jdk.vm.ci.meta.AllocatableValue; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
124 import jdk.vm.ci.meta.JavaKind; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
125 import jdk.vm.ci.meta.JavaType; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
126 import jdk.vm.ci.meta.LIRKind; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
127 import jdk.vm.ci.meta.PlatformKind; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
128 import jdk.vm.ci.meta.Value; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22654
diff
changeset
|
129 import jdk.vm.ci.sparc.SPARC; |
10459 | 130 |
131 public class SPARCHotSpotRegisterConfig implements RegisterConfig { | |
132 | |
133 private final Architecture architecture; | |
134 | |
135 private final Register[] allocatable; | |
136 | |
137 private final RegisterAttributes[] attributesMap; | |
138 | |
22679
4688478ecb7b
Make space in frame for native callee to spill outgoing parameters
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22672
diff
changeset
|
139 /** |
4688478ecb7b
Make space in frame for native callee to spill outgoing parameters
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22672
diff
changeset
|
140 * Does native code (C++ code) spill arguments in registers to the parent frame? |
4688478ecb7b
Make space in frame for native callee to spill outgoing parameters
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22672
diff
changeset
|
141 */ |
4688478ecb7b
Make space in frame for native callee to spill outgoing parameters
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22672
diff
changeset
|
142 private final boolean addNativeRegisterArgumentSlots; |
4688478ecb7b
Make space in frame for native callee to spill outgoing parameters
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22672
diff
changeset
|
143 |
10459 | 144 @Override |
145 public Register[] getAllocatableRegisters() { | |
146 return allocatable.clone(); | |
147 } | |
148 | |
20916
661ed7d3d10d
RegisterConfig: rename getAllocatableRegisters(PK,R[) to filterAllocatableRegisters and remove caching from implementors.
Josef Eisl <josef.eisl@jku.at>
parents:
20913
diff
changeset
|
149 public Register[] filterAllocatableRegisters(PlatformKind kind, Register[] registers) { |
10459 | 150 ArrayList<Register> list = new ArrayList<>(); |
20913
9b6ea36013c4
RegisterConfig: pass registers array to getAllocatableRegisters(PlatformKind).
Josef Eisl <josef.eisl@jku.at>
parents:
20149
diff
changeset
|
151 for (Register reg : registers) { |
10459 | 152 if (architecture.canStoreValue(reg.getRegisterCategory(), kind)) { |
22681
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
153 list.add(reg); |
10459 | 154 } |
155 } | |
18355
9a11c4086341
size array appropriately when creating categorized register array
Doug Simon <doug.simon@oracle.com>
parents:
16995
diff
changeset
|
156 Register[] ret = list.toArray(new Register[list.size()]); |
10459 | 157 return ret; |
158 } | |
159 | |
160 @Override | |
161 public RegisterAttributes[] getAttributesMap() { | |
162 return attributesMap.clone(); | |
163 } | |
164 | |
10792 | 165 private final Register[] cpuCallerParameterRegisters = {o0, o1, o2, o3, o4, o5}; |
166 private final Register[] cpuCalleeParameterRegisters = {i0, i1, i2, i3, i4, i5}; | |
167 | |
22681
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
168 private final Register[] fpuFloatParameterRegisters = {f0, f1, f2, f3, f4, f5, f6, f7}; |
20149
b1a8928fc4b9
[SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
19534
diff
changeset
|
169 private final Register[] fpuDoubleParameterRegisters = {d0, null, d2, null, d4, null, d6, null}; |
22681
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
170 |
16929
5dc533f7565a
[SPARC] Adding registers f0...f31 to callee saved; fixing allocator test, removing direct acquisition of Unsafe from SPARCHotspotBackend
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
171 // @formatter:off |
5dc533f7565a
[SPARC] Adding registers f0...f31 to callee saved; fixing allocator test, removing direct acquisition of Unsafe from SPARCHotspotBackend
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
172 private final Register[] callerSaveRegisters = |
19534
9299e71df12a
[SPARC] Save all registers for foreign calls
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18630
diff
changeset
|
173 {g1, g2, g3, g4, g5, g6, g7, |
9299e71df12a
[SPARC] Save all registers for foreign calls
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
18630
diff
changeset
|
174 o0, o1, o2, o3, o4, o5, o7, |
16929
5dc533f7565a
[SPARC] Adding registers f0...f31 to callee saved; fixing allocator test, removing direct acquisition of Unsafe from SPARCHotspotBackend
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
175 f0, f1, f2, f3, f4, f5, f6, f7, |
5dc533f7565a
[SPARC] Adding registers f0...f31 to callee saved; fixing allocator test, removing direct acquisition of Unsafe from SPARCHotspotBackend
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
176 f8, f9, f10, f11, f12, f13, f14, f15, |
5dc533f7565a
[SPARC] Adding registers f0...f31 to callee saved; fixing allocator test, removing direct acquisition of Unsafe from SPARCHotspotBackend
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
177 f16, f17, f18, f19, f20, f21, f22, f23, |
16995
4feac7e51f42
[SPARC] Fixing float register allocation
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
16932
diff
changeset
|
178 f24, f25, f26, f27, f28, f29, f30, f31, |
4feac7e51f42
[SPARC] Fixing float register allocation
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
16932
diff
changeset
|
179 d32, d34, d36, d38, d40, d42, d44, d46, |
4feac7e51f42
[SPARC] Fixing float register allocation
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
16932
diff
changeset
|
180 d48, d50, d52, d54, d56, d58, d60, d62}; |
16929
5dc533f7565a
[SPARC] Adding registers f0...f31 to callee saved; fixing allocator test, removing direct acquisition of Unsafe from SPARCHotspotBackend
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16664
diff
changeset
|
181 // @formatter:on |
11233 | 182 |
183 /** | |
184 * Registers saved by the callee. This lists all L and I registers which are saved in the | |
21674
e0b5d4fcd929
moved HotSpotTargetDescription and [AMD64|SPARC]HotSpotRegisterConfig into JVMCI namespace (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21673
diff
changeset
|
185 * register window. |
11233 | 186 */ |
22681
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
187 // @formatter:off |
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
188 private final Register[] calleeSaveRegisters = { |
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
189 l0, l1, l2, l3, l4, l5, l6, l7, |
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
190 i0, i1, i2, i3, i4, i5, i6, i7}; |
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
191 // @formatter:on |
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
192 |
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
193 private static Register[] initAllocatable(Architecture arch, boolean reserveForHeapBase) { |
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
194 Register[] allRegisters = arch.getAvailableValueRegisters(); |
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
195 Register[] registers = new Register[allRegisters.length - (reserveForHeapBase ? 4 : 3)]; |
10686
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
10459
diff
changeset
|
196 |
22681
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
197 int idx = 0; |
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
198 for (Register reg : allRegisters) { |
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
199 if (reg.equals(sp) || reg.equals(g2) || reg.equals(g0)) { |
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
200 // skip g0, stack pointer and thread register |
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
201 continue; |
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
202 } |
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
203 if (reserveForHeapBase && reg.equals(g6)) { |
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
204 // skip heap base register |
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
205 continue; |
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
206 } |
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
207 |
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
208 registers[idx++] = reg; |
10459 | 209 } |
210 | |
22681
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
211 assert idx == registers.length; |
10459 | 212 return registers; |
213 } | |
214 | |
22681
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
215 public SPARCHotSpotRegisterConfig(Architecture arch, HotSpotVMConfig config) { |
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
216 this(arch, initAllocatable(arch, config.useCompressedOops), config); |
15011
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14991
diff
changeset
|
217 } |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14991
diff
changeset
|
218 |
22681
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
219 public SPARCHotSpotRegisterConfig(Architecture arch, Register[] allocatable, HotSpotVMConfig config) { |
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
220 this.architecture = arch; |
15011
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14991
diff
changeset
|
221 this.allocatable = allocatable.clone(); |
10459 | 222 attributesMap = RegisterAttributes.createMap(this, SPARC.allRegisters); |
22679
4688478ecb7b
Make space in frame for native callee to spill outgoing parameters
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22672
diff
changeset
|
223 this.addNativeRegisterArgumentSlots = config.linuxOs; |
10459 | 224 } |
225 | |
226 @Override | |
227 public Register[] getCallerSaveRegisters() { | |
10686
73122b5edf6a
SPARC: Can compile simple methods and do static calls.
twisti
parents:
10459
diff
changeset
|
228 return callerSaveRegisters; |
10459 | 229 } |
230 | |
22431
0a0c0111ecda
Remove unused class CalleeSaveLayout.
Roland Schatz <roland.schatz@oracle.com>
parents:
22406
diff
changeset
|
231 public Register[] getCalleeSaveRegisters() { |
0a0c0111ecda
Remove unused class CalleeSaveLayout.
Roland Schatz <roland.schatz@oracle.com>
parents:
22406
diff
changeset
|
232 return calleeSaveRegisters; |
0a0c0111ecda
Remove unused class CalleeSaveLayout.
Roland Schatz <roland.schatz@oracle.com>
parents:
22406
diff
changeset
|
233 } |
0a0c0111ecda
Remove unused class CalleeSaveLayout.
Roland Schatz <roland.schatz@oracle.com>
parents:
22406
diff
changeset
|
234 |
10459 | 235 @Override |
14614
abf7cf57df5e
added RegisterConfig.areAllAllocatableRegistersCallerSaved()
Doug Simon <doug.simon@oracle.com>
parents:
14559
diff
changeset
|
236 public boolean areAllAllocatableRegistersCallerSaved() { |
abf7cf57df5e
added RegisterConfig.areAllAllocatableRegistersCallerSaved()
Doug Simon <doug.simon@oracle.com>
parents:
14559
diff
changeset
|
237 return false; |
abf7cf57df5e
added RegisterConfig.areAllAllocatableRegistersCallerSaved()
Doug Simon <doug.simon@oracle.com>
parents:
14559
diff
changeset
|
238 } |
abf7cf57df5e
added RegisterConfig.areAllAllocatableRegistersCallerSaved()
Doug Simon <doug.simon@oracle.com>
parents:
14559
diff
changeset
|
239 |
abf7cf57df5e
added RegisterConfig.areAllAllocatableRegistersCallerSaved()
Doug Simon <doug.simon@oracle.com>
parents:
14559
diff
changeset
|
240 @Override |
10459 | 241 public Register getRegisterForRole(int index) { |
242 throw new UnsupportedOperationException(); | |
243 } | |
244 | |
245 @Override | |
246 public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target, boolean stackOnly) { | |
10792 | 247 if (type == Type.JavaCall || type == Type.NativeCall) { |
248 return callingConvention(cpuCallerParameterRegisters, returnType, parameterTypes, type, target, stackOnly); | |
10459 | 249 } |
10792 | 250 if (type == Type.JavaCallee) { |
251 return callingConvention(cpuCalleeParameterRegisters, returnType, parameterTypes, type, target, stackOnly); | |
252 } | |
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
|
253 throw JVMCIError.shouldNotReachHere(); |
10459 | 254 } |
255 | |
22536
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22535
diff
changeset
|
256 public Register[] getCallingConventionRegisters(Type type, JavaKind kind) { |
22604
479228019e48
[SPARC] Remove JavaKind dependency
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22594
diff
changeset
|
257 switch (kind) { |
479228019e48
[SPARC] Remove JavaKind dependency
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22594
diff
changeset
|
258 case Boolean: |
479228019e48
[SPARC] Remove JavaKind dependency
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22594
diff
changeset
|
259 case Byte: |
479228019e48
[SPARC] Remove JavaKind dependency
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22594
diff
changeset
|
260 case Short: |
479228019e48
[SPARC] Remove JavaKind dependency
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22594
diff
changeset
|
261 case Char: |
479228019e48
[SPARC] Remove JavaKind dependency
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22594
diff
changeset
|
262 case Int: |
479228019e48
[SPARC] Remove JavaKind dependency
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22594
diff
changeset
|
263 case Long: |
479228019e48
[SPARC] Remove JavaKind dependency
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22594
diff
changeset
|
264 case Object: |
479228019e48
[SPARC] Remove JavaKind dependency
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22594
diff
changeset
|
265 return type == Type.JavaCallee ? cpuCalleeParameterRegisters : cpuCallerParameterRegisters; |
479228019e48
[SPARC] Remove JavaKind dependency
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22594
diff
changeset
|
266 case Double: |
479228019e48
[SPARC] Remove JavaKind dependency
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22594
diff
changeset
|
267 case Float: |
22681
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
268 return fpuFloatParameterRegisters; |
22604
479228019e48
[SPARC] Remove JavaKind dependency
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22594
diff
changeset
|
269 default: |
479228019e48
[SPARC] Remove JavaKind dependency
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22594
diff
changeset
|
270 throw JVMCIError.shouldNotReachHere("Unknown JavaKind " + kind); |
10459 | 271 } |
272 } | |
273 | |
274 private CallingConvention callingConvention(Register[] generalParameterRegisters, JavaType returnType, JavaType[] parameterTypes, Type type, TargetDescription target, boolean stackOnly) { | |
275 AllocatableValue[] locations = new AllocatableValue[parameterTypes.length]; | |
276 | |
277 int currentGeneral = 0; | |
278 int currentFloating = 0; | |
16637
eda09bc52ab9
[SPARC] Fix handling of overflow parameter on stack.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16634
diff
changeset
|
279 int currentStackOffset = 0; |
10459 | 280 |
281 for (int i = 0; i < parameterTypes.length; i++) { | |
22536
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22535
diff
changeset
|
282 final JavaKind kind = parameterTypes[i].getJavaKind().getStackKind(); |
10459 | 283 |
284 switch (kind) { | |
285 case Byte: | |
286 case Boolean: | |
287 case Short: | |
288 case Char: | |
289 case Int: | |
290 case Long: | |
291 case Object: | |
292 if (!stackOnly && currentGeneral < generalParameterRegisters.length) { | |
293 Register register = generalParameterRegisters[currentGeneral++]; | |
16094
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
15345
diff
changeset
|
294 locations[i] = register.asValue(target.getLIRKind(kind)); |
10459 | 295 } |
296 break; | |
16321
fac4af29aeb8
[SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
15345
diff
changeset
|
297 case Double: |
22681
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
298 if (!stackOnly && currentFloating < fpuFloatParameterRegisters.length) { |
16321
fac4af29aeb8
[SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
15345
diff
changeset
|
299 if (currentFloating % 2 != 0) { |
fac4af29aeb8
[SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
15345
diff
changeset
|
300 // Make register number even to be a double reg |
fac4af29aeb8
[SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
15345
diff
changeset
|
301 currentFloating++; |
fac4af29aeb8
[SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
15345
diff
changeset
|
302 } |
20149
b1a8928fc4b9
[SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
19534
diff
changeset
|
303 Register register = fpuDoubleParameterRegisters[currentFloating]; |
16321
fac4af29aeb8
[SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
15345
diff
changeset
|
304 currentFloating += 2; // Only every second is a double register |
16327
5f01f7c48d40
Merge with 5cdcb94a7cf7d9782107cc582f3e4b50000d5d1f
Stefan Anzinger <stefan.anzinger@gmail.com>
diff
changeset
|
305 locations[i] = register.asValue(target.getLIRKind(kind)); |
16321
fac4af29aeb8
[SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
15345
diff
changeset
|
306 } |
fac4af29aeb8
[SPARC] Fixing lots of float and double issues.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
15345
diff
changeset
|
307 break; |
10459 | 308 case Float: |
22681
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
309 if (!stackOnly && currentFloating < fpuFloatParameterRegisters.length) { |
c278790fa252
[SPARC] Move allocatable register selection out of the Architecture description
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22679
diff
changeset
|
310 Register register = fpuFloatParameterRegisters[currentFloating++]; |
16094
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
15345
diff
changeset
|
311 locations[i] = register.asValue(target.getLIRKind(kind)); |
10459 | 312 } |
313 break; | |
314 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
|
315 throw JVMCIError.shouldNotReachHere(); |
10459 | 316 } |
317 | |
318 if (locations[i] == null) { | |
22557
0a7b7c7274be
[SPARC] Fix problems introduced on refactoring Kind.Object and Value.getKind()
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22536
diff
changeset
|
319 LIRKind lirKind = target.getLIRKind(kind); |
16654
8aa938ab4ac8
[SPARC] Spill slots must be 4 byte aligned
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16637
diff
changeset
|
320 // Stack slot is always aligned to its size in bytes but minimum wordsize |
22594
355c41327aea
Remove TargetDescription.getSizeInBytes method.
Roland Schatz <roland.schatz@oracle.com>
parents:
22569
diff
changeset
|
321 int typeSize = lirKind.getPlatformKind().getSizeInBytes(); |
21674
e0b5d4fcd929
moved HotSpotTargetDescription and [AMD64|SPARC]HotSpotRegisterConfig into JVMCI namespace (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21673
diff
changeset
|
322 currentStackOffset = roundUp(currentStackOffset, typeSize); |
22144
7ae8ad713862
[SPARC] Do not preset SPARCFrameMap.initialSpillsize for register save area; set calleeSaveAreaSize correctly instead
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22054
diff
changeset
|
323 int slotOffset = currentStackOffset + SPARC.REGISTER_SAFE_AREA_SIZE; |
22557
0a7b7c7274be
[SPARC] Fix problems introduced on refactoring Kind.Object and Value.getKind()
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22536
diff
changeset
|
324 locations[i] = StackSlot.get(lirKind, slotOffset, !type.out); |
16637
eda09bc52ab9
[SPARC] Fix handling of overflow parameter on stack.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
16634
diff
changeset
|
325 currentStackOffset += typeSize; |
10459 | 326 } |
327 } | |
328 | |
22536
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22535
diff
changeset
|
329 JavaKind returnKind = returnType == null ? JavaKind.Void : returnType.getJavaKind(); |
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22535
diff
changeset
|
330 AllocatableValue returnLocation = returnKind == JavaKind.Void ? Value.ILLEGAL : getReturnRegister(returnKind, type).asValue(target.getLIRKind(returnKind.getStackKind())); |
22679
4688478ecb7b
Make space in frame for native callee to spill outgoing parameters
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22672
diff
changeset
|
331 |
4688478ecb7b
Make space in frame for native callee to spill outgoing parameters
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22672
diff
changeset
|
332 int outArgSpillArea; |
4688478ecb7b
Make space in frame for native callee to spill outgoing parameters
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22672
diff
changeset
|
333 if (type == Type.NativeCall && addNativeRegisterArgumentSlots) { |
4688478ecb7b
Make space in frame for native callee to spill outgoing parameters
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22672
diff
changeset
|
334 // Space for native callee which may spill our outgoing arguments |
4688478ecb7b
Make space in frame for native callee to spill outgoing parameters
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22672
diff
changeset
|
335 outArgSpillArea = Math.min(locations.length, generalParameterRegisters.length) * target.wordSize; |
4688478ecb7b
Make space in frame for native callee to spill outgoing parameters
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22672
diff
changeset
|
336 } else { |
4688478ecb7b
Make space in frame for native callee to spill outgoing parameters
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22672
diff
changeset
|
337 outArgSpillArea = 0; |
4688478ecb7b
Make space in frame for native callee to spill outgoing parameters
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22672
diff
changeset
|
338 } |
4688478ecb7b
Make space in frame for native callee to spill outgoing parameters
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
22672
diff
changeset
|
339 return new CallingConvention(currentStackOffset + outArgSpillArea, returnLocation, locations); |
10459 | 340 } |
341 | |
21674
e0b5d4fcd929
moved HotSpotTargetDescription and [AMD64|SPARC]HotSpotRegisterConfig into JVMCI namespace (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21673
diff
changeset
|
342 private static int roundUp(int number, int mod) { |
e0b5d4fcd929
moved HotSpotTargetDescription and [AMD64|SPARC]HotSpotRegisterConfig into JVMCI namespace (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21673
diff
changeset
|
343 return ((number + mod - 1) / mod) * mod; |
e0b5d4fcd929
moved HotSpotTargetDescription and [AMD64|SPARC]HotSpotRegisterConfig into JVMCI namespace (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21673
diff
changeset
|
344 } |
e0b5d4fcd929
moved HotSpotTargetDescription and [AMD64|SPARC]HotSpotRegisterConfig into JVMCI namespace (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21673
diff
changeset
|
345 |
10459 | 346 @Override |
22536
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22535
diff
changeset
|
347 public Register getReturnRegister(JavaKind kind) { |
10871
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
10854
diff
changeset
|
348 return getReturnRegister(kind, Type.JavaCallee); |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
10854
diff
changeset
|
349 } |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
10854
diff
changeset
|
350 |
22536
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22535
diff
changeset
|
351 private static Register getReturnRegister(JavaKind kind, Type type) { |
10459 | 352 switch (kind) { |
353 case Boolean: | |
354 case Byte: | |
355 case Char: | |
356 case Short: | |
357 case Int: | |
358 case Long: | |
359 case Object: | |
10871
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
10854
diff
changeset
|
360 return type == Type.JavaCallee ? i0 : o0; |
10459 | 361 case Float: |
20149
b1a8928fc4b9
[SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
19534
diff
changeset
|
362 return f0; |
10459 | 363 case Double: |
20149
b1a8928fc4b9
[SPARC] Implement new instructions in assembler/enhance assertion error-message in MoveResolver
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
19534
diff
changeset
|
364 return d0; |
10459 | 365 case Void: |
366 case Illegal: | |
367 return null; | |
368 default: | |
369 throw new UnsupportedOperationException("no return register for type " + kind); | |
370 } | |
371 } | |
372 | |
373 @Override | |
374 public Register getFrameRegister() { | |
375 return sp; | |
376 } | |
377 | |
378 @Override | |
379 public String toString() { | |
380 return String.format("Allocatable: " + Arrays.toString(getAllocatableRegisters()) + "%n" + "CallerSave: " + Arrays.toString(getCallerSaveRegisters()) + "%n"); | |
381 } | |
382 } |