11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23 package jdk.vm.ci.hotspot;
24
25 import static java.util.Objects.requireNonNull;
26
27 import java.lang.annotation.Annotation;
28 import java.lang.reflect.Array;
29 import java.lang.reflect.Modifier;
30
31 import jdk.vm.ci.common.JVMCIError;
32 import jdk.vm.ci.meta.Assumptions.AssumptionResult;
33 import jdk.vm.ci.meta.JavaConstant;
34 import jdk.vm.ci.meta.JavaKind;
35 import jdk.vm.ci.meta.JavaType;
36 import jdk.vm.ci.meta.ResolvedJavaField;
37 import jdk.vm.ci.meta.ResolvedJavaMethod;
38 import jdk.vm.ci.meta.ResolvedJavaType;
39
40 /**
41 * Implementation of {@link JavaType} for primitive HotSpot types.
42 */
43 public final class HotSpotResolvedPrimitiveType extends HotSpotResolvedJavaType implements HotSpotProxified {
44
45 private final JavaKind kind;
46
47 /**
48 * Creates the JVMCI mirror for a primitive {@link JavaKind}.
49 *
50 * <p>
51 * <b>NOTE</b>: Creating an instance of this class does not install the mirror for the
83 return null;
84 }
85
86 @Override
87 public ResolvedJavaType asExactType() {
88 return this;
89 }
90
91 @Override
92 public ResolvedJavaType getSuperclass() {
93 return null;
94 }
95
96 @Override
97 public ResolvedJavaType[] getInterfaces() {
98 return new ResolvedJavaType[0];
99 }
100
101 @Override
102 public ResolvedJavaType getSingleImplementor() {
103 throw new JVMCIError("Cannot call getSingleImplementor() on a non-interface type: %s", this);
104 }
105
106 @Override
107 public ResolvedJavaType findLeastCommonAncestor(ResolvedJavaType otherType) {
108 return null;
109 }
110
111 @Override
112 public AssumptionResult<Boolean> hasFinalizableSubclass() {
113 return new AssumptionResult<>(false);
114 }
115
116 @Override
117 public boolean hasFinalizer() {
118 return false;
119 }
120
121 @Override
122 public boolean isArray() {
123 return false;
213 return null;
214 }
215
216 @Override
217 public ResolvedJavaType resolve(ResolvedJavaType accessingClass) {
218 requireNonNull(accessingClass);
219 return this;
220 }
221
222 @Override
223 public void initialize() {
224 }
225
226 @Override
227 public ResolvedJavaField findInstanceFieldWithOffset(long offset, JavaKind expectedType) {
228 return null;
229 }
230
231 @Override
232 public String getSourceFileName() {
233 throw JVMCIError.unimplemented();
234 }
235
236 @Override
237 public Class<?> mirror() {
238 return kind.toJavaClass();
239 }
240
241 @Override
242 public boolean isLocal() {
243 return false;
244 }
245
246 @Override
247 public boolean isMember() {
248 return false;
249 }
250
251 @Override
252 public ResolvedJavaType getEnclosingType() {
253 return null;
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23 package jdk.vm.ci.hotspot;
24
25 import static java.util.Objects.requireNonNull;
26
27 import java.lang.annotation.Annotation;
28 import java.lang.reflect.Array;
29 import java.lang.reflect.Modifier;
30
31 import jdk.vm.ci.meta.Assumptions.AssumptionResult;
32 import jdk.vm.ci.meta.JavaConstant;
33 import jdk.vm.ci.meta.JavaKind;
34 import jdk.vm.ci.meta.JavaType;
35 import jdk.vm.ci.meta.ResolvedJavaField;
36 import jdk.vm.ci.meta.ResolvedJavaMethod;
37 import jdk.vm.ci.meta.ResolvedJavaType;
38
39 /**
40 * Implementation of {@link JavaType} for primitive HotSpot types.
41 */
42 public final class HotSpotResolvedPrimitiveType extends HotSpotResolvedJavaType implements HotSpotProxified {
43
44 private final JavaKind kind;
45
46 /**
47 * Creates the JVMCI mirror for a primitive {@link JavaKind}.
48 *
49 * <p>
50 * <b>NOTE</b>: Creating an instance of this class does not install the mirror for the
82 return null;
83 }
84
85 @Override
86 public ResolvedJavaType asExactType() {
87 return this;
88 }
89
90 @Override
91 public ResolvedJavaType getSuperclass() {
92 return null;
93 }
94
95 @Override
96 public ResolvedJavaType[] getInterfaces() {
97 return new ResolvedJavaType[0];
98 }
99
100 @Override
101 public ResolvedJavaType getSingleImplementor() {
102 throw new InternalError("Cannot call getSingleImplementor() on a non-interface type: " + this);
103 }
104
105 @Override
106 public ResolvedJavaType findLeastCommonAncestor(ResolvedJavaType otherType) {
107 return null;
108 }
109
110 @Override
111 public AssumptionResult<Boolean> hasFinalizableSubclass() {
112 return new AssumptionResult<>(false);
113 }
114
115 @Override
116 public boolean hasFinalizer() {
117 return false;
118 }
119
120 @Override
121 public boolean isArray() {
122 return false;
212 return null;
213 }
214
215 @Override
216 public ResolvedJavaType resolve(ResolvedJavaType accessingClass) {
217 requireNonNull(accessingClass);
218 return this;
219 }
220
221 @Override
222 public void initialize() {
223 }
224
225 @Override
226 public ResolvedJavaField findInstanceFieldWithOffset(long offset, JavaKind expectedType) {
227 return null;
228 }
229
230 @Override
231 public String getSourceFileName() {
232 throw new InternalError();
233 }
234
235 @Override
236 public Class<?> mirror() {
237 return kind.toJavaClass();
238 }
239
240 @Override
241 public boolean isLocal() {
242 return false;
243 }
244
245 @Override
246 public boolean isMember() {
247 return false;
248 }
249
250 @Override
251 public ResolvedJavaType getEnclosingType() {
252 return null;
|