Mercurial > hg > graal-jvmci-8
annotate jvmci/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Signature.java @ 23714:c351824fff81
Add IllegalValueKind.toString
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Thu, 23 Jun 2016 09:18:05 -0700 |
parents | 1c4b6a7f1917 |
children |
rev | line source |
---|---|
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 /* |
22536
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22054
diff
changeset
|
2 * Copyright (c) 2009, 2015, 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 */ |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22536
diff
changeset
|
23 package jdk.vm.ci.meta; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
24 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
25 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
26 * Represents a method signature provided by the runtime. |
16483
3c3cd36a3836
moved signatureToMethodDescriptor(Signature sig) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
7676
diff
changeset
|
27 * |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7359
diff
changeset
|
28 * @see <a href="http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.3.3">Method |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7359
diff
changeset
|
29 * Descriptors</a> |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
30 */ |
18530
2906b3cc3e2f
moved application of Remote marker interface to implementation classes only
Doug Simon <doug.simon@oracle.com>
parents:
18374
diff
changeset
|
31 public interface Signature { |
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:
6403
diff
changeset
|
32 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
33 /** |
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:
6403
diff
changeset
|
34 * Returns the number of parameters in this signature, adding 1 for a receiver if requested. |
16483
3c3cd36a3836
moved signatureToMethodDescriptor(Signature sig) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
7676
diff
changeset
|
35 * |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
36 * @param receiver true if 1 is to be added to the result for a receiver |
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:
6403
diff
changeset
|
37 * @return the number of parameters; + 1 iff {@code receiver == true} |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
38 */ |
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:
6403
diff
changeset
|
39 int getParameterCount(boolean receiver); |
3733
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 /** |
16492
8853b9304083
made type resolution require an accessing class context
Doug Simon <doug.simon@oracle.com>
parents:
16484
diff
changeset
|
42 * Gets the parameter type at the specified position. |
16483
3c3cd36a3836
moved signatureToMethodDescriptor(Signature sig) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
7676
diff
changeset
|
43 * |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
44 * @param index the index into the parameters, with {@code 0} indicating the first parameter |
16492
8853b9304083
made type resolution require an accessing class context
Doug Simon <doug.simon@oracle.com>
parents:
16484
diff
changeset
|
45 * @param accessingClass the context of the type lookup. If non-null, its class loader is used |
8853b9304083
made type resolution require an accessing class context
Doug Simon <doug.simon@oracle.com>
parents:
16484
diff
changeset
|
46 * for resolving the type. If {@code null}, then the type returned is either |
8853b9304083
made type resolution require an accessing class context
Doug Simon <doug.simon@oracle.com>
parents:
16484
diff
changeset
|
47 * unresolved or a resolved type whose resolution is context free (e.g., a primitive |
8853b9304083
made type resolution require an accessing class context
Doug Simon <doug.simon@oracle.com>
parents:
16484
diff
changeset
|
48 * type or a type in a java.* package). |
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:
6403
diff
changeset
|
49 * @return the {@code index}'th parameter type |
16492
8853b9304083
made type resolution require an accessing class context
Doug Simon <doug.simon@oracle.com>
parents:
16484
diff
changeset
|
50 * @throws LinkageError if {@code accessingClass != null} and resolution fails |
8853b9304083
made type resolution require an accessing class context
Doug Simon <doug.simon@oracle.com>
parents:
16484
diff
changeset
|
51 * |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
52 */ |
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:
6403
diff
changeset
|
53 JavaType getParameterType(int index, ResolvedJavaType accessingClass); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
54 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
55 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7359
diff
changeset
|
56 * Gets the parameter kind at the specified position. This is the same as calling |
22536
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22054
diff
changeset
|
57 * {@link #getParameterType}. {@link JavaType#getJavaKind getJavaKind}. |
16483
3c3cd36a3836
moved signatureToMethodDescriptor(Signature sig) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
7676
diff
changeset
|
58 * |
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:
6403
diff
changeset
|
59 * @param index the index into the parameters, with {@code 0} indicating the first parameter |
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:
6403
diff
changeset
|
60 * @return the kind of the parameter at the specified position |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
61 */ |
22536
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22054
diff
changeset
|
62 default JavaKind getParameterKind(int index) { |
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22054
diff
changeset
|
63 return getParameterType(index, null).getJavaKind(); |
18372
18b19a6f9851
Add default implementation for Kind accessors of Signature and JavaField
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18267
diff
changeset
|
64 } |
3733
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 /** |
16492
8853b9304083
made type resolution require an accessing class context
Doug Simon <doug.simon@oracle.com>
parents:
16484
diff
changeset
|
67 * Gets the return type of this signature. |
16483
3c3cd36a3836
moved signatureToMethodDescriptor(Signature sig) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
7676
diff
changeset
|
68 * |
16492
8853b9304083
made type resolution require an accessing class context
Doug Simon <doug.simon@oracle.com>
parents:
16484
diff
changeset
|
69 * @param accessingClass the context of the type lookup. If non-null, its class loader is used |
8853b9304083
made type resolution require an accessing class context
Doug Simon <doug.simon@oracle.com>
parents:
16484
diff
changeset
|
70 * for resolving the type. If {@code null}, then the type returned is either |
8853b9304083
made type resolution require an accessing class context
Doug Simon <doug.simon@oracle.com>
parents:
16484
diff
changeset
|
71 * unresolved or a resolved type whose resolution is context free (e.g., a primitive |
8853b9304083
made type resolution require an accessing class context
Doug Simon <doug.simon@oracle.com>
parents:
16484
diff
changeset
|
72 * type or a type in a java.* package). |
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:
6403
diff
changeset
|
73 * @return the return type |
16492
8853b9304083
made type resolution require an accessing class context
Doug Simon <doug.simon@oracle.com>
parents:
16484
diff
changeset
|
74 * @throws LinkageError if {@code accessingClass != null} and resolution fails |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
75 */ |
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:
6403
diff
changeset
|
76 JavaType getReturnType(ResolvedJavaType accessingClass); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
77 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
78 /** |
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:
6403
diff
changeset
|
79 * Gets the return kind of this signature. This is the same as calling {@link #getReturnType}. |
22536
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22054
diff
changeset
|
80 * {@link JavaType#getJavaKind getJavaKind}. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
81 */ |
22536
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22054
diff
changeset
|
82 default JavaKind getReturnKind() { |
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22054
diff
changeset
|
83 return getReturnType(null).getJavaKind(); |
18372
18b19a6f9851
Add default implementation for Kind accessors of Signature and JavaField
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18267
diff
changeset
|
84 } |
3733
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 /** |
23345
1c4b6a7f1917
update to Eclipse 4.5.2 format style
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
87 * Gets the |
1c4b6a7f1917
update to Eclipse 4.5.2 format style
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
88 * <a href="http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.3.3">method |
16483
3c3cd36a3836
moved signatureToMethodDescriptor(Signature sig) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
7676
diff
changeset
|
89 * descriptor</a> corresponding to this signature. For example: |
3c3cd36a3836
moved signatureToMethodDescriptor(Signature sig) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
7676
diff
changeset
|
90 * |
3c3cd36a3836
moved signatureToMethodDescriptor(Signature sig) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
7676
diff
changeset
|
91 * <pre> |
3c3cd36a3836
moved signatureToMethodDescriptor(Signature sig) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
7676
diff
changeset
|
92 * (ILjava/lang/String;D)V |
3c3cd36a3836
moved signatureToMethodDescriptor(Signature sig) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
7676
diff
changeset
|
93 * </pre> |
3c3cd36a3836
moved signatureToMethodDescriptor(Signature sig) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
7676
diff
changeset
|
94 * |
3c3cd36a3836
moved signatureToMethodDescriptor(Signature sig) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
7676
diff
changeset
|
95 * @return the signature as a string |
3c3cd36a3836
moved signatureToMethodDescriptor(Signature sig) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
7676
diff
changeset
|
96 */ |
3c3cd36a3836
moved signatureToMethodDescriptor(Signature sig) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
7676
diff
changeset
|
97 default String toMethodDescriptor() { |
3c3cd36a3836
moved signatureToMethodDescriptor(Signature sig) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
7676
diff
changeset
|
98 StringBuilder sb = new StringBuilder("("); |
3c3cd36a3836
moved signatureToMethodDescriptor(Signature sig) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
7676
diff
changeset
|
99 for (int i = 0; i < getParameterCount(false); ++i) { |
3c3cd36a3836
moved signatureToMethodDescriptor(Signature sig) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
7676
diff
changeset
|
100 sb.append(getParameterType(i, null).getName()); |
3c3cd36a3836
moved signatureToMethodDescriptor(Signature sig) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
7676
diff
changeset
|
101 } |
3c3cd36a3836
moved signatureToMethodDescriptor(Signature sig) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
7676
diff
changeset
|
102 sb.append(')').append(getReturnType(null).getName()); |
3c3cd36a3836
moved signatureToMethodDescriptor(Signature sig) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
7676
diff
changeset
|
103 return sb.toString(); |
3c3cd36a3836
moved signatureToMethodDescriptor(Signature sig) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
7676
diff
changeset
|
104 } |
3c3cd36a3836
moved signatureToMethodDescriptor(Signature sig) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
7676
diff
changeset
|
105 |
16484
27f2ee618883
moved signatureToTypes(Signature signature, JavaType receiverType) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
16483
diff
changeset
|
106 default JavaType[] toParameterTypes(JavaType receiverType) { |
27f2ee618883
moved signatureToTypes(Signature signature, JavaType receiverType) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
16483
diff
changeset
|
107 int args = getParameterCount(false); |
27f2ee618883
moved signatureToTypes(Signature signature, JavaType receiverType) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
16483
diff
changeset
|
108 JavaType[] result; |
27f2ee618883
moved signatureToTypes(Signature signature, JavaType receiverType) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
16483
diff
changeset
|
109 int i = 0; |
27f2ee618883
moved signatureToTypes(Signature signature, JavaType receiverType) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
16483
diff
changeset
|
110 if (receiverType != null) { |
27f2ee618883
moved signatureToTypes(Signature signature, JavaType receiverType) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
16483
diff
changeset
|
111 result = new JavaType[args + 1]; |
27f2ee618883
moved signatureToTypes(Signature signature, JavaType receiverType) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
16483
diff
changeset
|
112 result[0] = receiverType; |
27f2ee618883
moved signatureToTypes(Signature signature, JavaType receiverType) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
16483
diff
changeset
|
113 i = 1; |
27f2ee618883
moved signatureToTypes(Signature signature, JavaType receiverType) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
16483
diff
changeset
|
114 } else { |
27f2ee618883
moved signatureToTypes(Signature signature, JavaType receiverType) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
16483
diff
changeset
|
115 result = new JavaType[args]; |
27f2ee618883
moved signatureToTypes(Signature signature, JavaType receiverType) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
16483
diff
changeset
|
116 } |
27f2ee618883
moved signatureToTypes(Signature signature, JavaType receiverType) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
16483
diff
changeset
|
117 for (int j = 0; j < args; j++) { |
27f2ee618883
moved signatureToTypes(Signature signature, JavaType receiverType) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
16483
diff
changeset
|
118 result[i + j] = getParameterType(j, null); |
27f2ee618883
moved signatureToTypes(Signature signature, JavaType receiverType) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
16483
diff
changeset
|
119 } |
27f2ee618883
moved signatureToTypes(Signature signature, JavaType receiverType) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
16483
diff
changeset
|
120 return result; |
27f2ee618883
moved signatureToTypes(Signature signature, JavaType receiverType) from MetaUtil to be a default method in Signature
Doug Simon <doug.simon@oracle.com>
parents:
16483
diff
changeset
|
121 } |
21567
f41409c6ff26
Do not rely on single/double slot information from the Kind of the value in a local variable or expression stack entry. With word type rewriting during parsing, long values can be single slot values when they are rewritten from Object values.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
21556
diff
changeset
|
122 |
22536
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22054
diff
changeset
|
123 default JavaKind[] toParameterKinds(boolean receiver) { |
21567
f41409c6ff26
Do not rely on single/double slot information from the Kind of the value in a local variable or expression stack entry. With word type rewriting during parsing, long values can be single slot values when they are rewritten from Object values.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
21556
diff
changeset
|
124 int args = getParameterCount(false); |
22536
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22054
diff
changeset
|
125 JavaKind[] result; |
21567
f41409c6ff26
Do not rely on single/double slot information from the Kind of the value in a local variable or expression stack entry. With word type rewriting during parsing, long values can be single slot values when they are rewritten from Object values.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
21556
diff
changeset
|
126 int i = 0; |
f41409c6ff26
Do not rely on single/double slot information from the Kind of the value in a local variable or expression stack entry. With word type rewriting during parsing, long values can be single slot values when they are rewritten from Object values.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
21556
diff
changeset
|
127 if (receiver) { |
22536
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22054
diff
changeset
|
128 result = new JavaKind[args + 1]; |
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22054
diff
changeset
|
129 result[0] = JavaKind.Object; |
21567
f41409c6ff26
Do not rely on single/double slot information from the Kind of the value in a local variable or expression stack entry. With word type rewriting during parsing, long values can be single slot values when they are rewritten from Object values.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
21556
diff
changeset
|
130 i = 1; |
f41409c6ff26
Do not rely on single/double slot information from the Kind of the value in a local variable or expression stack entry. With word type rewriting during parsing, long values can be single slot values when they are rewritten from Object values.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
21556
diff
changeset
|
131 } else { |
22536
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22054
diff
changeset
|
132 result = new JavaKind[args]; |
21567
f41409c6ff26
Do not rely on single/double slot information from the Kind of the value in a local variable or expression stack entry. With word type rewriting during parsing, long values can be single slot values when they are rewritten from Object values.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
21556
diff
changeset
|
133 } |
f41409c6ff26
Do not rely on single/double slot information from the Kind of the value in a local variable or expression stack entry. With word type rewriting during parsing, long values can be single slot values when they are rewritten from Object values.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
21556
diff
changeset
|
134 for (int j = 0; j < args; j++) { |
f41409c6ff26
Do not rely on single/double slot information from the Kind of the value in a local variable or expression stack entry. With word type rewriting during parsing, long values can be single slot values when they are rewritten from Object values.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
21556
diff
changeset
|
135 result[i + j] = getParameterKind(j); |
f41409c6ff26
Do not rely on single/double slot information from the Kind of the value in a local variable or expression stack entry. With word type rewriting during parsing, long values can be single slot values when they are rewritten from Object values.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
21556
diff
changeset
|
136 } |
f41409c6ff26
Do not rely on single/double slot information from the Kind of the value in a local variable or expression stack entry. With word type rewriting during parsing, long values can be single slot values when they are rewritten from Object values.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
21556
diff
changeset
|
137 return result; |
f41409c6ff26
Do not rely on single/double slot information from the Kind of the value in a local variable or expression stack entry. With word type rewriting during parsing, long values can be single slot values when they are rewritten from Object values.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
21556
diff
changeset
|
138 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
139 } |