/** * Returns the class name in the JVM format (such as "java/lang/String") */ public static String toVMClassName( Class c ) { assert !c.isPrimitive(); if(c.isArray()) // I have no idea why it is designed like this, but javap says so. return toVMTypeName(c); return c.getName().replace('.','/'); }
public static String toVMTypeName( Class c ) { if(c.isArray()) { // TODO: study how an array type is encoded. return '['+toVMTypeName(c.getComponentType()); } if(c.isPrimitive()) { if(c==Boolean.TYPE) return "Z"; if(c==Character.TYPE) return "C"; if(c==Byte.TYPE) return "B"; if(c==Double.TYPE) return "D"; if(c==Float.TYPE) return "F"; if(c==Integer.TYPE) return "I"; if(c==Long.TYPE) return "J"; if(c==Short.TYPE) return "S"; throw new IllegalArgumentException(c.getName()); } return 'L'+c.getName().replace('.','/')+';'; }
/** * Returns the class name in the JVM format (such as "java/lang/String") */ public static String toVMClassName( Class c ) { assert !c.isPrimitive(); if(c.isArray()) // I have no idea why it is designed like this, but javap says so. return toVMTypeName(c); return c.getName().replace('.','/'); }
public static String toVMTypeName( Class c ) { if(c.isArray()) { // TODO: study how an array type is encoded. return '['+toVMTypeName(c.getComponentType()); } if(c.isPrimitive()) { if(c==Boolean.TYPE) return "Z"; if(c==Character.TYPE) return "C"; if(c==Byte.TYPE) return "B"; if(c==Double.TYPE) return "D"; if(c==Float.TYPE) return "F"; if(c==Integer.TYPE) return "I"; if(c==Long.TYPE) return "J"; if(c==Short.TYPE) return "S"; throw new IllegalArgumentException(c.getName()); } return 'L'+c.getName().replace('.','/')+';'; }
/** * Returns the class name in the JVM format (such as "java/lang/String") */ public static String toVMClassName( Class c ) { assert !c.isPrimitive(); if(c.isArray()) // I have no idea why it is designed like this, but javap says so. return toVMTypeName(c); return c.getName().replace('.','/'); }
/** * Returns the class name in the JVM format (such as "java/lang/String") */ public static String toVMClassName( Class c ) { assert !c.isPrimitive(); if(c.isArray()) // I have no idea why it is designed like this, but javap says so. return toVMTypeName(c); return c.getName().replace('.','/'); }
public static String toVMTypeName( Class c ) { if(c.isArray()) { // TODO: study how an array type is encoded. return '['+toVMTypeName(c.getComponentType()); } if(c.isPrimitive()) { if(c==Boolean.TYPE) return "Z"; if(c==Character.TYPE) return "C"; if(c==Byte.TYPE) return "B"; if(c==Double.TYPE) return "D"; if(c==Float.TYPE) return "F"; if(c==Integer.TYPE) return "I"; if(c==Long.TYPE) return "J"; if(c==Short.TYPE) return "S"; throw new IllegalArgumentException(c.getName()); } return 'L'+c.getName().replace('.','/')+';'; }
public static String toVMTypeName( Class c ) { if(c.isArray()) { // TODO: study how an array type is encoded. return '['+toVMTypeName(c.getComponentType()); } if(c.isPrimitive()) { if(c==Boolean.TYPE) return "Z"; if(c==Character.TYPE) return "C"; if(c==Byte.TYPE) return "B"; if(c==Double.TYPE) return "D"; if(c==Float.TYPE) return "F"; if(c==Integer.TYPE) return "I"; if(c==Long.TYPE) return "J"; if(c==Short.TYPE) return "S"; throw new IllegalArgumentException(c.getName()); } return 'L'+c.getName().replace('.','/')+';'; }
toVMClassName(Ref.class), toVMClassName(field.getType()), toVMTypeName(Ref.class), toVMTypeName(field.getType()), "f_ref", field.getName() );
toVMClassName(Ref.class), toVMClassName(t), "()"+toVMTypeName(Ref.class), "()"+toVMTypeName(t), '('+toVMTypeName(Ref.class)+")V", '('+toVMTypeName(t)+")V",