--- old/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/BasicType.java 2017-11-09 22:14:04.393160555 +0900 +++ new/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/BasicType.java 2017-11-09 22:14:04.180159394 +0900 @@ -46,23 +46,23 @@ public static final int tConflict = 19; public static final int tIllegal = 99; - public static final BasicType T_BOOLEAN = new BasicType(tBoolean); - public static final BasicType T_CHAR = new BasicType(tChar); - public static final BasicType T_FLOAT = new BasicType(tFloat); - public static final BasicType T_DOUBLE = new BasicType(tDouble); - public static final BasicType T_BYTE = new BasicType(tByte); - public static final BasicType T_SHORT = new BasicType(tShort); - public static final BasicType T_INT = new BasicType(tInt); - public static final BasicType T_LONG = new BasicType(tLong); - public static final BasicType T_OBJECT = new BasicType(tObject); - public static final BasicType T_ARRAY = new BasicType(tArray); - public static final BasicType T_VOID = new BasicType(tVoid); - public static final BasicType T_ADDRESS = new BasicType(tAddress); - public static final BasicType T_NARROWOOP = new BasicType(tNarrowOop); - public static final BasicType T_METADATA = new BasicType(tMetadata); - public static final BasicType T_NARROWKLASS = new BasicType(tNarrowKlass); - public static final BasicType T_CONFLICT = new BasicType(tConflict); - public static final BasicType T_ILLEGAL = new BasicType(tIllegal); + public static final BasicType T_BOOLEAN = new BasicType(tBoolean, "boolean"); + public static final BasicType T_CHAR = new BasicType(tChar, "char"); + public static final BasicType T_FLOAT = new BasicType(tFloat, "float"); + public static final BasicType T_DOUBLE = new BasicType(tDouble, "double"); + public static final BasicType T_BYTE = new BasicType(tByte, "byte"); + public static final BasicType T_SHORT = new BasicType(tShort, "short"); + public static final BasicType T_INT = new BasicType(tInt, "int"); + public static final BasicType T_LONG = new BasicType(tLong, "long"); + public static final BasicType T_OBJECT = new BasicType(tObject, "object"); + public static final BasicType T_ARRAY = new BasicType(tArray, "array"); + public static final BasicType T_VOID = new BasicType(tVoid, "void"); + public static final BasicType T_ADDRESS = new BasicType(tAddress, "address"); + public static final BasicType T_NARROWOOP = new BasicType(tNarrowOop, "narrow oop"); + public static final BasicType T_METADATA = new BasicType(tMetadata, "metadata"); + public static final BasicType T_NARROWKLASS = new BasicType(tNarrowKlass, "narrow klass"); + public static final BasicType T_CONFLICT = new BasicType(tConflict, "conflict"); + public static final BasicType T_ILLEGAL = new BasicType(tIllegal, "ILLEGAL TYPE"); public static int getTBoolean() { return tBoolean; @@ -133,6 +133,28 @@ return tIllegal; } + public static BasicType intToBasicType(int i) { + switch(i) { + case tBoolean: return T_BOOLEAN; + case tChar: return T_CHAR; + case tFloat: return T_FLOAT; + case tDouble: return T_DOUBLE; + case tByte: return T_BYTE; + case tShort: return T_SHORT; + case tInt: return T_INT; + case tLong: return T_LONG; + case tObject: return T_OBJECT; + case tArray: return T_ARRAY; + case tVoid: return T_VOID; + case tAddress: return T_ADDRESS; + case tNarrowOop: return T_NARROWOOP; + case tMetadata: return T_METADATA; + case tNarrowKlass: return T_NARROWKLASS; + } + + return T_ILLEGAL; + } + public static BasicType charToBasicType(char c) { switch( c ) { case 'B': return T_BYTE; @@ -158,10 +180,16 @@ return type; } + public String getName() { + return name; + } + //-- Internals only below this point - private BasicType(int type) { + private BasicType(int type, String name) { this.type = type; + this.name = name; } private int type; + private String name; }