< prev index next >
src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaKind.java
Print this page
*** 20,39 ****
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.vm.ci.meta;
! import java.lang.reflect.*;
//JaCoCo Exclude
/**
* Denotes the basic kinds of types in CRI, including the all the Java primitive types, for example,
* {@link JavaKind#Int} for {@code int} and {@link JavaKind#Object} for all object types. A kind has
* a single character short name, a Java name, and a set of flags further describing its behavior.
*/
! public enum JavaKind implements PlatformKind {
/** The primitive boolean kind, represented as an int on the stack. */
Boolean('z', "boolean", 1, true, java.lang.Boolean.TYPE, java.lang.Boolean.class),
/** The primitive byte kind, represented as an int on the stack. */
Byte('b', "byte", 1, true, java.lang.Byte.TYPE, java.lang.Byte.class),
--- 20,39 ----
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.vm.ci.meta;
! import java.lang.reflect.Array;
//JaCoCo Exclude
/**
* Denotes the basic kinds of types in CRI, including the all the Java primitive types, for example,
* {@link JavaKind#Int} for {@code int} and {@link JavaKind#Object} for all object types. A kind has
* a single character short name, a Java name, and a set of flags further describing its behavior.
*/
! public enum JavaKind {
/** The primitive boolean kind, represented as an int on the stack. */
Boolean('z', "boolean", 1, true, java.lang.Boolean.TYPE, java.lang.Boolean.class),
/** The primitive byte kind, represented as an int on the stack. */
Byte('b', "byte", 1, true, java.lang.Byte.TYPE, java.lang.Byte.class),
*** 68,78 ****
private final char typeChar;
private final String javaName;
private final boolean isStackInt;
private final Class<?> primitiveJavaClass;
private final Class<?> boxedJavaClass;
- private final EnumKey<JavaKind> key = new EnumKey<>(this);
private final int slotCount;
private JavaKind(char typeChar, String javaName, int slotCount, boolean isStackInt, Class<?> primitiveJavaClass, Class<?> boxedJavaClass) {
this.typeChar = typeChar;
this.javaName = javaName;
--- 68,77 ----
*** 111,124 ****
*/
public String getJavaName() {
return javaName;
}
- public Key getKey() {
- return key;
- }
-
/**
* Checks whether this type is a Java primitive type.
*
* @return {@code true} if this is {@link #Boolean}, {@link #Byte}, {@link #Char},
* {@link #Short}, {@link #Int}, {@link #Long}, {@link #Float}, {@link #Double}, or
--- 110,119 ----
*** 458,496 ****
return 64;
default:
throw new IllegalArgumentException("illegal call to bits on " + this);
}
}
-
- public JavaConstant getDefaultValue() {
- switch (this) {
- case Boolean:
- return JavaConstant.FALSE;
- case Int:
- return JavaConstant.INT_0;
- case Long:
- return JavaConstant.LONG_0;
- case Float:
- return JavaConstant.FLOAT_0;
- case Double:
- return JavaConstant.DOUBLE_0;
- case Object:
- return JavaConstant.NULL_POINTER;
- case Byte:
- case Char:
- case Short:
- return new PrimitiveConstant(this, 0);
- default:
- throw new IllegalArgumentException("illegal call to getDefaultValue on " + this);
- }
- }
-
- @Override
- public int getSizeInBytes() {
- return getByteCount();
- }
-
- @Override
- public int getVectorLength() {
- return 1;
- }
}
--- 453,458 ----
< prev index next >