Mercurial > hg > graal-jvmci-8
comparison jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterConfig.java @ 22672:1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Thu, 08 Oct 2015 17:28:41 -0700 |
parents | jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/RegisterConfig.java@ec96f33a101d |
children | d63506bb5237 |
comparison
equal
deleted
inserted
replaced
22671:97f30e4d0e95 | 22672:1bbd4a7c274b |
---|---|
1 /* | |
2 * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. | |
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 */ | |
23 package jdk.vm.ci.code; | |
24 | |
25 import jdk.vm.ci.code.CallingConvention.Type; | |
26 import jdk.vm.ci.meta.JavaKind; | |
27 import jdk.vm.ci.meta.JavaType; | |
28 import jdk.vm.ci.meta.PlatformKind; | |
29 | |
30 /** | |
31 * A register configuration binds roles and {@linkplain RegisterAttributes attributes} to physical | |
32 * registers. | |
33 */ | |
34 public interface RegisterConfig { | |
35 | |
36 /** | |
37 * Gets the register to be used for returning a value of a given kind. | |
38 */ | |
39 Register getReturnRegister(JavaKind kind); | |
40 | |
41 /** | |
42 * Gets the maximum allowed size of the frame. | |
43 */ | |
44 default int getMaximumFrameSize() { | |
45 return Integer.MAX_VALUE; | |
46 } | |
47 | |
48 /** | |
49 * Gets the register to which {@link Register#Frame} and {@link Register#CallerFrame} are bound. | |
50 */ | |
51 Register getFrameRegister(); | |
52 | |
53 /** | |
54 * Gets the calling convention describing how arguments are passed. | |
55 * | |
56 * @param type the type of calling convention being requested | |
57 * @param returnType the return type (can be null for methods returning {@code void}) | |
58 * @param parameterTypes the types of the arguments of the call | |
59 * @param target the target platform | |
60 * @param stackOnly ignore registers | |
61 */ | |
62 CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target, boolean stackOnly); | |
63 | |
64 /** | |
65 * Gets the ordered set of registers that are can be used to pass parameters according to a | |
66 * given calling convention. | |
67 * | |
68 * @param type the type of calling convention | |
69 * @param kind specifies what kind of registers is being requested | |
70 * @return the ordered set of registers that may be used to pass parameters in a call conforming | |
71 * to {@code type} | |
72 */ | |
73 Register[] getCallingConventionRegisters(Type type, JavaKind kind); | |
74 | |
75 /** | |
76 * Gets the set of all registers that might be used by the register allocator. | |
77 * | |
78 * To get the set of registers the register allocator is allowed to use see | |
79 * {@link RegisterAllocationConfig#getAllocatableRegisters()} | |
80 */ | |
81 @SuppressWarnings("javadoc") | |
82 Register[] getAllocatableRegisters(); | |
83 | |
84 /** | |
85 * Filters a set of registers and returns only those that can be used by the register allocator | |
86 * for a value of a particular kind. | |
87 */ | |
88 Register[] filterAllocatableRegisters(PlatformKind kind, Register[] registers); | |
89 | |
90 /** | |
91 * Gets the registers whose values must be preserved by a method across any call it makes. | |
92 */ | |
93 Register[] getCallerSaveRegisters(); | |
94 | |
95 /** | |
96 * Gets the registers whose values must be preserved by the callee. | |
97 */ | |
98 Register[] getCalleeSaveRegisters(); | |
99 | |
100 /** | |
101 * Gets a map from register {@linkplain Register#number numbers} to register | |
102 * {@linkplain RegisterAttributes attributes} for this register configuration. | |
103 * | |
104 * @return an array where an element at index i holds the attributes of the register whose | |
105 * number is i | |
106 */ | |
107 RegisterAttributes[] getAttributesMap(); | |
108 | |
109 /** | |
110 * Gets the register corresponding to a runtime-defined role. | |
111 * | |
112 * @param id the identifier of a runtime-defined register role | |
113 * @return the register playing the role specified by {@code id} | |
114 */ | |
115 Register getRegisterForRole(int id); | |
116 | |
117 /** | |
118 * Determines if all {@link #getAllocatableRegisters() allocatable} registers are | |
119 * {@link #getCallerSaveRegisters() caller saved}. | |
120 */ | |
121 boolean areAllAllocatableRegistersCallerSaved(); | |
122 } |