comparison graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaMethod.java @ 7037:dd81042f4eb1

added unit tests for ResolvedJavaType replaced some CompilerToVM methods used by HotSpotResolvedJavaType with pure Java code
author Doug Simon <doug.simon@oracle.com>
date Tue, 27 Nov 2012 11:21:48 +0100
parents 2463eb24b644
children 79a7b761755c
comparison
equal deleted inserted replaced
7036:8c4b757c2eb9 7037:dd81042f4eb1
33 public interface ResolvedJavaMethod extends JavaMethod { 33 public interface ResolvedJavaMethod extends JavaMethod {
34 34
35 /** 35 /**
36 * Returns the bytecodes of this method, if the method has code. The returned byte array does not contain 36 * Returns the bytecodes of this method, if the method has code. The returned byte array does not contain
37 * breakpoints or non-Java bytecodes. 37 * breakpoints or non-Java bytecodes.
38 * 38 *
39 * @return the bytecodes of the method, or {@code null} if none is available 39 * @return the bytecodes of the method, or {@code null} if none is available
40 */ 40 */
41 byte[] getCode(); 41 byte[] getCode();
42 42
43 /** 43 /**
44 * Returns the size of the bytecodes of this method, if the method has code. This is equivalent to 44 * Returns the size of the bytecodes of this method, if the method has code. This is equivalent to
45 * {@link #getCode()}. {@code length} if the method has code. 45 * {@link #getCode()}. {@code length} if the method has code.
46 * 46 *
47 * @return the size of the bytecodes in bytes, or 0 if no bytecodes is available 47 * @return the size of the bytecodes in bytes, or 0 if no bytecodes is available
48 */ 48 */
49 int getCodeSize(); 49 int getCodeSize();
50 50
51 /** 51 /**
52 * Returns the size of the compiled machine code of this method. 52 * Returns the size of the compiled machine code of this method.
53 * 53 *
54 * @return the size of the compiled machine code in bytes, or 0 if no compiled code exists. 54 * @return the size of the compiled machine code in bytes, or 0 if no compiled code exists.
55 */ 55 */
56 int getCompiledCodeSize(); 56 int getCompiledCodeSize();
57 57
58 /** 58 /**
59 * Returns an estimate how complex it is to compile this method. 59 * Returns an estimate how complex it is to compile this method.
60 * 60 *
61 * @return A value >= 0, where higher means more complex. 61 * @return A value >= 0, where higher means more complex.
62 */ 62 */
63 int getCompilationComplexity(); 63 int getCompilationComplexity();
64 64
65 /** 65 /**
77 */ 77 */
78 int getMaxStackSize(); 78 int getMaxStackSize();
79 79
80 /** 80 /**
81 * Returns the Java language modifiers for this method, as an integer. The {@link Modifier} class should be used to 81 * Returns the Java language modifiers for this method, as an integer. The {@link Modifier} class should be used to
82 * decode the modifiers. Only the flags specified in the JVM specification will be included in the returned mask. 82 * decode the modifiers. Only the {@linkplain Modifier#methodModifiers() method flags} specified in the JVM
83 * specification will be included in the returned mask.
83 */ 84 */
84 int getModifiers(); 85 int getModifiers();
85 86
86 /** 87 /**
87 * Checks whether this method is a class initializer. 88 * Checks whether this method is a class initializer.
88 * 89 *
89 * @return {@code true} if the method is a class initializer 90 * @return {@code true} if the method is a class initializer
90 */ 91 */
91 boolean isClassInitializer(); 92 boolean isClassInitializer();
92 93
93 /** 94 /**
94 * Checks whether this method is a constructor. 95 * Checks whether this method is a constructor.
95 * 96 *
96 * @return {@code true} if the method is a constructor 97 * @return {@code true} if the method is a constructor
97 */ 98 */
98 boolean isConstructor(); 99 boolean isConstructor();
99 100
100 /** 101 /**
101 * Checks whether this method can be statically bound (usually, that means it is final or private or static, but not 102 * Checks whether this method can be statically bound (usually, that means it is final or private or static, but not
102 * abstract). 103 * abstract).
103 * 104 *
104 * @return {@code true} if this method can be statically bound 105 * @return {@code true} if this method can be statically bound
105 */ 106 */
106 boolean canBeStaticallyBound(); 107 boolean canBeStaticallyBound();
107 108
108 /** 109 /**
130 */ 131 */
131 ConstantPool getConstantPool(); 132 ConstantPool getConstantPool();
132 133
133 /** 134 /**
134 * Returns the annotation for the specified type of this method, if such an annotation is present. 135 * Returns the annotation for the specified type of this method, if such an annotation is present.
135 * 136 *
136 * @param annotationClass the Class object corresponding to the annotation type 137 * @param annotationClass the Class object corresponding to the annotation type
137 * @return this element's annotation for the specified annotation type if present on this method, else {@code null} 138 * @return this element's annotation for the specified annotation type if present on this method, else {@code null}
138 */ 139 */
139 <T extends Annotation> T getAnnotation(Class<T> annotationClass); 140 <T extends Annotation> T getAnnotation(Class<T> annotationClass);
140 141
141 /** 142 /**
142 * Returns an array of arrays that represent the annotations on the formal parameters, in declaration order, of this 143 * Returns an array of arrays that represent the annotations on the formal parameters, in declaration order, of this
143 * method. 144 * method.
144 * 145 *
145 * @see Method#getParameterAnnotations() 146 * @see Method#getParameterAnnotations()
146 */ 147 */
147 Annotation[][] getParameterAnnotations(); 148 Annotation[][] getParameterAnnotations();
148 149
149 /** 150 /**
150 * Returns an array of {@link Type} objects that represent the formal parameter types, in declaration order, of this 151 * Returns an array of {@link Type} objects that represent the formal parameter types, in declaration order, of this
151 * method. 152 * method.
152 * 153 *
153 * @see Method#getGenericParameterTypes() 154 * @see Method#getGenericParameterTypes()
154 */ 155 */
155 Type[] getGenericParameterTypes(); 156 Type[] getGenericParameterTypes();
156 157
157 /** 158 /**