annotate graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/CallingConvention.java @ 21556:48c1ebd24120

renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
author Doug Simon <doug.simon@oracle.com>
date Wed, 27 May 2015 00:36:16 +0200
parents graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CallingConvention.java@1cde96b96673
children f5b549811bac
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 /*
4183
9e0c1b4cfef5 Move all isXxx and asXxx out of CiValue and into their own util class.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 3733
diff changeset
2 * Copyright (c) 2009, 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 */
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: 19510
diff changeset
23 package com.oracle.jvmci.code;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
24
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: 19510
diff changeset
25 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: 19510
diff changeset
26 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: 19510
diff changeset
27 import static com.oracle.jvmci.code.ValueUtil.*;
4183
9e0c1b4cfef5 Move all isXxx and asXxx out of CiValue and into their own util class.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 3733
diff changeset
28
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
29
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
30 /**
9742
cff1e11941c0 moved temporaries from CallingConvention to ForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents: 9693
diff changeset
31 * A calling convention describes the locations in which the arguments for a call are placed and the
cff1e11941c0 moved temporaries from CallingConvention to ForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents: 9693
diff changeset
32 * location in which the return value is placed if the call is not void.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
33 */
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5539
diff changeset
34 public class CallingConvention {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
35
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
36 /**
5712
dfcb73ac6ba2 made invalid javadoc cause a JDT error
Doug Simon <doug.simon@oracle.com>
parents: 5711
diff changeset
37 * Constants denoting the type of a call for which a calling convention is requested.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
38 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
39 public enum Type {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
40 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
41 * A request for the outgoing argument locations at a call site to Java code.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
42 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
43 JavaCall(true),
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
44
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
45 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
46 * A request for the incoming argument locations.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
47 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
48 JavaCallee(false),
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
49
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
50 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
51 * A request for the outgoing argument locations at a call site to external native code that
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
52 * complies with the platform ABI.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
53 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
54 NativeCall(true);
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
55
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
56 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
57 * Determines if this is a request for the outgoing argument locations at a call site.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
58 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
59 public final boolean out;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
60
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
61 public static final Type[] VALUES = values();
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
62
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
63 private Type(boolean out) {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
64 this.out = out;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
65 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
66 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
67
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
68 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
69 * The amount of stack space (in bytes) required for the stack-based arguments of the call.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
70 */
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: 5712
diff changeset
71 private final int stackSize;
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: 5712
diff changeset
72
9296
1342574c4f7d Move targets can only be AllocatableValues.
Roland Schatz <roland.schatz@oracle.com>
parents: 7530
diff changeset
73 private final AllocatableValue returnLocation;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
74
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
75 /**
6507
53006ba078d4 refined the API for CallingConvention
Doug Simon <doug.simon@oracle.com>
parents: 6477
diff changeset
76 * The ordered locations in which the arguments are placed.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
77 */
9296
1342574c4f7d Move targets can only be AllocatableValues.
Roland Schatz <roland.schatz@oracle.com>
parents: 7530
diff changeset
78 private final AllocatableValue[] argumentLocations;
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: 5712
diff changeset
79
6477
d93bff9fecb6 added temps used by a call to CallingConvention
Doug Simon <doug.simon@oracle.com>
parents: 6470
diff changeset
80 /**
6507
53006ba078d4 refined the API for CallingConvention
Doug Simon <doug.simon@oracle.com>
parents: 6477
diff changeset
81 * Creates a description of the registers and stack locations used by a call.
19510
1cde96b96673 Fixed code format issues.
Roland Schatz <roland.schatz@oracle.com>
parents: 11775
diff changeset
82 *
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
83 * @param stackSize amount of stack space (in bytes) required for the stack-based arguments of
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
84 * the call
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
85 * @param returnLocation the location for the return value or {@link Value#ILLEGAL} if a void
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6539
diff changeset
86 * call
6507
53006ba078d4 refined the API for CallingConvention
Doug Simon <doug.simon@oracle.com>
parents: 6477
diff changeset
87 * @param argumentLocations the ordered locations in which the arguments are placed
53006ba078d4 refined the API for CallingConvention
Doug Simon <doug.simon@oracle.com>
parents: 6477
diff changeset
88 */
9296
1342574c4f7d Move targets can only be AllocatableValues.
Roland Schatz <roland.schatz@oracle.com>
parents: 7530
diff changeset
89 public CallingConvention(int stackSize, AllocatableValue returnLocation, AllocatableValue... argumentLocations) {
6477
d93bff9fecb6 added temps used by a call to CallingConvention
Doug Simon <doug.simon@oracle.com>
parents: 6470
diff changeset
90 assert argumentLocations != null;
d93bff9fecb6 added temps used by a call to CallingConvention
Doug Simon <doug.simon@oracle.com>
parents: 6470
diff changeset
91 assert returnLocation != null;
d93bff9fecb6 added temps used by a call to CallingConvention
Doug Simon <doug.simon@oracle.com>
parents: 6470
diff changeset
92 this.argumentLocations = argumentLocations;
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: 5712
diff changeset
93 this.stackSize = stackSize;
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: 5712
diff changeset
94 this.returnLocation = returnLocation;
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: 5712
diff changeset
95 assert verify();
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: 5712
diff changeset
96 }
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: 5712
diff changeset
97
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: 5712
diff changeset
98 /**
6539
2463eb24b644 Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 6507
diff changeset
99 * Gets the location for the return value or {@link Value#ILLEGAL} if a void call.
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: 5712
diff changeset
100 */
9296
1342574c4f7d Move targets can only be AllocatableValues.
Roland Schatz <roland.schatz@oracle.com>
parents: 7530
diff changeset
101 public AllocatableValue getReturn() {
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: 5712
diff changeset
102 return returnLocation;
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: 5712
diff changeset
103 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
104
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: 5712
diff changeset
105 /**
6507
53006ba078d4 refined the API for CallingConvention
Doug Simon <doug.simon@oracle.com>
parents: 6477
diff changeset
106 * Gets the location for the {@code index}'th argument.
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: 5712
diff changeset
107 */
9296
1342574c4f7d Move targets can only be AllocatableValues.
Roland Schatz <roland.schatz@oracle.com>
parents: 7530
diff changeset
108 public AllocatableValue getArgument(int index) {
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: 5712
diff changeset
109 return argumentLocations[index];
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: 5712
diff changeset
110 }
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: 5712
diff changeset
111
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: 5712
diff changeset
112 /**
6507
53006ba078d4 refined the API for CallingConvention
Doug Simon <doug.simon@oracle.com>
parents: 6477
diff changeset
113 * Gets the amount of stack space (in bytes) required for the stack-based arguments of the call.
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: 5712
diff changeset
114 */
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: 5712
diff changeset
115 public int getStackSize() {
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: 5712
diff changeset
116 return stackSize;
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: 5712
diff changeset
117 }
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: 5712
diff changeset
118
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: 5712
diff changeset
119 /**
6507
53006ba078d4 refined the API for CallingConvention
Doug Simon <doug.simon@oracle.com>
parents: 6477
diff changeset
120 * Gets the number of locations required for the arguments.
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: 5712
diff changeset
121 */
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: 5712
diff changeset
122 public int getArgumentCount() {
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: 5712
diff changeset
123 return argumentLocations.length;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
124 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
125
6477
d93bff9fecb6 added temps used by a call to CallingConvention
Doug Simon <doug.simon@oracle.com>
parents: 6470
diff changeset
126 /**
9693
d04944441454 cleaned up and simplified runtime call mechanisms
Doug Simon <doug.simon@oracle.com>
parents: 9638
diff changeset
127 * Gets the locations required for the arguments.
d04944441454 cleaned up and simplified runtime call mechanisms
Doug Simon <doug.simon@oracle.com>
parents: 9638
diff changeset
128 */
d04944441454 cleaned up and simplified runtime call mechanisms
Doug Simon <doug.simon@oracle.com>
parents: 9638
diff changeset
129 public AllocatableValue[] getArguments() {
d04944441454 cleaned up and simplified runtime call mechanisms
Doug Simon <doug.simon@oracle.com>
parents: 9638
diff changeset
130 if (argumentLocations.length == 0) {
d04944441454 cleaned up and simplified runtime call mechanisms
Doug Simon <doug.simon@oracle.com>
parents: 9638
diff changeset
131 return argumentLocations;
d04944441454 cleaned up and simplified runtime call mechanisms
Doug Simon <doug.simon@oracle.com>
parents: 9638
diff changeset
132 }
d04944441454 cleaned up and simplified runtime call mechanisms
Doug Simon <doug.simon@oracle.com>
parents: 9638
diff changeset
133 return argumentLocations.clone();
d04944441454 cleaned up and simplified runtime call mechanisms
Doug Simon <doug.simon@oracle.com>
parents: 9638
diff changeset
134 }
d04944441454 cleaned up and simplified runtime call mechanisms
Doug Simon <doug.simon@oracle.com>
parents: 9638
diff changeset
135
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
136 @Override
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
137 public String toString() {
6477
d93bff9fecb6 added temps used by a call to CallingConvention
Doug Simon <doug.simon@oracle.com>
parents: 6470
diff changeset
138 StringBuilder sb = new StringBuilder();
d93bff9fecb6 added temps used by a call to CallingConvention
Doug Simon <doug.simon@oracle.com>
parents: 6470
diff changeset
139 sb.append("CallingConvention[");
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: 5712
diff changeset
140 String sep = "";
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: 5712
diff changeset
141 for (Value op : argumentLocations) {
6477
d93bff9fecb6 added temps used by a call to CallingConvention
Doug Simon <doug.simon@oracle.com>
parents: 6470
diff changeset
142 sb.append(sep).append(op);
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: 5712
diff changeset
143 sep = ", ";
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: 5712
diff changeset
144 }
9638
c455c86138ba Value: more occurrences of object equality replaced
Bernhard Urban <bernhard.urban@jku.at>
parents: 9296
diff changeset
145 if (!returnLocation.equals(Value.ILLEGAL)) {
6477
d93bff9fecb6 added temps used by a call to CallingConvention
Doug Simon <doug.simon@oracle.com>
parents: 6470
diff changeset
146 sb.append(" -> ").append(returnLocation);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
147 }
6477
d93bff9fecb6 added temps used by a call to CallingConvention
Doug Simon <doug.simon@oracle.com>
parents: 6470
diff changeset
148 sb.append("]");
d93bff9fecb6 added temps used by a call to CallingConvention
Doug Simon <doug.simon@oracle.com>
parents: 6470
diff changeset
149 return sb.toString();
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
150 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
151
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
152 private boolean verify() {
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: 5712
diff changeset
153 for (int i = 0; i < argumentLocations.length; i++) {
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: 5712
diff changeset
154 Value location = argumentLocations[i];
11775
b04b94b71649 Finished PTX assembler and Register -> Variable conversion
Morris Meyer <morris.meyer@oracle.com>
parents: 9742
diff changeset
155 assert isStackSlot(location) || isAllocatableValue(location);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
156 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
157 return true;
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 }