Mercurial > hg > graal-jvmci-8
annotate jvmci/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaMethod.java @ 24234:ea6f94ab283b default tip
Added tag jvmci-0.36 for changeset 8128b98d4736
author | Gilles Duboscq <gilles.m.duboscq@oracle.com> |
---|---|
date | Mon, 18 Sep 2017 18:49:45 +0200 |
parents | 6d2c72b822b0 |
children |
rev | line source |
---|---|
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 /* |
18187
9619ba4daf4c
Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents:
18163
diff
changeset
|
2 * Copyright (c) 2009, 2014, 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:
22648
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 |
22569
ec96f33a101d
updated imports to be explicit and added checkstyle rule to forbid * imports
Doug Simon <doug.simon@oracle.com>
parents:
22054
diff
changeset
|
25 import java.lang.annotation.Annotation; |
23376
ae27c683c128
Make ResolvedJava* types extend AnnotatedElement.
Roland Schatz <roland.schatz@oracle.com>
parents:
23345
diff
changeset
|
26 import java.lang.reflect.AnnotatedElement; |
22569
ec96f33a101d
updated imports to be explicit and added checkstyle rule to forbid * imports
Doug Simon <doug.simon@oracle.com>
parents:
22054
diff
changeset
|
27 import java.lang.reflect.Array; |
ec96f33a101d
updated imports to be explicit and added checkstyle rule to forbid * imports
Doug Simon <doug.simon@oracle.com>
parents:
22054
diff
changeset
|
28 import java.lang.reflect.Method; |
23789
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
29 import java.lang.reflect.Modifier; |
22569
ec96f33a101d
updated imports to be explicit and added checkstyle rule to forbid * imports
Doug Simon <doug.simon@oracle.com>
parents:
22054
diff
changeset
|
30 import java.lang.reflect.Type; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
31 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
32 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7310
diff
changeset
|
33 * Represents a resolved Java method. Methods, like fields and types, are resolved through |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7310
diff
changeset
|
34 * {@link ConstantPool constant pools}. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
35 */ |
23376
ae27c683c128
Make ResolvedJava* types extend AnnotatedElement.
Roland Schatz <roland.schatz@oracle.com>
parents:
23345
diff
changeset
|
36 public interface ResolvedJavaMethod extends JavaMethod, InvokeTarget, ModifiersProvider, AnnotatedElement { |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
37 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
38 /** |
7912
06ecee106195
added unit tests for bytecode and machine code disassembly
Doug Simon <doug.simon@oracle.com>
parents:
7814
diff
changeset
|
39 * Returns the bytecode of this method, if the method has code. The returned byte array does not |
11521
f521a1db1378
Avoid accessing the code of a method before it has been linked and verified.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9984
diff
changeset
|
40 * contain breakpoints or non-Java bytecodes. This may return null if the |
f521a1db1378
Avoid accessing the code of a method before it has been linked and verified.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9984
diff
changeset
|
41 * {@link #getDeclaringClass() holder} is not {@link ResolvedJavaType#isLinked() linked}. |
15102
175111728365
improve canBeStaticallyBound
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
14545
diff
changeset
|
42 * |
11521
f521a1db1378
Avoid accessing the code of a method before it has been linked and verified.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9984
diff
changeset
|
43 * The contained constant pool indices may not be the ones found in the original class file but |
21789
5b9adb645217
fixed remnants of "graal" names in JVMCI code
Doug Simon <doug.simon@oracle.com>
parents:
21630
diff
changeset
|
44 * they can be used with the JVMCI API (e.g. methods in {@link ConstantPool}). |
15102
175111728365
improve canBeStaticallyBound
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
14545
diff
changeset
|
45 * |
11521
f521a1db1378
Avoid accessing the code of a method before it has been linked and verified.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9984
diff
changeset
|
46 * @return the bytecode of the method, or {@code null} if {@code getCodeSize() == 0} or if the |
f521a1db1378
Avoid accessing the code of a method before it has been linked and verified.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9984
diff
changeset
|
47 * code is not ready. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
48 */ |
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:
5711
diff
changeset
|
49 byte[] getCode(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
50 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
51 /** |
7912
06ecee106195
added unit tests for bytecode and machine code disassembly
Doug Simon <doug.simon@oracle.com>
parents:
7814
diff
changeset
|
52 * Returns the size of the bytecode of this method, if the method has code. This is equivalent |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7310
diff
changeset
|
53 * to {@link #getCode()}. {@code length} if the method has code. |
15102
175111728365
improve canBeStaticallyBound
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
14545
diff
changeset
|
54 * |
7912
06ecee106195
added unit tests for bytecode and machine code disassembly
Doug Simon <doug.simon@oracle.com>
parents:
7814
diff
changeset
|
55 * @return the size of the bytecode in bytes, or 0 if no bytecode is available |
4528
e6e14d25e608
added two inlining policies for comparison
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4527
diff
changeset
|
56 */ |
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:
5711
diff
changeset
|
57 int getCodeSize(); |
4528
e6e14d25e608
added two inlining policies for comparison
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4527
diff
changeset
|
58 |
e6e14d25e608
added two inlining policies for comparison
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4527
diff
changeset
|
59 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7310
diff
changeset
|
60 * Returns the {@link ResolvedJavaType} object representing the class or interface that declares |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7310
diff
changeset
|
61 * this method. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
62 */ |
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:
5711
diff
changeset
|
63 ResolvedJavaType getDeclaringClass(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
64 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
65 /** |
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:
5711
diff
changeset
|
66 * Returns the maximum number of locals used in this method's bytecodes. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
67 */ |
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:
5711
diff
changeset
|
68 int getMaxLocals(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
69 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
70 /** |
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:
5711
diff
changeset
|
71 * Returns the maximum number of stack slots used in this method's bytecodes. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
72 */ |
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:
5711
diff
changeset
|
73 int getMaxStackSize(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
74 |
22032
d1a41fbfcfd2
Replace ResolvedJavaType.isFinal with more meaningful and correct isLeaf
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22012
diff
changeset
|
75 default boolean isFinal() { |
d1a41fbfcfd2
Replace ResolvedJavaType.isFinal with more meaningful and correct isLeaf
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22012
diff
changeset
|
76 return ModifiersProvider.super.isFinalFlagSet(); |
d1a41fbfcfd2
Replace ResolvedJavaType.isFinal with more meaningful and correct isLeaf
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22012
diff
changeset
|
77 } |
d1a41fbfcfd2
Replace ResolvedJavaType.isFinal with more meaningful and correct isLeaf
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22012
diff
changeset
|
78 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
79 /** |
9984
f3330a4487eb
added ResolvedJava[Field|Method].isSynthetic()
Doug Simon <doug.simon@oracle.com>
parents:
9704
diff
changeset
|
80 * Determines if this method is a synthetic method as defined by the Java Language |
f3330a4487eb
added ResolvedJava[Field|Method].isSynthetic()
Doug Simon <doug.simon@oracle.com>
parents:
9704
diff
changeset
|
81 * Specification. |
f3330a4487eb
added ResolvedJava[Field|Method].isSynthetic()
Doug Simon <doug.simon@oracle.com>
parents:
9704
diff
changeset
|
82 */ |
23749
d6bd0b9cd0b6
remove uses of setAccessible (JDK-8165434)
Doug Simon <doug.simon@oracle.com>
parents:
23741
diff
changeset
|
83 boolean isSynthetic(); |
22011
4c9d4fe1cbd8
Add ModifiersProvider.isSynthetic, isVarArgs and isBridge.
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21798
diff
changeset
|
84 |
4c9d4fe1cbd8
Add ModifiersProvider.isSynthetic, isVarArgs and isBridge.
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21798
diff
changeset
|
85 /** |
23345
1c4b6a7f1917
update to Eclipse 4.5.2 format style
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
86 * Checks that the method is a |
1c4b6a7f1917
update to Eclipse 4.5.2 format style
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
87 * <a href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.6">varargs</a> |
22011
4c9d4fe1cbd8
Add ModifiersProvider.isSynthetic, isVarArgs and isBridge.
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21798
diff
changeset
|
88 * method. |
4c9d4fe1cbd8
Add ModifiersProvider.isSynthetic, isVarArgs and isBridge.
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21798
diff
changeset
|
89 * |
4c9d4fe1cbd8
Add ModifiersProvider.isSynthetic, isVarArgs and isBridge.
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21798
diff
changeset
|
90 * @return whether the method is a varargs method |
4c9d4fe1cbd8
Add ModifiersProvider.isSynthetic, isVarArgs and isBridge.
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21798
diff
changeset
|
91 */ |
23749
d6bd0b9cd0b6
remove uses of setAccessible (JDK-8165434)
Doug Simon <doug.simon@oracle.com>
parents:
23741
diff
changeset
|
92 boolean isVarArgs(); |
22011
4c9d4fe1cbd8
Add ModifiersProvider.isSynthetic, isVarArgs and isBridge.
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21798
diff
changeset
|
93 |
4c9d4fe1cbd8
Add ModifiersProvider.isSynthetic, isVarArgs and isBridge.
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21798
diff
changeset
|
94 /** |
23345
1c4b6a7f1917
update to Eclipse 4.5.2 format style
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
95 * Checks that the method is a |
1c4b6a7f1917
update to Eclipse 4.5.2 format style
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
96 * <a href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.6">bridge</a> |
22011
4c9d4fe1cbd8
Add ModifiersProvider.isSynthetic, isVarArgs and isBridge.
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21798
diff
changeset
|
97 * method. |
4c9d4fe1cbd8
Add ModifiersProvider.isSynthetic, isVarArgs and isBridge.
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21798
diff
changeset
|
98 * |
4c9d4fe1cbd8
Add ModifiersProvider.isSynthetic, isVarArgs and isBridge.
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21798
diff
changeset
|
99 * @return whether the method is a bridge method |
4c9d4fe1cbd8
Add ModifiersProvider.isSynthetic, isVarArgs and isBridge.
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21798
diff
changeset
|
100 */ |
23749
d6bd0b9cd0b6
remove uses of setAccessible (JDK-8165434)
Doug Simon <doug.simon@oracle.com>
parents:
23741
diff
changeset
|
101 boolean isBridge(); |
9984
f3330a4487eb
added ResolvedJava[Field|Method].isSynthetic()
Doug Simon <doug.simon@oracle.com>
parents:
9704
diff
changeset
|
102 |
f3330a4487eb
added ResolvedJava[Field|Method].isSynthetic()
Doug Simon <doug.simon@oracle.com>
parents:
9704
diff
changeset
|
103 /** |
13183
0266ac3b26c0
JDK8: added support for default methods as well as interfaces containing static and private methods
Doug Simon <doug.simon@oracle.com>
parents:
11718
diff
changeset
|
104 * Returns {@code true} if this method is a default method; returns {@code false} otherwise. |
15102
175111728365
improve canBeStaticallyBound
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
14545
diff
changeset
|
105 * |
13183
0266ac3b26c0
JDK8: added support for default methods as well as interfaces containing static and private methods
Doug Simon <doug.simon@oracle.com>
parents:
11718
diff
changeset
|
106 * A default method is a public non-abstract instance method, that is, a non-static method with |
0266ac3b26c0
JDK8: added support for default methods as well as interfaces containing static and private methods
Doug Simon <doug.simon@oracle.com>
parents:
11718
diff
changeset
|
107 * a body, declared in an interface type. |
15102
175111728365
improve canBeStaticallyBound
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
14545
diff
changeset
|
108 * |
13183
0266ac3b26c0
JDK8: added support for default methods as well as interfaces containing static and private methods
Doug Simon <doug.simon@oracle.com>
parents:
11718
diff
changeset
|
109 * @return true if and only if this method is a default method as defined by the Java Language |
0266ac3b26c0
JDK8: added support for default methods as well as interfaces containing static and private methods
Doug Simon <doug.simon@oracle.com>
parents:
11718
diff
changeset
|
110 * Specification. |
0266ac3b26c0
JDK8: added support for default methods as well as interfaces containing static and private methods
Doug Simon <doug.simon@oracle.com>
parents:
11718
diff
changeset
|
111 */ |
0266ac3b26c0
JDK8: added support for default methods as well as interfaces containing static and private methods
Doug Simon <doug.simon@oracle.com>
parents:
11718
diff
changeset
|
112 boolean isDefault(); |
0266ac3b26c0
JDK8: added support for default methods as well as interfaces containing static and private methods
Doug Simon <doug.simon@oracle.com>
parents:
11718
diff
changeset
|
113 |
0266ac3b26c0
JDK8: added support for default methods as well as interfaces containing static and private methods
Doug Simon <doug.simon@oracle.com>
parents:
11718
diff
changeset
|
114 /** |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
115 * Checks whether this method is a class initializer. |
15102
175111728365
improve canBeStaticallyBound
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
14545
diff
changeset
|
116 * |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
117 * @return {@code true} if the method is a class initializer |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
118 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
119 boolean isClassInitializer(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
120 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
121 /** |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
122 * Checks whether this method is a constructor. |
15102
175111728365
improve canBeStaticallyBound
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
14545
diff
changeset
|
123 * |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
124 * @return {@code true} if the method is a constructor |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
125 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
126 boolean isConstructor(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
127 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
128 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7310
diff
changeset
|
129 * Checks whether this method can be statically bound (usually, that means it is final or |
18163
c88ab4f1f04a
re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents:
17125
diff
changeset
|
130 * private or static, but not abstract, or the declaring class is final). |
15102
175111728365
improve canBeStaticallyBound
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
14545
diff
changeset
|
131 * |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
132 * @return {@code true} if this method can be statically bound |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
133 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
134 boolean canBeStaticallyBound(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
135 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
136 /** |
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:
5711
diff
changeset
|
137 * Returns the list of exception handlers for this method. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
138 */ |
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:
5711
diff
changeset
|
139 ExceptionHandler[] getExceptionHandlers(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
140 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
141 /** |
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:
5711
diff
changeset
|
142 * Returns a stack trace element for this method and a given bytecode index. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
143 */ |
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:
5711
diff
changeset
|
144 StackTraceElement asStackTraceElement(int bci); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
145 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
146 /** |
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:
5711
diff
changeset
|
147 * Returns an object that provides access to the profiling information recorded for this method. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
148 */ |
21630
9cc3571ef51d
Add getProfilingInfo(boolean includeNormal, boolean includeOSR) to ResolvedJavaMethod
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21629
diff
changeset
|
149 default ProfilingInfo getProfilingInfo() { |
9cc3571ef51d
Add getProfilingInfo(boolean includeNormal, boolean includeOSR) to ResolvedJavaMethod
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21629
diff
changeset
|
150 return getProfilingInfo(true, true); |
9cc3571ef51d
Add getProfilingInfo(boolean includeNormal, boolean includeOSR) to ResolvedJavaMethod
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21629
diff
changeset
|
151 } |
9cc3571ef51d
Add getProfilingInfo(boolean includeNormal, boolean includeOSR) to ResolvedJavaMethod
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21629
diff
changeset
|
152 |
9cc3571ef51d
Add getProfilingInfo(boolean includeNormal, boolean includeOSR) to ResolvedJavaMethod
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21629
diff
changeset
|
153 /** |
9cc3571ef51d
Add getProfilingInfo(boolean includeNormal, boolean includeOSR) to ResolvedJavaMethod
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21629
diff
changeset
|
154 * Returns an object that provides access to the profiling information recorded for this method. |
9cc3571ef51d
Add getProfilingInfo(boolean includeNormal, boolean includeOSR) to ResolvedJavaMethod
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21629
diff
changeset
|
155 * |
9cc3571ef51d
Add getProfilingInfo(boolean includeNormal, boolean includeOSR) to ResolvedJavaMethod
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21629
diff
changeset
|
156 * @param includeNormal if true, |
9cc3571ef51d
Add getProfilingInfo(boolean includeNormal, boolean includeOSR) to ResolvedJavaMethod
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21629
diff
changeset
|
157 * {@linkplain ProfilingInfo#getDeoptimizationCount(DeoptimizationReason) |
9cc3571ef51d
Add getProfilingInfo(boolean includeNormal, boolean includeOSR) to ResolvedJavaMethod
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21629
diff
changeset
|
158 * deoptimization counts} will include deoptimization that happened during execution |
9cc3571ef51d
Add getProfilingInfo(boolean includeNormal, boolean includeOSR) to ResolvedJavaMethod
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21629
diff
changeset
|
159 * of standard non-osr methods. |
9cc3571ef51d
Add getProfilingInfo(boolean includeNormal, boolean includeOSR) to ResolvedJavaMethod
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21629
diff
changeset
|
160 * @param includeOSR if true, |
9cc3571ef51d
Add getProfilingInfo(boolean includeNormal, boolean includeOSR) to ResolvedJavaMethod
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21629
diff
changeset
|
161 * {@linkplain ProfilingInfo#getDeoptimizationCount(DeoptimizationReason) |
9cc3571ef51d
Add getProfilingInfo(boolean includeNormal, boolean includeOSR) to ResolvedJavaMethod
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21629
diff
changeset
|
162 * deoptimization counts} will include deoptimization that happened during execution |
9cc3571ef51d
Add getProfilingInfo(boolean includeNormal, boolean includeOSR) to ResolvedJavaMethod
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21629
diff
changeset
|
163 * of on-stack-replacement methods. |
9cc3571ef51d
Add getProfilingInfo(boolean includeNormal, boolean includeOSR) to ResolvedJavaMethod
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21629
diff
changeset
|
164 */ |
9cc3571ef51d
Add getProfilingInfo(boolean includeNormal, boolean includeOSR) to ResolvedJavaMethod
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21629
diff
changeset
|
165 ProfilingInfo getProfilingInfo(boolean includeNormal, boolean includeOSR); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
166 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
167 /** |
8611
6c4db417385a
added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8217
diff
changeset
|
168 * Invalidates the profiling information and restarts profiling upon the next invocation. |
6c4db417385a
added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8217
diff
changeset
|
169 */ |
6c4db417385a
added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8217
diff
changeset
|
170 void reprofile(); |
6c4db417385a
added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8217
diff
changeset
|
171 |
6c4db417385a
added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8217
diff
changeset
|
172 /** |
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:
5711
diff
changeset
|
173 * Returns the constant pool of this method. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
174 */ |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5536
diff
changeset
|
175 ConstantPool getConstantPool(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
176 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
177 /** |
23789
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
178 * A {@code Parameter} provides information about method parameters. |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
179 */ |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
180 class Parameter implements AnnotatedElement { |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
181 private final String name; |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
182 private final ResolvedJavaMethod method; |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
183 private final int modifiers; |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
184 private final int index; |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
185 |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
186 /** |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
187 * Constructor for {@code Parameter}. |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
188 * |
23790
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
189 * @param name the name of the parameter or {@code null} if there is no |
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
190 * {@literal MethodParameters} class file attribute providing a non-empty name |
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
191 * for the parameter |
23789
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
192 * @param modifiers the modifier flags for the parameter |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
193 * @param method the method which defines this parameter |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
194 * @param index the index of the parameter |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
195 */ |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
196 public Parameter(String name, |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
197 int modifiers, |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
198 ResolvedJavaMethod method, |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
199 int index) { |
23790
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
200 assert name == null || !name.isEmpty(); |
23789
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
201 this.name = name; |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
202 this.modifiers = modifiers; |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
203 this.method = method; |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
204 this.index = index; |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
205 } |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
206 |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
207 /** |
23790
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
208 * Gets the name of the parameter. If the parameter's name is {@linkplain #isNamePresent() |
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
209 * present}, then this method returns the name provided by the class file. Otherwise, this |
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
210 * method synthesizes a name of the form argN, where N is the index of the parameter in the |
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
211 * descriptor of the method which declares the parameter. |
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
212 * |
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
213 * @return the name of the parameter, either provided by the class file or synthesized if |
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
214 * the class file does not provide a name |
23789
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
215 */ |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
216 public String getName() { |
23790
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
217 if (name == null) { |
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
218 return "arg" + index; |
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
219 } else { |
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
220 return name; |
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
221 } |
23789
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
222 } |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
223 |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
224 /** |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
225 * Gets the method declaring the parameter. |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
226 */ |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
227 public ResolvedJavaMethod getDeclaringMethod() { |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
228 return method; |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
229 } |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
230 |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
231 /** |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
232 * Get the modifier flags for the parameter. |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
233 */ |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
234 public int getModifiers() { |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
235 return modifiers; |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
236 } |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
237 |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
238 /** |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
239 * Gets the kind of the parameter. |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
240 */ |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
241 public JavaKind getKind() { |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
242 return method.getSignature().getParameterKind(index); |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
243 } |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
244 |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
245 /** |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
246 * Gets the formal type of the parameter. |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
247 */ |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
248 public Type getParameterizedType() { |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
249 return method.getGenericParameterTypes()[index]; |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
250 } |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
251 |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
252 /** |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
253 * Gets the type of the parameter. |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
254 */ |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
255 public JavaType getType() { |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
256 return method.getSignature().getParameterType(index, method.getDeclaringClass()); |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
257 } |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
258 |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
259 /** |
23790
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
260 * Determines if the parameter has a name according to a {@literal MethodParameters} class |
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
261 * file attribute. |
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
262 * |
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
263 * @return true if and only if the parameter has a name according to the class file. |
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
264 */ |
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
265 public boolean isNamePresent() { |
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
266 return name != null; |
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
267 } |
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
268 |
224f43824e2b
incomplete API to MethodParameters attribute (JDK-8169331)
Doug Simon <doug.simon@oracle.com>
parents:
23789
diff
changeset
|
269 /** |
23789
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
270 * Determines if the parameter represents a variable argument list. |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
271 */ |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
272 public boolean isVarArgs() { |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
273 return method.isVarArgs() && index == method.getSignature().getParameterCount(false) - 1; |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
274 } |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
275 |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
276 public <T extends Annotation> T getAnnotation(Class<T> annotationClass) { |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
277 return method.getParameterAnnotations(annotationClass)[index]; |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
278 } |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
279 |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
280 public Annotation[] getAnnotations() { |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
281 return method.getParameterAnnotations()[index]; |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
282 } |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
283 |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
284 public Annotation[] getDeclaredAnnotations() { |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
285 return getAnnotations(); |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
286 } |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
287 |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
288 @Override |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
289 public String toString() { |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
290 Type type = getParameterizedType(); |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
291 String typename = type.getTypeName(); |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
292 if (isVarArgs()) { |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
293 typename = typename.replaceFirst("\\[\\]$", "..."); |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
294 } |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
295 |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
296 final StringBuilder sb = new StringBuilder(Modifier.toString(getModifiers())); |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
297 if (sb.length() != 0) { |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
298 sb.append(' '); |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
299 } |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
300 return sb.append(typename).append(' ').append(getName()).toString(); |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
301 } |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
302 |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
303 @Override |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
304 public boolean equals(Object obj) { |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
305 if (obj instanceof Parameter) { |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
306 Parameter other = (Parameter) obj; |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
307 return (other.method.equals(method) && other.index == index); |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
308 } |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
309 return false; |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
310 } |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
311 |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
312 @Override |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
313 public int hashCode() { |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
314 return method.hashCode() ^ index; |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
315 } |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
316 } |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
317 |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
318 /** |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
319 * Returns an array of {@code Parameter} objects that represent all the parameters to this |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
320 * method. Returns an array of length 0 if this method has no parameters. Returns {@code null} |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
321 * if the parameter information is unavailable. |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
322 */ |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
323 default Parameter[] getParameters() { |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
324 return null; |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
325 } |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
326 |
0cb263db490f
use MethodParameters attribute instead of depending on -g option for sanity checks (JDK-8168915)
Doug Simon <doug.simon@oracle.com>
parents:
23749
diff
changeset
|
327 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7310
diff
changeset
|
328 * Returns an array of arrays that represent the annotations on the formal parameters, in |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7310
diff
changeset
|
329 * declaration order, of this method. |
15102
175111728365
improve canBeStaticallyBound
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
14545
diff
changeset
|
330 * |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
331 * @see Method#getParameterAnnotations() |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
332 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
333 Annotation[][] getParameterAnnotations(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
334 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
335 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7310
diff
changeset
|
336 * Returns an array of {@link Type} objects that represent the formal parameter types, in |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7310
diff
changeset
|
337 * declaration order, of this method. |
15102
175111728365
improve canBeStaticallyBound
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
14545
diff
changeset
|
338 * |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
339 * @see Method#getGenericParameterTypes() |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
340 */ |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
341 Type[] getGenericParameterTypes(); |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
342 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
343 /** |
18823
5a21cac1968f
Add utilities ModifiersProvider#isConcrete, ResolvedJavaMethod#hasReceiver, ResolvedJavaMethod#hasBytecodes to Graal API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18532
diff
changeset
|
344 * Returns {@code true} if this method is not excluded from inlining and has associated Java |
5a21cac1968f
Add utilities ModifiersProvider#isConcrete, ResolvedJavaMethod#hasReceiver, ResolvedJavaMethod#hasBytecodes to Graal API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18532
diff
changeset
|
345 * bytecodes (@see {@link ResolvedJavaMethod#hasBytecodes()}). |
4296
d089b71a5237
Add possibility to disable inlining for specific methods.
Andreas Woess <andreas.woess@jku.at>
parents:
4199
diff
changeset
|
346 */ |
d089b71a5237
Add possibility to disable inlining for specific methods.
Andreas Woess <andreas.woess@jku.at>
parents:
4199
diff
changeset
|
347 boolean canBeInlined(); |
7310
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7037
diff
changeset
|
348 |
14520 | 349 /** |
23986
6d2c72b822b0
add ResolvedJavaMethod.hasNeverInlineDirective (JDK-8172733)
Doug Simon <doug.simon@oracle.com>
parents:
23790
diff
changeset
|
350 * Determines if this method is targeted by a VM directive (e.g., |
6d2c72b822b0
add ResolvedJavaMethod.hasNeverInlineDirective (JDK-8172733)
Doug Simon <doug.simon@oracle.com>
parents:
23790
diff
changeset
|
351 * {@code -XX:CompileCommand=dontinline,<pattern>}) or VM recognized annotation (e.g., |
6d2c72b822b0
add ResolvedJavaMethod.hasNeverInlineDirective (JDK-8172733)
Doug Simon <doug.simon@oracle.com>
parents:
23790
diff
changeset
|
352 * {@code jdk.internal.vm.annotation.DontInline}) that specifies it should not be inlined. |
6d2c72b822b0
add ResolvedJavaMethod.hasNeverInlineDirective (JDK-8172733)
Doug Simon <doug.simon@oracle.com>
parents:
23790
diff
changeset
|
353 */ |
6d2c72b822b0
add ResolvedJavaMethod.hasNeverInlineDirective (JDK-8172733)
Doug Simon <doug.simon@oracle.com>
parents:
23790
diff
changeset
|
354 boolean hasNeverInlineDirective(); |
6d2c72b822b0
add ResolvedJavaMethod.hasNeverInlineDirective (JDK-8172733)
Doug Simon <doug.simon@oracle.com>
parents:
23790
diff
changeset
|
355 |
6d2c72b822b0
add ResolvedJavaMethod.hasNeverInlineDirective (JDK-8172733)
Doug Simon <doug.simon@oracle.com>
parents:
23790
diff
changeset
|
356 /** |
14520 | 357 * Returns {@code true} if the inlining of this method should be forced. |
358 */ | |
13953
d587baa55dd7
Add shouldBeInlined method to ResolvedJavaMethod, implement it for HotSpot and use it in the inlining phase
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13183
diff
changeset
|
359 boolean shouldBeInlined(); |
d587baa55dd7
Add shouldBeInlined method to ResolvedJavaMethod, implement it for HotSpot and use it in the inlining phase
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13183
diff
changeset
|
360 |
7310
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7037
diff
changeset
|
361 /** |
11718
f679f5411fd7
Better handling of methods which have no line number or variable name tables.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11521
diff
changeset
|
362 * Returns the LineNumberTable of this method or null if this method does not have a line |
f679f5411fd7
Better handling of methods which have no line number or variable name tables.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11521
diff
changeset
|
363 * numbers table. |
7310
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7037
diff
changeset
|
364 */ |
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7037
diff
changeset
|
365 LineNumberTable getLineNumberTable(); |
7786
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
7530
diff
changeset
|
366 |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
7530
diff
changeset
|
367 /** |
11718
f679f5411fd7
Better handling of methods which have no line number or variable name tables.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11521
diff
changeset
|
368 * Returns the local variable table of this method or null if this method does not have a local |
f679f5411fd7
Better handling of methods which have no line number or variable name tables.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11521
diff
changeset
|
369 * variable table. |
7786
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
7530
diff
changeset
|
370 */ |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
7530
diff
changeset
|
371 LocalVariableTable getLocalVariableTable(); |
9100
d24955427b0b
Remove MetaUtil.getMirrorOrFail; Add necessary functionality to the Graal API so that all previous usages of java.lang.Class can now use ResolvedJavaType
Christian Wimmer <christian.wimmer@oracle.com>
parents:
8611
diff
changeset
|
372 |
d24955427b0b
Remove MetaUtil.getMirrorOrFail; Add necessary functionality to the Graal API so that all previous usages of java.lang.Class can now use ResolvedJavaType
Christian Wimmer <christian.wimmer@oracle.com>
parents:
8611
diff
changeset
|
373 /** |
9380
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9100
diff
changeset
|
374 * Gets the encoding of (that is, a constant representing the value of) this method. |
15102
175111728365
improve canBeStaticallyBound
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
14545
diff
changeset
|
375 * |
9380
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9100
diff
changeset
|
376 * @return a constant representing a reference to this method |
ee8cd087a731
Dispatch based on method instead of type if it seems more beneficial.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
9100
diff
changeset
|
377 */ |
18362
ea0fbb571466
Use pointer stamps in LoadHub and LoadMethod.
Roland Schatz <roland.schatz@oracle.com>
parents:
18187
diff
changeset
|
378 Constant getEncoding(); |
9610
ae17e540c5d2
More asserts while getting vtable offsets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9380
diff
changeset
|
379 |
ae17e540c5d2
More asserts while getting vtable offsets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9380
diff
changeset
|
380 /** |
15725
ef6b8d1898e6
Add resolved receiver type to ResolvedJavaMethod.isInVirtualMethodTable in order to be able to do vtable-calls for miranda and default methods
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15311
diff
changeset
|
381 * Checks if this method is present in the virtual table for subtypes of the specified |
ef6b8d1898e6
Add resolved receiver type to ResolvedJavaMethod.isInVirtualMethodTable in order to be able to do vtable-calls for miranda and default methods
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15311
diff
changeset
|
382 * {@linkplain ResolvedJavaType type}. |
15102
175111728365
improve canBeStaticallyBound
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
14545
diff
changeset
|
383 * |
15725
ef6b8d1898e6
Add resolved receiver type to ResolvedJavaMethod.isInVirtualMethodTable in order to be able to do vtable-calls for miranda and default methods
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15311
diff
changeset
|
384 * @return true is this method is present in the virtual table for subtypes of this type. |
9610
ae17e540c5d2
More asserts while getting vtable offsets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9380
diff
changeset
|
385 */ |
15725
ef6b8d1898e6
Add resolved receiver type to ResolvedJavaMethod.isInVirtualMethodTable in order to be able to do vtable-calls for miranda and default methods
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15311
diff
changeset
|
386 boolean isInVirtualMethodTable(ResolvedJavaType resolved); |
16477
46397dc87086
moved getParameterAnnotation() from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
15725
diff
changeset
|
387 |
46397dc87086
moved getParameterAnnotation() from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
15725
diff
changeset
|
388 /** |
46397dc87086
moved getParameterAnnotation() from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
15725
diff
changeset
|
389 * Gets the annotation of a particular type for a formal parameter of this method. |
46397dc87086
moved getParameterAnnotation() from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
15725
diff
changeset
|
390 * |
46397dc87086
moved getParameterAnnotation() from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
15725
diff
changeset
|
391 * @param annotationClass the Class object corresponding to the annotation type |
46397dc87086
moved getParameterAnnotation() from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
15725
diff
changeset
|
392 * @param parameterIndex the index of a formal parameter of {@code method} |
46397dc87086
moved getParameterAnnotation() from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
15725
diff
changeset
|
393 * @return the annotation of type {@code annotationClass} for the formal parameter present, else |
46397dc87086
moved getParameterAnnotation() from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
15725
diff
changeset
|
394 * null |
46397dc87086
moved getParameterAnnotation() from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
15725
diff
changeset
|
395 * @throws IndexOutOfBoundsException if {@code parameterIndex} does not denote a formal |
46397dc87086
moved getParameterAnnotation() from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
15725
diff
changeset
|
396 * parameter |
46397dc87086
moved getParameterAnnotation() from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
15725
diff
changeset
|
397 */ |
46397dc87086
moved getParameterAnnotation() from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
15725
diff
changeset
|
398 default <T extends Annotation> T getParameterAnnotation(Class<T> annotationClass, int parameterIndex) { |
46397dc87086
moved getParameterAnnotation() from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
15725
diff
changeset
|
399 if (parameterIndex >= 0) { |
46397dc87086
moved getParameterAnnotation() from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
15725
diff
changeset
|
400 Annotation[][] parameterAnnotations = getParameterAnnotations(); |
46397dc87086
moved getParameterAnnotation() from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
15725
diff
changeset
|
401 for (Annotation a : parameterAnnotations[parameterIndex]) { |
46397dc87086
moved getParameterAnnotation() from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
15725
diff
changeset
|
402 if (a.annotationType() == annotationClass) { |
46397dc87086
moved getParameterAnnotation() from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
15725
diff
changeset
|
403 return annotationClass.cast(a); |
46397dc87086
moved getParameterAnnotation() from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
15725
diff
changeset
|
404 } |
46397dc87086
moved getParameterAnnotation() from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
15725
diff
changeset
|
405 } |
46397dc87086
moved getParameterAnnotation() from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
15725
diff
changeset
|
406 } |
46397dc87086
moved getParameterAnnotation() from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
15725
diff
changeset
|
407 return null; |
46397dc87086
moved getParameterAnnotation() from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
15725
diff
changeset
|
408 } |
46397dc87086
moved getParameterAnnotation() from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
15725
diff
changeset
|
409 |
16486
d3fc4779fc60
moved signatureToTypes(ResolvedJavaMethod method) from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16477
diff
changeset
|
410 default JavaType[] toParameterTypes() { |
18845
f57d86eb036f
removed Node factory methods
Doug Simon <doug.simon@oracle.com>
parents:
18823
diff
changeset
|
411 JavaType receiver = isStatic() || isConstructor() ? null : getDeclaringClass(); |
16486
d3fc4779fc60
moved signatureToTypes(ResolvedJavaMethod method) from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16477
diff
changeset
|
412 return getSignature().toParameterTypes(receiver); |
d3fc4779fc60
moved signatureToTypes(ResolvedJavaMethod method) from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16477
diff
changeset
|
413 } |
d3fc4779fc60
moved signatureToTypes(ResolvedJavaMethod method) from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16477
diff
changeset
|
414 |
16488
890d25ac05c3
moved getParameterAnnotations(Class<T> annotationClass, ResolvedJavaMethod method) from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16486
diff
changeset
|
415 /** |
890d25ac05c3
moved getParameterAnnotations(Class<T> annotationClass, ResolvedJavaMethod method) from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16486
diff
changeset
|
416 * Gets the annotations of a particular type for the formal parameters of this method. |
890d25ac05c3
moved getParameterAnnotations(Class<T> annotationClass, ResolvedJavaMethod method) from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16486
diff
changeset
|
417 * |
890d25ac05c3
moved getParameterAnnotations(Class<T> annotationClass, ResolvedJavaMethod method) from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16486
diff
changeset
|
418 * @param annotationClass the Class object corresponding to the annotation type |
890d25ac05c3
moved getParameterAnnotations(Class<T> annotationClass, ResolvedJavaMethod method) from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16486
diff
changeset
|
419 * @return the annotation of type {@code annotationClass} (if any) for each formal parameter |
890d25ac05c3
moved getParameterAnnotations(Class<T> annotationClass, ResolvedJavaMethod method) from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16486
diff
changeset
|
420 * present |
890d25ac05c3
moved getParameterAnnotations(Class<T> annotationClass, ResolvedJavaMethod method) from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16486
diff
changeset
|
421 */ |
890d25ac05c3
moved getParameterAnnotations(Class<T> annotationClass, ResolvedJavaMethod method) from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16486
diff
changeset
|
422 @SuppressWarnings("unchecked") |
890d25ac05c3
moved getParameterAnnotations(Class<T> annotationClass, ResolvedJavaMethod method) from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16486
diff
changeset
|
423 default <T extends Annotation> T[] getParameterAnnotations(Class<T> annotationClass) { |
890d25ac05c3
moved getParameterAnnotations(Class<T> annotationClass, ResolvedJavaMethod method) from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16486
diff
changeset
|
424 Annotation[][] parameterAnnotations = getParameterAnnotations(); |
890d25ac05c3
moved getParameterAnnotations(Class<T> annotationClass, ResolvedJavaMethod method) from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16486
diff
changeset
|
425 T[] result = (T[]) Array.newInstance(annotationClass, parameterAnnotations.length); |
890d25ac05c3
moved getParameterAnnotations(Class<T> annotationClass, ResolvedJavaMethod method) from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16486
diff
changeset
|
426 for (int i = 0; i < parameterAnnotations.length; i++) { |
890d25ac05c3
moved getParameterAnnotations(Class<T> annotationClass, ResolvedJavaMethod method) from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16486
diff
changeset
|
427 for (Annotation a : parameterAnnotations[i]) { |
890d25ac05c3
moved getParameterAnnotations(Class<T> annotationClass, ResolvedJavaMethod method) from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16486
diff
changeset
|
428 if (a.annotationType() == annotationClass) { |
890d25ac05c3
moved getParameterAnnotations(Class<T> annotationClass, ResolvedJavaMethod method) from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16486
diff
changeset
|
429 result[i] = annotationClass.cast(a); |
890d25ac05c3
moved getParameterAnnotations(Class<T> annotationClass, ResolvedJavaMethod method) from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16486
diff
changeset
|
430 } |
890d25ac05c3
moved getParameterAnnotations(Class<T> annotationClass, ResolvedJavaMethod method) from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16486
diff
changeset
|
431 } |
890d25ac05c3
moved getParameterAnnotations(Class<T> annotationClass, ResolvedJavaMethod method) from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16486
diff
changeset
|
432 } |
890d25ac05c3
moved getParameterAnnotations(Class<T> annotationClass, ResolvedJavaMethod method) from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16486
diff
changeset
|
433 return result; |
890d25ac05c3
moved getParameterAnnotations(Class<T> annotationClass, ResolvedJavaMethod method) from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16486
diff
changeset
|
434 } |
890d25ac05c3
moved getParameterAnnotations(Class<T> annotationClass, ResolvedJavaMethod method) from MetaUtil to be a default method in ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16486
diff
changeset
|
435 |
18823
5a21cac1968f
Add utilities ModifiersProvider#isConcrete, ResolvedJavaMethod#hasReceiver, ResolvedJavaMethod#hasBytecodes to Graal API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18532
diff
changeset
|
436 /** |
5a21cac1968f
Add utilities ModifiersProvider#isConcrete, ResolvedJavaMethod#hasReceiver, ResolvedJavaMethod#hasBytecodes to Graal API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18532
diff
changeset
|
437 * Checks whether the method has bytecodes associated with it. Methods without bytecodes are |
5a21cac1968f
Add utilities ModifiersProvider#isConcrete, ResolvedJavaMethod#hasReceiver, ResolvedJavaMethod#hasBytecodes to Graal API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18532
diff
changeset
|
438 * either abstract or native methods. |
5a21cac1968f
Add utilities ModifiersProvider#isConcrete, ResolvedJavaMethod#hasReceiver, ResolvedJavaMethod#hasBytecodes to Graal API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18532
diff
changeset
|
439 * |
5a21cac1968f
Add utilities ModifiersProvider#isConcrete, ResolvedJavaMethod#hasReceiver, ResolvedJavaMethod#hasBytecodes to Graal API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18532
diff
changeset
|
440 * @return whether the definition of this method is Java bytecodes |
5a21cac1968f
Add utilities ModifiersProvider#isConcrete, ResolvedJavaMethod#hasReceiver, ResolvedJavaMethod#hasBytecodes to Graal API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18532
diff
changeset
|
441 */ |
5a21cac1968f
Add utilities ModifiersProvider#isConcrete, ResolvedJavaMethod#hasReceiver, ResolvedJavaMethod#hasBytecodes to Graal API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18532
diff
changeset
|
442 default boolean hasBytecodes() { |
5a21cac1968f
Add utilities ModifiersProvider#isConcrete, ResolvedJavaMethod#hasReceiver, ResolvedJavaMethod#hasBytecodes to Graal API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18532
diff
changeset
|
443 return isConcrete() && !isNative(); |
5a21cac1968f
Add utilities ModifiersProvider#isConcrete, ResolvedJavaMethod#hasReceiver, ResolvedJavaMethod#hasBytecodes to Graal API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18532
diff
changeset
|
444 } |
5a21cac1968f
Add utilities ModifiersProvider#isConcrete, ResolvedJavaMethod#hasReceiver, ResolvedJavaMethod#hasBytecodes to Graal API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18532
diff
changeset
|
445 |
5a21cac1968f
Add utilities ModifiersProvider#isConcrete, ResolvedJavaMethod#hasReceiver, ResolvedJavaMethod#hasBytecodes to Graal API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18532
diff
changeset
|
446 /** |
5a21cac1968f
Add utilities ModifiersProvider#isConcrete, ResolvedJavaMethod#hasReceiver, ResolvedJavaMethod#hasBytecodes to Graal API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18532
diff
changeset
|
447 * Checks whether the method has a receiver parameter - i.e., whether it is not static. |
19510
1cde96b96673
Fixed code format issues.
Roland Schatz <roland.schatz@oracle.com>
parents:
18845
diff
changeset
|
448 * |
18823
5a21cac1968f
Add utilities ModifiersProvider#isConcrete, ResolvedJavaMethod#hasReceiver, ResolvedJavaMethod#hasBytecodes to Graal API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18532
diff
changeset
|
449 * @return whether the method has a receiver parameter |
5a21cac1968f
Add utilities ModifiersProvider#isConcrete, ResolvedJavaMethod#hasReceiver, ResolvedJavaMethod#hasBytecodes to Graal API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18532
diff
changeset
|
450 */ |
5a21cac1968f
Add utilities ModifiersProvider#isConcrete, ResolvedJavaMethod#hasReceiver, ResolvedJavaMethod#hasBytecodes to Graal API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18532
diff
changeset
|
451 default boolean hasReceiver() { |
5a21cac1968f
Add utilities ModifiersProvider#isConcrete, ResolvedJavaMethod#hasReceiver, ResolvedJavaMethod#hasBytecodes to Graal API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18532
diff
changeset
|
452 return !isStatic(); |
5a21cac1968f
Add utilities ModifiersProvider#isConcrete, ResolvedJavaMethod#hasReceiver, ResolvedJavaMethod#hasBytecodes to Graal API.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18532
diff
changeset
|
453 } |
21276
9f6733155647
ensure RegisterFinalizerNode is created when Object::<init> is the compilation root
Doug Simon <doug.simon@oracle.com>
parents:
19510
diff
changeset
|
454 |
9f6733155647
ensure RegisterFinalizerNode is created when Object::<init> is the compilation root
Doug Simon <doug.simon@oracle.com>
parents:
19510
diff
changeset
|
455 /** |
9f6733155647
ensure RegisterFinalizerNode is created when Object::<init> is the compilation root
Doug Simon <doug.simon@oracle.com>
parents:
19510
diff
changeset
|
456 * Determines if this method is {@link java.lang.Object#Object()}. |
9f6733155647
ensure RegisterFinalizerNode is created when Object::<init> is the compilation root
Doug Simon <doug.simon@oracle.com>
parents:
19510
diff
changeset
|
457 */ |
9f6733155647
ensure RegisterFinalizerNode is created when Object::<init> is the compilation root
Doug Simon <doug.simon@oracle.com>
parents:
19510
diff
changeset
|
458 default boolean isJavaLangObjectInit() { |
9f6733155647
ensure RegisterFinalizerNode is created when Object::<init> is the compilation root
Doug Simon <doug.simon@oracle.com>
parents:
19510
diff
changeset
|
459 return getDeclaringClass().isJavaLangObject() && getName().equals("<init>"); |
9f6733155647
ensure RegisterFinalizerNode is created when Object::<init> is the compilation root
Doug Simon <doug.simon@oracle.com>
parents:
19510
diff
changeset
|
460 } |
21629
36cf15e3219e
Move HotSpotResolvedJavaMethod.getSpeculationLog to ResolvedJavaMethod
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21556
diff
changeset
|
461 |
36cf15e3219e
Move HotSpotResolvedJavaMethod.getSpeculationLog to ResolvedJavaMethod
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21556
diff
changeset
|
462 SpeculationLog getSpeculationLog(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
463 } |