Mercurial > hg > graal-jvmci-8
comparison jvmci/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaMethod.java @ 23749:d6bd0b9cd0b6
remove uses of setAccessible (JDK-8165434)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 07 Sep 2016 15:17:13 +0200 |
parents | 6542cd8da2da |
children | 0cb263db490f |
comparison
equal
deleted
inserted
replaced
23748:3e551611f1fc | 23749:d6bd0b9cd0b6 |
---|---|
24 | 24 |
25 import java.lang.annotation.Annotation; | 25 import java.lang.annotation.Annotation; |
26 import java.lang.reflect.AnnotatedElement; | 26 import java.lang.reflect.AnnotatedElement; |
27 import java.lang.reflect.Array; | 27 import java.lang.reflect.Array; |
28 import java.lang.reflect.Method; | 28 import java.lang.reflect.Method; |
29 import java.lang.reflect.Modifier; | |
30 import java.lang.reflect.Type; | 29 import java.lang.reflect.Type; |
31 | 30 |
32 /** | 31 /** |
33 * Represents a resolved Java method. Methods, like fields and types, are resolved through | 32 * Represents a resolved Java method. Methods, like fields and types, are resolved through |
34 * {@link ConstantPool constant pools}. | 33 * {@link ConstantPool constant pools}. |
70 /** | 69 /** |
71 * Returns the maximum number of stack slots used in this method's bytecodes. | 70 * Returns the maximum number of stack slots used in this method's bytecodes. |
72 */ | 71 */ |
73 int getMaxStackSize(); | 72 int getMaxStackSize(); |
74 | 73 |
75 /** | |
76 * {@inheritDoc} | |
77 * <p> | |
78 * Only the {@linkplain Modifier#methodModifiers() method flags} specified in the JVM | |
79 * specification will be included in the returned mask. | |
80 */ | |
81 int getModifiers(); | |
82 | |
83 default boolean isFinal() { | 74 default boolean isFinal() { |
84 return ModifiersProvider.super.isFinalFlagSet(); | 75 return ModifiersProvider.super.isFinalFlagSet(); |
85 } | 76 } |
86 | 77 |
87 /** | 78 /** |
88 * Determines if this method is a synthetic method as defined by the Java Language | 79 * Determines if this method is a synthetic method as defined by the Java Language |
89 * Specification. | 80 * Specification. |
90 */ | 81 */ |
91 default boolean isSynthetic() { | 82 boolean isSynthetic(); |
92 return (SYNTHETIC & getModifiers()) == SYNTHETIC; | |
93 } | |
94 | 83 |
95 /** | 84 /** |
96 * Checks that the method is a | 85 * Checks that the method is a |
97 * <a href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.6">varargs</a> | 86 * <a href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.6">varargs</a> |
98 * method. | 87 * method. |
99 * | 88 * |
100 * @return whether the method is a varargs method | 89 * @return whether the method is a varargs method |
101 */ | 90 */ |
102 default boolean isVarArgs() { | 91 boolean isVarArgs(); |
103 return (VARARGS & getModifiers()) == VARARGS; | |
104 } | |
105 | 92 |
106 /** | 93 /** |
107 * Checks that the method is a | 94 * Checks that the method is a |
108 * <a href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.6">bridge</a> | 95 * <a href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.6">bridge</a> |
109 * method. | 96 * method. |
110 * | 97 * |
111 * @return whether the method is a bridge method | 98 * @return whether the method is a bridge method |
112 */ | 99 */ |
113 default boolean isBridge() { | 100 boolean isBridge(); |
114 return (BRIDGE & getModifiers()) == BRIDGE; | |
115 } | |
116 | 101 |
117 /** | 102 /** |
118 * Returns {@code true} if this method is a default method; returns {@code false} otherwise. | 103 * Returns {@code true} if this method is a default method; returns {@code false} otherwise. |
119 * | 104 * |
120 * A default method is a public non-abstract instance method, that is, a non-static method with | 105 * A default method is a public non-abstract instance method, that is, a non-static method with |
224 /** | 209 /** |
225 * Returns the local variable table of this method or null if this method does not have a local | 210 * Returns the local variable table of this method or null if this method does not have a local |
226 * variable table. | 211 * variable table. |
227 */ | 212 */ |
228 LocalVariableTable getLocalVariableTable(); | 213 LocalVariableTable getLocalVariableTable(); |
229 | |
230 /** | |
231 * Invokes the underlying method represented by this object, on the specified object with the | |
232 * specified parameters. This method is similar to a reflective method invocation by | |
233 * {@link Method#invoke}. | |
234 * | |
235 * @param receiver The receiver for the invocation, or {@code null} if it is a static method. | |
236 * @param arguments The arguments for the invocation. | |
237 * @return The value returned by the method invocation, or {@code null} if the return type is | |
238 * {@code void}. | |
239 */ | |
240 JavaConstant invoke(JavaConstant receiver, JavaConstant[] arguments); | |
241 | 214 |
242 /** | 215 /** |
243 * Gets the encoding of (that is, a constant representing the value of) this method. | 216 * Gets the encoding of (that is, a constant representing the value of) this method. |
244 * | 217 * |
245 * @return a constant representing a reference to this method | 218 * @return a constant representing a reference to this method |