--- a/src/java.base/share/classes/java/lang/classfile/AnnotationValue.java +++ b/src/java.base/share/classes/java/lang/classfile/AnnotationValue.java @@ -428,6 +428,45 @@ default ClassDesc classSymbol() { Utf8Entry constantName(); } + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfByte}. */ + int AEV_BYTE = 'B'; + + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfChar}. */ + int AEV_CHAR = 'C'; + + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfDouble}. */ + int AEV_DOUBLE = 'D'; + + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfFloat}. */ + int AEV_FLOAT = 'F'; + + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfInt}. */ + int AEV_INT = 'I'; + + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfLong}. */ + int AEV_LONG = 'J'; + + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfShort}. */ + int AEV_SHORT = 'S'; + + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfBoolean}. */ + int AEV_BOOLEAN = 'Z'; + + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfString}. */ + int AEV_STRING = 's'; + + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfEnum}. */ + int AEV_ENUM = 'e'; + + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfClass}. */ + int AEV_CLASS = 'c'; + + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfAnnotation}. */ + int AEV_ANNOTATION = '@'; + + /** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfArray}. */ + int AEV_ARRAY = '['; + /** * {@return the tag character for this value as per JVMS {@jvms 4.7.16.1}} * The tag characters have a one-to-one mapping to the types of annotation element values. --- a/src/java.base/share/classes/java/lang/classfile/ClassFile.java +++ b/src/java.base/share/classes/java/lang/classfile/ClassFile.java @@ -512,903 +512,75 @@ default List verify(Path path) throws IOException { /** 0xCAFEBABE */ int MAGIC_NUMBER = 0xCAFEBABE; - /** The integer value used to encode the NOP instruction. */ - int NOP = 0; - - /** The integer value used to encode the ACONST_NULL instruction. */ - int ACONST_NULL = 1; - - /** The integer value used to encode the ICONST_M1 instruction. */ - int ICONST_M1 = 2; - - /** The integer value used to encode the ICONST_0 instruction. */ - int ICONST_0 = 3; - - /** The integer value used to encode the ICONST_1 instruction. */ - int ICONST_1 = 4; - - /** The integer value used to encode the ICONST_2 instruction. */ - int ICONST_2 = 5; - - /** The integer value used to encode the ICONST_3 instruction. */ - int ICONST_3 = 6; - - /** The integer value used to encode the ICONST_4 instruction. */ - int ICONST_4 = 7; - - /** The integer value used to encode the ICONST_5 instruction. */ - int ICONST_5 = 8; - - /** The integer value used to encode the LCONST_0 instruction. */ - int LCONST_0 = 9; - - /** The integer value used to encode the LCONST_1 instruction. */ - int LCONST_1 = 10; - - /** The integer value used to encode the FCONST_0 instruction. */ - int FCONST_0 = 11; - - /** The integer value used to encode the FCONST_1 instruction. */ - int FCONST_1 = 12; - - /** The integer value used to encode the FCONST_2 instruction. */ - int FCONST_2 = 13; - - /** The integer value used to encode the DCONST_0 instruction. */ - int DCONST_0 = 14; - - /** The integer value used to encode the DCONST_1 instruction. */ - int DCONST_1 = 15; - - /** The integer value used to encode the BIPUSH instruction. */ - int BIPUSH = 16; - - /** The integer value used to encode the SIPUSH instruction. */ - int SIPUSH = 17; - - /** The integer value used to encode the LDC instruction. */ - int LDC = 18; - - /** The integer value used to encode the LDC_W instruction. */ - int LDC_W = 19; - - /** The integer value used to encode the LDC2_W instruction. */ - int LDC2_W = 20; - - /** The integer value used to encode the ILOAD instruction. */ - int ILOAD = 21; - - /** The integer value used to encode the LLOAD instruction. */ - int LLOAD = 22; - - /** The integer value used to encode the FLOAD instruction. */ - int FLOAD = 23; - - /** The integer value used to encode the DLOAD instruction. */ - int DLOAD = 24; - - /** The integer value used to encode the ALOAD instruction. */ - int ALOAD = 25; - - /** The integer value used to encode the ILOAD_0 instruction. */ - int ILOAD_0 = 26; - - /** The integer value used to encode the ILOAD_1 instruction. */ - int ILOAD_1 = 27; - - /** The integer value used to encode the ILOAD_2 instruction. */ - int ILOAD_2 = 28; - - /** The integer value used to encode the ILOAD_3 instruction. */ - int ILOAD_3 = 29; - - /** The integer value used to encode the LLOAD_0 instruction. */ - int LLOAD_0 = 30; - - /** The integer value used to encode the LLOAD_1 instruction. */ - int LLOAD_1 = 31; - - /** The integer value used to encode the LLOAD_2 instruction. */ - int LLOAD_2 = 32; - - /** The integer value used to encode the LLOAD_3 instruction. */ - int LLOAD_3 = 33; - - /** The integer value used to encode the FLOAD_0 instruction. */ - int FLOAD_0 = 34; - - /** The integer value used to encode the FLOAD_1 instruction. */ - int FLOAD_1 = 35; - - /** The integer value used to encode the FLOAD_2 instruction. */ - int FLOAD_2 = 36; - - /** The integer value used to encode the FLOAD_3 instruction. */ - int FLOAD_3 = 37; - - /** The integer value used to encode the DLOAD_0 instruction. */ - int DLOAD_0 = 38; - - /** The integer value used to encode the DLOAD_1 instruction. */ - int DLOAD_1 = 39; - - /** The integer value used to encode the DLOAD_2 instruction. */ - int DLOAD_2 = 40; - - /** The integer value used to encode the DLOAD_3 instruction. */ - int DLOAD_3 = 41; - - /** The integer value used to encode the ALOAD_0 instruction. */ - int ALOAD_0 = 42; - - /** The integer value used to encode the ALOAD_1 instruction. */ - int ALOAD_1 = 43; - - /** The integer value used to encode the ALOAD_2 instruction. */ - int ALOAD_2 = 44; - - /** The integer value used to encode the ALOAD_3 instruction. */ - int ALOAD_3 = 45; - - /** The integer value used to encode the IALOAD instruction. */ - int IALOAD = 46; - - /** The integer value used to encode the LALOAD instruction. */ - int LALOAD = 47; - - /** The integer value used to encode the FALOAD instruction. */ - int FALOAD = 48; - - /** The integer value used to encode the DALOAD instruction. */ - int DALOAD = 49; - - /** The integer value used to encode the AALOAD instruction. */ - int AALOAD = 50; - - /** The integer value used to encode the BALOAD instruction. */ - int BALOAD = 51; - - /** The integer value used to encode the CALOAD instruction. */ - int CALOAD = 52; - - /** The integer value used to encode the SALOAD instruction. */ - int SALOAD = 53; - - /** The integer value used to encode the ISTORE instruction. */ - int ISTORE = 54; - - /** The integer value used to encode the LSTORE instruction. */ - int LSTORE = 55; - - /** The integer value used to encode the FSTORE instruction. */ - int FSTORE = 56; - - /** The integer value used to encode the DSTORE instruction. */ - int DSTORE = 57; - - /** The integer value used to encode the ASTORE instruction. */ - int ASTORE = 58; - - /** The integer value used to encode the ISTORE_0 instruction. */ - int ISTORE_0 = 59; - - /** The integer value used to encode the ISTORE_1 instruction. */ - int ISTORE_1 = 60; - - /** The integer value used to encode the ISTORE_2 instruction. */ - int ISTORE_2 = 61; - - /** The integer value used to encode the ISTORE_3 instruction. */ - int ISTORE_3 = 62; - - /** The integer value used to encode the LSTORE_0 instruction. */ - int LSTORE_0 = 63; - - /** The integer value used to encode the LSTORE_1 instruction. */ - int LSTORE_1 = 64; - - /** The integer value used to encode the LSTORE_2 instruction. */ - int LSTORE_2 = 65; - - /** The integer value used to encode the LSTORE_3 instruction. */ - int LSTORE_3 = 66; - - /** The integer value used to encode the FSTORE_0 instruction. */ - int FSTORE_0 = 67; - - /** The integer value used to encode the FSTORE_1 instruction. */ - int FSTORE_1 = 68; - - /** The integer value used to encode the FSTORE_2 instruction. */ - int FSTORE_2 = 69; - - /** The integer value used to encode the FSTORE_3 instruction. */ - int FSTORE_3 = 70; - - /** The integer value used to encode the DSTORE_0 instruction. */ - int DSTORE_0 = 71; - - /** The integer value used to encode the DSTORE_1 instruction. */ - int DSTORE_1 = 72; - - /** The integer value used to encode the DSTORE_2 instruction. */ - int DSTORE_2 = 73; - - /** The integer value used to encode the DSTORE_3 instruction. */ - int DSTORE_3 = 74; - - /** The integer value used to encode the ASTORE_0 instruction. */ - int ASTORE_0 = 75; - - /** The integer value used to encode the ASTORE_1 instruction. */ - int ASTORE_1 = 76; - - /** The integer value used to encode the ASTORE_2 instruction. */ - int ASTORE_2 = 77; - - /** The integer value used to encode the ASTORE_3 instruction. */ - int ASTORE_3 = 78; - - /** The integer value used to encode the IASTORE instruction. */ - int IASTORE = 79; - - /** The integer value used to encode the LASTORE instruction. */ - int LASTORE = 80; - - /** The integer value used to encode the FASTORE instruction. */ - int FASTORE = 81; - - /** The integer value used to encode the DASTORE instruction. */ - int DASTORE = 82; - - /** The integer value used to encode the AASTORE instruction. */ - int AASTORE = 83; - - /** The integer value used to encode the BASTORE instruction. */ - int BASTORE = 84; - - /** The integer value used to encode the CASTORE instruction. */ - int CASTORE = 85; - - /** The integer value used to encode the SASTORE instruction. */ - int SASTORE = 86; - - /** The integer value used to encode the POP instruction. */ - int POP = 87; - - /** The integer value used to encode the POP2 instruction. */ - int POP2 = 88; - - /** The integer value used to encode the DUP instruction. */ - int DUP = 89; - - /** The integer value used to encode the DUP_X1 instruction. */ - int DUP_X1 = 90; - - /** The integer value used to encode the DUP_X2 instruction. */ - int DUP_X2 = 91; - - /** The integer value used to encode the DUP2 instruction. */ - int DUP2 = 92; - - /** The integer value used to encode the DUP2_X1 instruction. */ - int DUP2_X1 = 93; - - /** The integer value used to encode the DUP2_X2 instruction. */ - int DUP2_X2 = 94; - - /** The integer value used to encode the SWAP instruction. */ - int SWAP = 95; - - /** The integer value used to encode the IADD instruction. */ - int IADD = 96; - - /** The integer value used to encode the LADD instruction. */ - int LADD = 97; - - /** The integer value used to encode the FADD instruction. */ - int FADD = 98; - - /** The integer value used to encode the DADD instruction. */ - int DADD = 99; - - /** The integer value used to encode the ISUB instruction. */ - int ISUB = 100; - - /** The integer value used to encode the LSUB instruction. */ - int LSUB = 101; - - /** The integer value used to encode the FSUB instruction. */ - int FSUB = 102; - - /** The integer value used to encode the DSUB instruction. */ - int DSUB = 103; - - /** The integer value used to encode the IMUL instruction. */ - int IMUL = 104; - - /** The integer value used to encode the LMUL instruction. */ - int LMUL = 105; - - /** The integer value used to encode the FMUL instruction. */ - int FMUL = 106; - - /** The integer value used to encode the DMUL instruction. */ - int DMUL = 107; - - /** The integer value used to encode the IDIV instruction. */ - int IDIV = 108; - - /** The integer value used to encode the LDIV instruction. */ - int LDIV = 109; - - /** The integer value used to encode the FDIV instruction. */ - int FDIV = 110; - - /** The integer value used to encode the DDIV instruction. */ - int DDIV = 111; - - /** The integer value used to encode the IREM instruction. */ - int IREM = 112; - - /** The integer value used to encode the LREM instruction. */ - int LREM = 113; - - /** The integer value used to encode the FREM instruction. */ - int FREM = 114; - - /** The integer value used to encode the DREM instruction. */ - int DREM = 115; - - /** The integer value used to encode the INEG instruction. */ - int INEG = 116; - - /** The integer value used to encode the LNEG instruction. */ - int LNEG = 117; - - /** The integer value used to encode the FNEG instruction. */ - int FNEG = 118; - - /** The integer value used to encode the DNEG instruction. */ - int DNEG = 119; - - /** The integer value used to encode the ISHL instruction. */ - int ISHL = 120; - - /** The integer value used to encode the LSHL instruction. */ - int LSHL = 121; - - /** The integer value used to encode the ISHR instruction. */ - int ISHR = 122; - - /** The integer value used to encode the LSHR instruction. */ - int LSHR = 123; - - /** The integer value used to encode the IUSHR instruction. */ - int IUSHR = 124; - - /** The integer value used to encode the LUSHR instruction. */ - int LUSHR = 125; - - /** The integer value used to encode the IAND instruction. */ - int IAND = 126; - - /** The integer value used to encode the LAND instruction. */ - int LAND = 127; - - /** The integer value used to encode the IOR instruction. */ - int IOR = 128; - - /** The integer value used to encode the LOR instruction. */ - int LOR = 129; - - /** The integer value used to encode the IXOR instruction. */ - int IXOR = 130; - - /** The integer value used to encode the LXOR instruction. */ - int LXOR = 131; - - /** The integer value used to encode the IINC instruction. */ - int IINC = 132; - - /** The integer value used to encode the I2L instruction. */ - int I2L = 133; - - /** The integer value used to encode the I2F instruction. */ - int I2F = 134; - - /** The integer value used to encode the I2D instruction. */ - int I2D = 135; - - /** The integer value used to encode the L2I instruction. */ - int L2I = 136; - - /** The integer value used to encode the L2F instruction. */ - int L2F = 137; - - /** The integer value used to encode the L2D instruction. */ - int L2D = 138; - - /** The integer value used to encode the F2I instruction. */ - int F2I = 139; - - /** The integer value used to encode the F2L instruction. */ - int F2L = 140; - - /** The integer value used to encode the F2D instruction. */ - int F2D = 141; - - /** The integer value used to encode the D2I instruction. */ - int D2I = 142; - - /** The integer value used to encode the D2L instruction. */ - int D2L = 143; - - /** The integer value used to encode the D2F instruction. */ - int D2F = 144; - - /** The integer value used to encode the I2B instruction. */ - int I2B = 145; - - /** The integer value used to encode the I2C instruction. */ - int I2C = 146; - - /** The integer value used to encode the I2S instruction. */ - int I2S = 147; - - /** The integer value used to encode the LCMP instruction. */ - int LCMP = 148; - - /** The integer value used to encode the FCMPL instruction. */ - int FCMPL = 149; - - /** The integer value used to encode the FCMPG instruction. */ - int FCMPG = 150; - - /** The integer value used to encode the DCMPL instruction. */ - int DCMPL = 151; - - /** The integer value used to encode the DCMPG instruction. */ - int DCMPG = 152; - - /** The integer value used to encode the IFEQ instruction. */ - int IFEQ = 153; - - /** The integer value used to encode the IFNE instruction. */ - int IFNE = 154; - - /** The integer value used to encode the IFLT instruction. */ - int IFLT = 155; - - /** The integer value used to encode the IFGE instruction. */ - int IFGE = 156; - - /** The integer value used to encode the IFGT instruction. */ - int IFGT = 157; - - /** The integer value used to encode the IFLE instruction. */ - int IFLE = 158; - - /** The integer value used to encode the IF_ICMPEQ instruction. */ - int IF_ICMPEQ = 159; - - /** The integer value used to encode the IF_ICMPNE instruction. */ - int IF_ICMPNE = 160; - - /** The integer value used to encode the IF_ICMPLT instruction. */ - int IF_ICMPLT = 161; - - /** The integer value used to encode the IF_ICMPGE instruction. */ - int IF_ICMPGE = 162; - - /** The integer value used to encode the IF_ICMPGT instruction. */ - int IF_ICMPGT = 163; - - /** The integer value used to encode the IF_ICMPLE instruction. */ - int IF_ICMPLE = 164; - - /** The integer value used to encode the IF_ACMPEQ instruction. */ - int IF_ACMPEQ = 165; - - /** The integer value used to encode the IF_ACMPNE instruction. */ - int IF_ACMPNE = 166; - - /** The integer value used to encode the GOTO instruction. */ - int GOTO = 167; - - /** The integer value used to encode the JSR instruction. */ - int JSR = 168; - - /** The integer value used to encode the RET instruction. */ - int RET = 169; - - /** The integer value used to encode the TABLESWITCH instruction. */ - int TABLESWITCH = 170; - - /** The integer value used to encode the LOOKUPSWITCH instruction. */ - int LOOKUPSWITCH = 171; - - /** The integer value used to encode the IRETURN instruction. */ - int IRETURN = 172; - - /** The integer value used to encode the LRETURN instruction. */ - int LRETURN = 173; - - /** The integer value used to encode the FRETURN instruction. */ - int FRETURN = 174; - - /** The integer value used to encode the DRETURN instruction. */ - int DRETURN = 175; - - /** The integer value used to encode the ARETURN instruction. */ - int ARETURN = 176; - - /** The integer value used to encode the RETURN instruction. */ - int RETURN = 177; - - /** The integer value used to encode the GETSTATIC instruction. */ - int GETSTATIC = 178; - - /** The integer value used to encode the PUTSTATIC instruction. */ - int PUTSTATIC = 179; - - /** The integer value used to encode the GETFIELD instruction. */ - int GETFIELD = 180; - - /** The integer value used to encode the PUTFIELD instruction. */ - int PUTFIELD = 181; - - /** The integer value used to encode the INVOKEVIRTUAL instruction. */ - int INVOKEVIRTUAL = 182; - - /** The integer value used to encode the INVOKESPECIAL instruction. */ - int INVOKESPECIAL = 183; - - /** The integer value used to encode the INVOKESTATIC instruction. */ - int INVOKESTATIC = 184; - - /** The integer value used to encode the INVOKEINTERFACE instruction. */ - int INVOKEINTERFACE = 185; - - /** The integer value used to encode the INVOKEDYNAMIC instruction. */ - int INVOKEDYNAMIC = 186; - - /** The integer value used to encode the NEW instruction. */ - int NEW = 187; - - /** The integer value used to encode the NEWARRAY instruction. */ - int NEWARRAY = 188; - - /** The integer value used to encode the ANEWARRAY instruction. */ - int ANEWARRAY = 189; - - /** The integer value used to encode the ARRAYLENGTH instruction. */ - int ARRAYLENGTH = 190; - - /** The integer value used to encode the ATHROW instruction. */ - int ATHROW = 191; - - /** The integer value used to encode the CHECKCAST instruction. */ - int CHECKCAST = 192; - - /** The integer value used to encode the INSTANCEOF instruction. */ - int INSTANCEOF = 193; - - /** The integer value used to encode the MONITORENTER instruction. */ - int MONITORENTER = 194; - - /** The integer value used to encode the MONITOREXIT instruction. */ - int MONITOREXIT = 195; - - /** The integer value used to encode the WIDE instruction. */ - int WIDE = 196; - - /** The integer value used to encode the MULTIANEWARRAY instruction. */ - int MULTIANEWARRAY = 197; - - /** The integer value used to encode the IFNULL instruction. */ - int IFNULL = 198; - - /** The integer value used to encode the IFNONNULL instruction. */ - int IFNONNULL = 199; - - /** The integer value used to encode the GOTO_W instruction. */ - int GOTO_W = 200; - - /** The integer value used to encode the JSR_W instruction. */ - int JSR_W = 201; - - /** The value of PUBLIC access and property modifier. */ + /** The bit mask of PUBLIC access and property modifier. */ int ACC_PUBLIC = 0x0001; - /** The value of PROTECTED access and property modifier. */ + /** The bit mask of PROTECTED access and property modifier. */ int ACC_PROTECTED = 0x0004; - /** The value of PRIVATE access and property modifier. */ + /** The bit mask of PRIVATE access and property modifier. */ int ACC_PRIVATE = 0x0002; - /** The value of INTERFACE access and property modifier. */ + /** The bit mask of INTERFACE access and property modifier. */ int ACC_INTERFACE = 0x0200; - /** The value of ENUM access and property modifier. */ + /** The bit mask of ENUM access and property modifier. */ int ACC_ENUM = 0x4000; - /** The value of ANNOTATION access and property modifier. */ + /** The bit mask of ANNOTATION access and property modifier. */ int ACC_ANNOTATION = 0x2000; - /** The value of SUPER access and property modifier. */ + /** The bit mask of SUPER access and property modifier. */ int ACC_SUPER = 0x0020; - /** The value of ABSTRACT access and property modifier. */ + /** The bit mask of ABSTRACT access and property modifier. */ int ACC_ABSTRACT = 0x0400; - /** The value of VOLATILE access and property modifier. */ + /** The bit mask of VOLATILE access and property modifier. */ int ACC_VOLATILE = 0x0040; - /** The value of TRANSIENT access and property modifier. */ + /** The bit mask of TRANSIENT access and property modifier. */ int ACC_TRANSIENT = 0x0080; - /** The value of SYNTHETIC access and property modifier. */ + /** The bit mask of SYNTHETIC access and property modifier. */ int ACC_SYNTHETIC = 0x1000; - /** The value of STATIC access and property modifier. */ + /** The bit mask of STATIC access and property modifier. */ int ACC_STATIC = 0x0008; - /** The value of FINAL access and property modifier. */ + /** The bit mask of FINAL access and property modifier. */ int ACC_FINAL = 0x0010; - /** The value of SYNCHRONIZED access and property modifier. */ + /** The bit mask of SYNCHRONIZED access and property modifier. */ int ACC_SYNCHRONIZED = 0x0020; - /** The value of BRIDGE access and property modifier. */ + /** The bit mask of BRIDGE access and property modifier. */ int ACC_BRIDGE = 0x0040; - /** The value of VARARGS access and property modifier. */ + /** The bit mask of VARARGS access and property modifier. */ int ACC_VARARGS = 0x0080; - /** The value of NATIVE access and property modifier. */ + /** The bit mask of NATIVE access and property modifier. */ int ACC_NATIVE = 0x0100; - /** The value of STRICT access and property modifier. */ + /** The bit mask of STRICT access and property modifier. */ int ACC_STRICT = 0x0800; - /** The value of MODULE access and property modifier. */ + /** The bit mask of MODULE access and property modifier. */ int ACC_MODULE = 0x8000; - /** The value of OPEN access and property modifier. */ + /** The bit mask of OPEN access and property modifier. */ int ACC_OPEN = 0x20; - /** The value of MANDATED access and property modifier. */ + /** The bit mask of MANDATED access and property modifier. */ int ACC_MANDATED = 0x8000; - /** The value of TRANSITIVE access and property modifier. */ + /** The bit mask of TRANSITIVE access and property modifier. */ int ACC_TRANSITIVE = 0x20; - /** The value of STATIC_PHASE access and property modifier. */ + /** The bit mask of STATIC_PHASE access and property modifier. */ int ACC_STATIC_PHASE = 0x40; - /** The value of STATEMENT {@link CharacterRangeInfo} kind. */ - int CRT_STATEMENT = 0x0001; - - /** The value of BLOCK {@link CharacterRangeInfo} kind. */ - int CRT_BLOCK = 0x0002; - - /** The value of ASSIGNMENT {@link CharacterRangeInfo} kind. */ - int CRT_ASSIGNMENT = 0x0004; - - /** The value of FLOW_CONTROLLER {@link CharacterRangeInfo} kind. */ - int CRT_FLOW_CONTROLLER = 0x0008; - - /** The value of FLOW_TARGET {@link CharacterRangeInfo} kind. */ - int CRT_FLOW_TARGET = 0x0010; - - /** The value of INVOKE {@link CharacterRangeInfo} kind. */ - int CRT_INVOKE = 0x0020; - - /** The value of CREATE {@link CharacterRangeInfo} kind. */ - int CRT_CREATE = 0x0040; - - /** The value of BRANCH_TRUE {@link CharacterRangeInfo} kind. */ - int CRT_BRANCH_TRUE = 0x0080; - - /** The value of BRANCH_FALSE {@link CharacterRangeInfo} kind. */ - int CRT_BRANCH_FALSE = 0x0100; - - /** The value of constant pool tag CLASS. */ - int TAG_CLASS = 7; - - /** The value of constant pool tag CONSTANTDYNAMIC. */ - int TAG_CONSTANTDYNAMIC = 17; - - /** The value of constant pool tag DOUBLE. */ - int TAG_DOUBLE = 6; - - /** The value of constant pool tag FIELDREF. */ - int TAG_FIELDREF = 9; - - /** The value of constant pool tag FLOAT. */ - int TAG_FLOAT = 4; - - /** The value of constant pool tag INTEGER. */ - int TAG_INTEGER = 3; - - /** The value of constant pool tag INTERFACEMETHODREF. */ - int TAG_INTERFACEMETHODREF = 11; - - /** The value of constant pool tag INVOKEDYNAMIC. */ - int TAG_INVOKEDYNAMIC = 18; - - /** The value of constant pool tag LONG. */ - int TAG_LONG = 5; - - /** The value of constant pool tag METHODHANDLE. */ - int TAG_METHODHANDLE = 15; - - /** The value of constant pool tag METHODREF. */ - int TAG_METHODREF = 10; - - /** The value of constant pool tag METHODTYPE. */ - int TAG_METHODTYPE = 16; - - /** The value of constant pool tag MODULE. */ - int TAG_MODULE = 19; - - /** The value of constant pool tag NAMEANDTYPE. */ - int TAG_NAMEANDTYPE = 12; - - /** The value of constant pool tag PACKAGE. */ - int TAG_PACKAGE = 20; - - /** The value of constant pool tag STRING. */ - int TAG_STRING = 8; - - /** The value of constant pool tag UNICODE. */ - int TAG_UNICODE = 2; - - /** The value of constant pool tag UTF8. */ - int TAG_UTF8 = 1; - - // annotation element values - - /** The value of annotation element value type AEV_BYTE. */ - int AEV_BYTE = 'B'; - - /** The value of annotation element value type AEV_CHAR. */ - int AEV_CHAR = 'C'; - - /** The value of annotation element value type AEV_DOUBLE. */ - int AEV_DOUBLE = 'D'; - - /** The value of annotation element value type AEV_FLOAT. */ - int AEV_FLOAT = 'F'; - - /** The value of annotation element value type AEV_INT. */ - int AEV_INT = 'I'; - - /** The value of annotation element value type AEV_LONG. */ - int AEV_LONG = 'J'; - - /** The value of annotation element value type AEV_SHORT. */ - int AEV_SHORT = 'S'; - - /** The value of annotation element value type AEV_BOOLEAN. */ - int AEV_BOOLEAN = 'Z'; - - /** The value of annotation element value type AEV_STRING. */ - int AEV_STRING = 's'; - - /** The value of annotation element value type AEV_ENUM. */ - int AEV_ENUM = 'e'; - - /** The value of annotation element value type AEV_CLASS. */ - int AEV_CLASS = 'c'; - - /** The value of annotation element value type AEV_ANNOTATION. */ - int AEV_ANNOTATION = '@'; - - /** The value of annotation element value type AEV_ARRAY. */ - int AEV_ARRAY = '['; - - //type annotations - - /** The value of type annotation target type CLASS_TYPE_PARAMETER. */ - int TAT_CLASS_TYPE_PARAMETER = 0x00; - - /** The value of type annotation target type METHOD_TYPE_PARAMETER. */ - int TAT_METHOD_TYPE_PARAMETER = 0x01; - - /** The value of type annotation target type CLASS_EXTENDS. */ - int TAT_CLASS_EXTENDS = 0x10; - - /** The value of type annotation target type CLASS_TYPE_PARAMETER_BOUND. */ - int TAT_CLASS_TYPE_PARAMETER_BOUND = 0x11; - - /** The value of type annotation target type METHOD_TYPE_PARAMETER_BOUND. */ - int TAT_METHOD_TYPE_PARAMETER_BOUND = 0x12; - - /** The value of type annotation target type FIELD. */ - int TAT_FIELD = 0x13; - - /** The value of type annotation target type METHOD_RETURN. */ - int TAT_METHOD_RETURN = 0x14; - - /** The value of type annotation target type METHOD_RECEIVER. */ - int TAT_METHOD_RECEIVER = 0x15; - - /** The value of type annotation target type METHOD_FORMAL_PARAMETER. */ - int TAT_METHOD_FORMAL_PARAMETER = 0x16; - - /** The value of type annotation target type THROWS. */ - int TAT_THROWS = 0x17; - - /** The value of type annotation target type LOCAL_VARIABLE. */ - int TAT_LOCAL_VARIABLE = 0x40; - - /** The value of type annotation target type RESOURCE_VARIABLE. */ - int TAT_RESOURCE_VARIABLE = 0x41; - - /** The value of type annotation target type EXCEPTION_PARAMETER. */ - int TAT_EXCEPTION_PARAMETER = 0x42; - - /** The value of type annotation target type INSTANCEOF. */ - int TAT_INSTANCEOF = 0x43; - - /** The value of type annotation target type NEW. */ - int TAT_NEW = 0x44; - - /** The value of type annotation target type CONSTRUCTOR_REFERENCE. */ - int TAT_CONSTRUCTOR_REFERENCE = 0x45; - - /** The value of type annotation target type METHOD_REFERENCE. */ - int TAT_METHOD_REFERENCE = 0x46; - - /** The value of type annotation target type CAST. */ - int TAT_CAST = 0x47; - - /** The value of type annotation target type CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT. */ - int TAT_CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT = 0x48; - - /** The value of type annotation target type METHOD_INVOCATION_TYPE_ARGUMENT. */ - int TAT_METHOD_INVOCATION_TYPE_ARGUMENT = 0x49; - - /** The value of type annotation target type CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT. */ - int TAT_CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT = 0x4A; - - /** The value of type annotation target type METHOD_REFERENCE_TYPE_ARGUMENT. */ - int TAT_METHOD_REFERENCE_TYPE_ARGUMENT = 0x4B; - - //stackmap verification types - - /** The value of verification type TOP. */ - int VT_TOP = 0; - - /** The value of verification type INTEGER. */ - int VT_INTEGER = 1; - - /** The value of verification type FLOAT. */ - int VT_FLOAT = 2; - - /** The value of verification type DOUBLE. */ - int VT_DOUBLE = 3; - - /** The value of verification type LONG. */ - int VT_LONG = 4; - - /** The value of verification type NULL. */ - int VT_NULL = 5; - - /** The value of verification type UNINITIALIZED_THIS. */ - int VT_UNINITIALIZED_THIS = 6; - - /** The value of verification type OBJECT. */ - int VT_OBJECT = 7; - - /** The value of verification type UNINITIALIZED. */ - int VT_UNINITIALIZED = 8; - - /** The value of default class access flags */ - int DEFAULT_CLASS_FLAGS = ACC_PUBLIC; - /** The class major version of JAVA_1. */ int JAVA_1_VERSION = 45; --- a/src/java.base/share/classes/java/lang/classfile/Opcode.java +++ b/src/java.base/share/classes/java/lang/classfile/Opcode.java @@ -1176,4 +1176,621 @@ public boolean isUnconditionalBranch() { default -> kind() == Kind.RETURN; }; } + + /** + * Holds the constant values of the Opcodes. + * + * @since 24 + */ + @PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API) + public static final class OpcodeValues { + + /** The integer value used to encode the {@link Opcode#NOP nop} instruction. */ + public static final int NOP = 0; + + /** The integer value used to encode the {@link Opcode#ACONST_NULL aconst_null} instruction. */ + public static final int ACONST_NULL = 1; + + /** The integer value used to encode the {@link Opcode#ICONST_M1 iconst_m1} instruction. */ + public static final int ICONST_M1 = 2; + + /** The integer value used to encode the {@link Opcode#ICONST_0 iconst_0} instruction. */ + public static final int ICONST_0 = 3; + + /** The integer value used to encode the {@link Opcode#ICONST_1 iconst_1} instruction. */ + public static final int ICONST_1 = 4; + + /** The integer value used to encode the {@link Opcode#ICONST_2 iconst_2} instruction. */ + public static final int ICONST_2 = 5; + + /** The integer value used to encode the {@link Opcode#ICONST_3 iconst_3} instruction. */ + public static final int ICONST_3 = 6; + + /** The integer value used to encode the {@link Opcode#ICONST_4 iconst_4} instruction. */ + public static final int ICONST_4 = 7; + + /** The integer value used to encode the {@link Opcode#ICONST_5 iconst_5} instruction. */ + public static final int ICONST_5 = 8; + + /** The integer value used to encode the {@link Opcode#LCONST_0 lconst_0} instruction. */ + public static final int LCONST_0 = 9; + + /** The integer value used to encode the {@link Opcode#LCONST_1 lconst_1} instruction. */ + public static final int LCONST_1 = 10; + + /** The integer value used to encode the {@link Opcode#FCONST_0 fconst_0} instruction. */ + public static final int FCONST_0 = 11; + + /** The integer value used to encode the {@link Opcode#FCONST_1 fconst_1} instruction. */ + public static final int FCONST_1 = 12; + + /** The integer value used to encode the {@link Opcode#FCONST_2 fconst_2} instruction. */ + public static final int FCONST_2 = 13; + + /** The integer value used to encode the {@link Opcode#DCONST_0 dconst_0} instruction. */ + public static final int DCONST_0 = 14; + + /** The integer value used to encode the {@link Opcode#DCONST_1 dconst_1} instruction. */ + public static final int DCONST_1 = 15; + + /** The integer value used to encode the {@link Opcode#BIPUSH bipush} instruction. */ + public static final int BIPUSH = 16; + + /** The integer value used to encode the {@link Opcode#SIPUSH sipush} instruction. */ + public static final int SIPUSH = 17; + + /** The integer value used to encode the {@link Opcode#LDC ldc} instruction. */ + public static final int LDC = 18; + + /** The integer value used to encode the {@link Opcode#LDC_W ldc_w} instruction. */ + public static final int LDC_W = 19; + + /** The integer value used to encode the {@link Opcode#LDC2_W ldc2_w} instruction. */ + public static final int LDC2_W = 20; + + /** The integer value used to encode the {@link Opcode#ILOAD iload} instruction. */ + public static final int ILOAD = 21; + + /** The integer value used to encode the {@link Opcode#LLOAD lload} instruction. */ + public static final int LLOAD = 22; + + /** The integer value used to encode the {@link Opcode#FLOAD fload} instruction. */ + public static final int FLOAD = 23; + + /** The integer value used to encode the {@link Opcode#DLOAD dload} instruction. */ + public static final int DLOAD = 24; + + /** The integer value used to encode the {@link Opcode#ALOAD aload} instruction. */ + public static final int ALOAD = 25; + + /** The integer value used to encode the {@link Opcode#ILOAD_0 iload_0} instruction. */ + public static final int ILOAD_0 = 26; + + /** The integer value used to encode the {@link Opcode#ILOAD_1 iload_1} instruction. */ + public static final int ILOAD_1 = 27; + + /** The integer value used to encode the {@link Opcode#ILOAD_2 iload_2} instruction. */ + public static final int ILOAD_2 = 28; + + /** The integer value used to encode the {@link Opcode#ILOAD_3 iload_3} instruction. */ + public static final int ILOAD_3 = 29; + + /** The integer value used to encode the {@link Opcode#LLOAD_0 lload_0} instruction. */ + public static final int LLOAD_0 = 30; + + /** The integer value used to encode the {@link Opcode#LLOAD_1 lload_1} instruction. */ + public static final int LLOAD_1 = 31; + + /** The integer value used to encode the {@link Opcode#LLOAD_2 lload_2} instruction. */ + public static final int LLOAD_2 = 32; + + /** The integer value used to encode the {@link Opcode#LLOAD_3 lload_3} instruction. */ + public static final int LLOAD_3 = 33; + + /** The integer value used to encode the {@link Opcode#FLOAD_0 fload_0} instruction. */ + public static final int FLOAD_0 = 34; + + /** The integer value used to encode the {@link Opcode#FLOAD_1 fload_1} instruction. */ + public static final int FLOAD_1 = 35; + + /** The integer value used to encode the {@link Opcode#FLOAD_2 fload_2} instruction. */ + public static final int FLOAD_2 = 36; + + /** The integer value used to encode the {@link Opcode#FLOAD_3 fload_3} instruction. */ + public static final int FLOAD_3 = 37; + + /** The integer value used to encode the {@link Opcode#DLOAD_0 dload_0} instruction. */ + public static final int DLOAD_0 = 38; + + /** The integer value used to encode the {@link Opcode#DLOAD_1 dload_1} instruction. */ + public static final int DLOAD_1 = 39; + + /** The integer value used to encode the {@link Opcode#DLOAD_2 dload_2} instruction. */ + public static final int DLOAD_2 = 40; + + /** The integer value used to encode the {@link Opcode#DLOAD_3 dload_3} instruction. */ + public static final int DLOAD_3 = 41; + + /** The integer value used to encode the {@link Opcode#ALOAD_0 aload_0} instruction. */ + public static final int ALOAD_0 = 42; + + /** The integer value used to encode the {@link Opcode#ALOAD_1 aload_1} instruction. */ + public static final int ALOAD_1 = 43; + + /** The integer value used to encode the {@link Opcode#ALOAD_2 aload_2} instruction. */ + public static final int ALOAD_2 = 44; + + /** The integer value used to encode the {@link Opcode#ALOAD_3 aload_3} instruction. */ + public static final int ALOAD_3 = 45; + + /** The integer value used to encode the {@link Opcode#IALOAD iaload} instruction. */ + public static final int IALOAD = 46; + + /** The integer value used to encode the {@link Opcode#LALOAD laload} instruction. */ + public static final int LALOAD = 47; + + /** The integer value used to encode the {@link Opcode#FALOAD faload} instruction. */ + public static final int FALOAD = 48; + + /** The integer value used to encode the {@link Opcode#DALOAD daload} instruction. */ + public static final int DALOAD = 49; + + /** The integer value used to encode the {@link Opcode#AALOAD aaload} instruction. */ + public static final int AALOAD = 50; + + /** The integer value used to encode the {@link Opcode#BALOAD baload} instruction. */ + public static final int BALOAD = 51; + + /** The integer value used to encode the {@link Opcode#CALOAD caload} instruction. */ + public static final int CALOAD = 52; + + /** The integer value used to encode the {@link Opcode#SALOAD saload} instruction. */ + public static final int SALOAD = 53; + + /** The integer value used to encode the {@link Opcode#ISTORE istore} instruction. */ + public static final int ISTORE = 54; + + /** The integer value used to encode the {@link Opcode#LSTORE lstore} instruction. */ + public static final int LSTORE = 55; + + /** The integer value used to encode the {@link Opcode#FSTORE fstore} instruction. */ + public static final int FSTORE = 56; + + /** The integer value used to encode the {@link Opcode#DSTORE dstore} instruction. */ + public static final int DSTORE = 57; + + /** The integer value used to encode the {@link Opcode#ASTORE astore} instruction. */ + public static final int ASTORE = 58; + + /** The integer value used to encode the {@link Opcode#ISTORE_0 istore_0} instruction. */ + public static final int ISTORE_0 = 59; + + /** The integer value used to encode the {@link Opcode#ISTORE_1 istore_1} instruction. */ + public static final int ISTORE_1 = 60; + + /** The integer value used to encode the {@link Opcode#ISTORE_2 istore_2} instruction. */ + public static final int ISTORE_2 = 61; + + /** The integer value used to encode the {@link Opcode#ISTORE_3 istore_3} instruction. */ + public static final int ISTORE_3 = 62; + + /** The integer value used to encode the {@link Opcode#LSTORE_0 lstore_0} instruction. */ + public static final int LSTORE_0 = 63; + + /** The integer value used to encode the {@link Opcode#LSTORE_1 lstore_1} instruction. */ + public static final int LSTORE_1 = 64; + + /** The integer value used to encode the {@link Opcode#LSTORE_2 lstore_2} instruction. */ + public static final int LSTORE_2 = 65; + + /** The integer value used to encode the {@link Opcode#LSTORE_3 lstore_3} instruction. */ + public static final int LSTORE_3 = 66; + + /** The integer value used to encode the {@link Opcode#FSTORE_0 fstore_0} instruction. */ + public static final int FSTORE_0 = 67; + + /** The integer value used to encode the {@link Opcode#FSTORE_1 fstore_1} instruction. */ + public static final int FSTORE_1 = 68; + + /** The integer value used to encode the {@link Opcode#FSTORE_2 fstore_2} instruction. */ + public static final int FSTORE_2 = 69; + + /** The integer value used to encode the {@link Opcode#FSTORE_3 fstore_3} instruction. */ + public static final int FSTORE_3 = 70; + + /** The integer value used to encode the {@link Opcode#DSTORE_0 dstore_0} instruction. */ + public static final int DSTORE_0 = 71; + + /** The integer value used to encode the {@link Opcode#DSTORE_1 dstore_1} instruction. */ + public static final int DSTORE_1 = 72; + + /** The integer value used to encode the {@link Opcode#DSTORE_2 dstore_2} instruction. */ + public static final int DSTORE_2 = 73; + + /** The integer value used to encode the {@link Opcode#DSTORE_3 dstore_3} instruction. */ + public static final int DSTORE_3 = 74; + + /** The integer value used to encode the {@link Opcode#ASTORE_0 astore_0} instruction. */ + public static final int ASTORE_0 = 75; + + /** The integer value used to encode the {@link Opcode#ASTORE_1 astore_1} instruction. */ + public static final int ASTORE_1 = 76; + + /** The integer value used to encode the {@link Opcode#ASTORE_2 astore_2} instruction. */ + public static final int ASTORE_2 = 77; + + /** The integer value used to encode the {@link Opcode#ASTORE_3 astore_3} instruction. */ + public static final int ASTORE_3 = 78; + + /** The integer value used to encode the {@link Opcode#IASTORE iastore} instruction. */ + public static final int IASTORE = 79; + + /** The integer value used to encode the {@link Opcode#LASTORE lastore} instruction. */ + public static final int LASTORE = 80; + + /** The integer value used to encode the {@link Opcode#FASTORE fastore} instruction. */ + public static final int FASTORE = 81; + + /** The integer value used to encode the {@link Opcode#DASTORE dastore} instruction. */ + public static final int DASTORE = 82; + + /** The integer value used to encode the {@link Opcode#AASTORE aastore} instruction. */ + public static final int AASTORE = 83; + + /** The integer value used to encode the {@link Opcode#BASTORE bastore} instruction. */ + public static final int BASTORE = 84; + + /** The integer value used to encode the {@link Opcode#CASTORE castore} instruction. */ + public static final int CASTORE = 85; + + /** The integer value used to encode the {@link Opcode#SASTORE sastore} instruction. */ + public static final int SASTORE = 86; + + /** The integer value used to encode the {@link Opcode#POP pop} instruction. */ + public static final int POP = 87; + + /** The integer value used to encode the {@link Opcode#POP2 pop2} instruction. */ + public static final int POP2 = 88; + + /** The integer value used to encode the {@link Opcode#DUP dup} instruction. */ + public static final int DUP = 89; + + /** The integer value used to encode the {@link Opcode#DUP_X1 dup_x1} instruction. */ + public static final int DUP_X1 = 90; + + /** The integer value used to encode the {@link Opcode#DUP_X2 dup_x2} instruction. */ + public static final int DUP_X2 = 91; + + /** The integer value used to encode the {@link Opcode#DUP2 dup2} instruction. */ + public static final int DUP2 = 92; + + /** The integer value used to encode the {@link Opcode#DUP2_X1 dup2_x1} instruction. */ + public static final int DUP2_X1 = 93; + + /** The integer value used to encode the {@link Opcode#DUP2_X2 dup2_x2} instruction. */ + public static final int DUP2_X2 = 94; + + /** The integer value used to encode the {@link Opcode#SWAP swap} instruction. */ + public static final int SWAP = 95; + + /** The integer value used to encode the {@link Opcode#IADD iadd} instruction. */ + public static final int IADD = 96; + + /** The integer value used to encode the {@link Opcode#LADD ladd} instruction. */ + public static final int LADD = 97; + + /** The integer value used to encode the {@link Opcode#FADD fadd} instruction. */ + public static final int FADD = 98; + + /** The integer value used to encode the {@link Opcode#DADD dadd} instruction. */ + public static final int DADD = 99; + + /** The integer value used to encode the {@link Opcode#ISUB isub} instruction. */ + public static final int ISUB = 100; + + /** The integer value used to encode the {@link Opcode#LSUB lsub} instruction. */ + public static final int LSUB = 101; + + /** The integer value used to encode the {@link Opcode#FSUB fsub} instruction. */ + public static final int FSUB = 102; + + /** The integer value used to encode the {@link Opcode#DSUB dsub} instruction. */ + public static final int DSUB = 103; + + /** The integer value used to encode the {@link Opcode#IMUL imul} instruction. */ + public static final int IMUL = 104; + + /** The integer value used to encode the {@link Opcode#LMUL lmul} instruction. */ + public static final int LMUL = 105; + + /** The integer value used to encode the {@link Opcode#FMUL fmul} instruction. */ + public static final int FMUL = 106; + + /** The integer value used to encode the {@link Opcode#DMUL dmul} instruction. */ + public static final int DMUL = 107; + + /** The integer value used to encode the {@link Opcode#IDIV idiv} instruction. */ + public static final int IDIV = 108; + + /** The integer value used to encode the {@link Opcode#LDIV ldiv} instruction. */ + public static final int LDIV = 109; + + /** The integer value used to encode the {@link Opcode#FDIV fdiv} instruction. */ + public static final int FDIV = 110; + + /** The integer value used to encode the {@link Opcode#DDIV ddiv} instruction. */ + public static final int DDIV = 111; + + /** The integer value used to encode the {@link Opcode#IREM irem} instruction. */ + public static final int IREM = 112; + + /** The integer value used to encode the {@link Opcode#LREM lrem} instruction. */ + public static final int LREM = 113; + + /** The integer value used to encode the {@link Opcode#FREM frem} instruction. */ + public static final int FREM = 114; + + /** The integer value used to encode the {@link Opcode#DREM drem} instruction. */ + public static final int DREM = 115; + + /** The integer value used to encode the {@link Opcode#INEG ineg} instruction. */ + public static final int INEG = 116; + + /** The integer value used to encode the {@link Opcode#LNEG lneg} instruction. */ + public static final int LNEG = 117; + + /** The integer value used to encode the {@link Opcode#FNEG fneg} instruction. */ + public static final int FNEG = 118; + + /** The integer value used to encode the {@link Opcode#DNEG dneg} instruction. */ + public static final int DNEG = 119; + + /** The integer value used to encode the {@link Opcode#ISHL ishl} instruction. */ + public static final int ISHL = 120; + + /** The integer value used to encode the {@link Opcode#LSHL lshl} instruction. */ + public static final int LSHL = 121; + + /** The integer value used to encode the {@link Opcode#ISHR ishr} instruction. */ + public static final int ISHR = 122; + + /** The integer value used to encode the {@link Opcode#LSHR lshr} instruction. */ + public static final int LSHR = 123; + + /** The integer value used to encode the {@link Opcode#IUSHR iushr} instruction. */ + public static final int IUSHR = 124; + + /** The integer value used to encode the {@link Opcode#LUSHR lushr} instruction. */ + public static final int LUSHR = 125; + + /** The integer value used to encode the {@link Opcode#IAND iand} instruction. */ + public static final int IAND = 126; + + /** The integer value used to encode the {@link Opcode#LAND land} instruction. */ + public static final int LAND = 127; + + /** The integer value used to encode the {@link Opcode#IOR ior} instruction. */ + public static final int IOR = 128; + + /** The integer value used to encode the {@link Opcode#LOR lor} instruction. */ + public static final int LOR = 129; + + /** The integer value used to encode the {@link Opcode#IXOR ixor} instruction. */ + public static final int IXOR = 130; + + /** The integer value used to encode the {@link Opcode#LXOR lxor} instruction. */ + public static final int LXOR = 131; + + /** The integer value used to encode the {@link Opcode#IINC iinc} instruction. */ + public static final int IINC = 132; + + /** The integer value used to encode the {@link Opcode#I2L i2l} instruction. */ + public static final int I2L = 133; + + /** The integer value used to encode the {@link Opcode#I2F i2f} instruction. */ + public static final int I2F = 134; + + /** The integer value used to encode the {@link Opcode#I2D i2d} instruction. */ + public static final int I2D = 135; + + /** The integer value used to encode the {@link Opcode#L2I l2i} instruction. */ + public static final int L2I = 136; + + /** The integer value used to encode the {@link Opcode#L2F l2f} instruction. */ + public static final int L2F = 137; + + /** The integer value used to encode the {@link Opcode#L2D l2d} instruction. */ + public static final int L2D = 138; + + /** The integer value used to encode the {@link Opcode#F2I f2i} instruction. */ + public static final int F2I = 139; + + /** The integer value used to encode the {@link Opcode#F2L f2l} instruction. */ + public static final int F2L = 140; + + /** The integer value used to encode the {@link Opcode#F2D f2d} instruction. */ + public static final int F2D = 141; + + /** The integer value used to encode the {@link Opcode#D2I d2i} instruction. */ + public static final int D2I = 142; + + /** The integer value used to encode the {@link Opcode#D2L d2l} instruction. */ + public static final int D2L = 143; + + /** The integer value used to encode the {@link Opcode#D2F d2f} instruction. */ + public static final int D2F = 144; + + /** The integer value used to encode the {@link Opcode#I2B i2b} instruction. */ + public static final int I2B = 145; + + /** The integer value used to encode the {@link Opcode#I2C i2c} instruction. */ + public static final int I2C = 146; + + /** The integer value used to encode the {@link Opcode#I2S i2s} instruction. */ + public static final int I2S = 147; + + /** The integer value used to encode the {@link Opcode#LCMP lcmp} instruction. */ + public static final int LCMP = 148; + + /** The integer value used to encode the {@link Opcode#FCMPL fcmpl} instruction. */ + public static final int FCMPL = 149; + + /** The integer value used to encode the {@link Opcode#FCMPG fcmpg} instruction. */ + public static final int FCMPG = 150; + + /** The integer value used to encode the {@link Opcode#DCMPL dcmpl} instruction. */ + public static final int DCMPL = 151; + + /** The integer value used to encode the {@link Opcode#DCMPG dcmpg} instruction. */ + public static final int DCMPG = 152; + + /** The integer value used to encode the {@link Opcode#IFEQ ifeq} instruction. */ + public static final int IFEQ = 153; + + /** The integer value used to encode the {@link Opcode#IFNE ifne} instruction. */ + public static final int IFNE = 154; + + /** The integer value used to encode the {@link Opcode#IFLT iflt} instruction. */ + public static final int IFLT = 155; + + /** The integer value used to encode the {@link Opcode#IFGE ifge} instruction. */ + public static final int IFGE = 156; + + /** The integer value used to encode the {@link Opcode#IFGT ifgt} instruction. */ + public static final int IFGT = 157; + + /** The integer value used to encode the {@link Opcode#IFLE ifle} instruction. */ + public static final int IFLE = 158; + + /** The integer value used to encode the {@link Opcode#IF_ICMPEQ if_icmpeq} instruction. */ + public static final int IF_ICMPEQ = 159; + + /** The integer value used to encode the {@link Opcode#IF_ICMPNE if_icmpne} instruction. */ + public static final int IF_ICMPNE = 160; + + /** The integer value used to encode the {@link Opcode#IF_ICMPLT if_icmplt} instruction. */ + public static final int IF_ICMPLT = 161; + + /** The integer value used to encode the {@link Opcode#IF_ICMPGE if_icmpge} instruction. */ + public static final int IF_ICMPGE = 162; + + /** The integer value used to encode the {@link Opcode#IF_ICMPGT if_icmpgt} instruction. */ + public static final int IF_ICMPGT = 163; + + /** The integer value used to encode the {@link Opcode#IF_ICMPLE if_icmple} instruction. */ + public static final int IF_ICMPLE = 164; + + /** The integer value used to encode the {@link Opcode#IF_ACMPEQ if_acmpeq} instruction. */ + public static final int IF_ACMPEQ = 165; + + /** The integer value used to encode the {@link Opcode#IF_ACMPNE if_acmpne} instruction. */ + public static final int IF_ACMPNE = 166; + + /** The integer value used to encode the {@link Opcode#GOTO goto} instruction. */ + public static final int GOTO = 167; + + /** The integer value used to encode the {@link Opcode#JSR jsr} instruction. */ + public static final int JSR = 168; + + /** The integer value used to encode the {@link Opcode#RET ret} instruction. */ + public static final int RET = 169; + + /** The integer value used to encode the {@link Opcode#TABLESWITCH tableswitch} instruction. */ + public static final int TABLESWITCH = 170; + + /** The integer value used to encode the {@link Opcode#LOOKUPSWITCH lookupswitch} instruction. */ + public static final int LOOKUPSWITCH = 171; + + /** The integer value used to encode the {@link Opcode#IRETURN ireturn} instruction. */ + public static final int IRETURN = 172; + + /** The integer value used to encode the {@link Opcode#LRETURN lreturn} instruction. */ + public static final int LRETURN = 173; + + /** The integer value used to encode the {@link Opcode#FRETURN freturn} instruction. */ + public static final int FRETURN = 174; + + /** The integer value used to encode the {@link Opcode#DRETURN dreturn} instruction. */ + public static final int DRETURN = 175; + + /** The integer value used to encode the {@link Opcode#ARETURN areturn} instruction. */ + public static final int ARETURN = 176; + + /** The integer value used to encode the {@link Opcode#RETURN return} instruction. */ + public static final int RETURN = 177; + + /** The integer value used to encode the {@link Opcode#GETSTATIC getstatic} instruction. */ + public static final int GETSTATIC = 178; + + /** The integer value used to encode the {@link Opcode#PUTSTATIC putstatic} instruction. */ + public static final int PUTSTATIC = 179; + + /** The integer value used to encode the {@link Opcode#GETFIELD getfield} instruction. */ + public static final int GETFIELD = 180; + + /** The integer value used to encode the {@link Opcode#PUTFIELD putfield} instruction. */ + public static final int PUTFIELD = 181; + + /** The integer value used to encode the {@link Opcode#INVOKEVIRTUAL invokevirtual} instruction. */ + public static final int INVOKEVIRTUAL = 182; + + /** The integer value used to encode the {@link Opcode#INVOKESPECIAL invokespecial} instruction. */ + public static final int INVOKESPECIAL = 183; + + /** The integer value used to encode the {@link Opcode#INVOKESTATIC invokestatic} instruction. */ + public static final int INVOKESTATIC = 184; + + /** The integer value used to encode the {@link Opcode#INVOKEINTERFACE invokeinterface} instruction. */ + public static final int INVOKEINTERFACE = 185; + + /** The integer value used to encode the {@link Opcode#INVOKEDYNAMIC invokedynamic} instruction. */ + public static final int INVOKEDYNAMIC = 186; + + /** The integer value used to encode the {@link Opcode#NEW new} instruction. */ + public static final int NEW = 187; + + /** The integer value used to encode the {@link Opcode#NEWARRAY newarray} instruction. */ + public static final int NEWARRAY = 188; + + /** The integer value used to encode the {@link Opcode#ANEWARRAY anewarray} instruction. */ + public static final int ANEWARRAY = 189; + + /** The integer value used to encode the {@link Opcode#ARRAYLENGTH arraylength} instruction. */ + public static final int ARRAYLENGTH = 190; + + /** The integer value used to encode the {@link Opcode#ATHROW athrow} instruction. */ + public static final int ATHROW = 191; + + /** The integer value used to encode the {@link Opcode#CHECKCAST checkcast} instruction. */ + public static final int CHECKCAST = 192; + + /** The integer value used to encode the {@link Opcode#INSTANCEOF instanceof} instruction. */ + public static final int INSTANCEOF = 193; + + /** The integer value used to encode the {@link Opcode#MONITORENTER monitorenter} instruction. */ + public static final int MONITORENTER = 194; + + /** The integer value used to encode the {@link Opcode#MONITOREXIT monitorexit} instruction. */ + public static final int MONITOREXIT = 195; + + /** The integer value used to encode the {@link Opcode#isWide() wide} instruction. */ + public static final int WIDE = 196; + + /** The integer value used to encode the {@link Opcode#MULTIANEWARRAY multianewarray} instruction. */ + public static final int MULTIANEWARRAY = 197; + + /** The integer value used to encode the {@link Opcode#IFNULL ifnull} instruction. */ + public static final int IFNULL = 198; + + /** The integer value used to encode the {@link Opcode#IFNONNULL ifnonnull} instruction. */ + public static final int IFNONNULL = 199; + + /** The integer value used to encode the {@link Opcode#GOTO_W goto_w} instruction. */ + public static final int GOTO_W = 200; + + /** The integer value used to encode the {@link Opcode#JSR_W jsr_w} instruction. */ + public static final int JSR_W = 201; + + private OpcodeValues() {} + } } --- a/src/java.base/share/classes/java/lang/classfile/TypeAnnotation.java +++ b/src/java.base/share/classes/java/lang/classfile/TypeAnnotation.java @@ -214,6 +193,72 @@ static TypeAnnotation of(TargetInfo targetInfo, List targetPa @PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API) sealed interface TargetInfo { + /** The value of type annotation target type CLASS_TYPE_PARAMETER. */ + int TAT_CLASS_TYPE_PARAMETER = 0x00; + + /** The value of type annotation target type METHOD_TYPE_PARAMETER. */ + int TAT_METHOD_TYPE_PARAMETER = 0x01; + + /** The value of type annotation target type CLASS_EXTENDS. */ + int TAT_CLASS_EXTENDS = 0x10; + + /** The value of type annotation target type CLASS_TYPE_PARAMETER_BOUND. */ + int TAT_CLASS_TYPE_PARAMETER_BOUND = 0x11; + + /** The value of type annotation target type METHOD_TYPE_PARAMETER_BOUND. */ + int TAT_METHOD_TYPE_PARAMETER_BOUND = 0x12; + + /** The value of type annotation target type FIELD. */ + int TAT_FIELD = 0x13; + + /** The value of type annotation target type METHOD_RETURN. */ + int TAT_METHOD_RETURN = 0x14; + + /** The value of type annotation target type METHOD_RECEIVER. */ + int TAT_METHOD_RECEIVER = 0x15; + + /** The value of type annotation target type METHOD_FORMAL_PARAMETER. */ + int TAT_METHOD_FORMAL_PARAMETER = 0x16; + + /** The value of type annotation target type THROWS. */ + int TAT_THROWS = 0x17; + + /** The value of type annotation target type LOCAL_VARIABLE. */ + int TAT_LOCAL_VARIABLE = 0x40; + + /** The value of type annotation target type RESOURCE_VARIABLE. */ + int TAT_RESOURCE_VARIABLE = 0x41; + + /** The value of type annotation target type EXCEPTION_PARAMETER. */ + int TAT_EXCEPTION_PARAMETER = 0x42; + + /** The value of type annotation target type INSTANCEOF. */ + int TAT_INSTANCEOF = 0x43; + + /** The value of type annotation target type NEW. */ + int TAT_NEW = 0x44; + + /** The value of type annotation target type CONSTRUCTOR_REFERENCE. */ + int TAT_CONSTRUCTOR_REFERENCE = 0x45; + + /** The value of type annotation target type METHOD_REFERENCE. */ + int TAT_METHOD_REFERENCE = 0x46; + + /** The value of type annotation target type CAST. */ + int TAT_CAST = 0x47; + + /** The value of type annotation target type CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT. */ + int TAT_CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT = 0x48; + + /** The value of type annotation target type METHOD_INVOCATION_TYPE_ARGUMENT. */ + int TAT_METHOD_INVOCATION_TYPE_ARGUMENT = 0x49; + + /** The value of type annotation target type CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT. */ + int TAT_CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT = 0x4A; + + /** The value of type annotation target type METHOD_REFERENCE_TYPE_ARGUMENT. */ + int TAT_METHOD_REFERENCE_TYPE_ARGUMENT = 0x4B; + /** * {@return the type of the target} */ --- a/src/java.base/share/classes/java/lang/classfile/attribute/CharacterRangeInfo.java +++ b/src/java.base/share/classes/java/lang/classfile/attribute/CharacterRangeInfo.java @@ -134,6 +136,7 @@ public sealed interface CharacterRangeInfo * All bits of the flags item not assigned above are reserved for future use. They should be set to zero in generated class files and should be ignored by Java virtual machine implementations. * * @return the flags + * @see CharacterRange#flags() */ int flags(); --- a/src/java.base/share/classes/java/lang/classfile/attribute/StackMapFrameInfo.java +++ b/src/java.base/share/classes/java/lang/classfile/attribute/StackMapFrameInfo.java @@ -85,6 +84,33 @@ public static StackMapFrameInfo of(Label target, @PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API) sealed interface VerificationTypeInfo { + /** The {@link #tag() tag} for verification type info {@link SimpleVerificationTypeInfo#TOP TOP}. */ + int VT_TOP = 0; + + /** The {@link #tag() tag} for verification type info {@link SimpleVerificationTypeInfo#INTEGER INTEGER}. */ + int VT_INTEGER = 1; + + /** The {@link #tag() tag} for verification type info {@link SimpleVerificationTypeInfo#FLOAT FLOAT}. */ + int VT_FLOAT = 2; + + /** The {@link #tag() tag} for verification type info {@link SimpleVerificationTypeInfo#DOUBLE DOUBLE}. */ + int VT_DOUBLE = 3; + + /** The {@link #tag() tag} for verification type info {@link SimpleVerificationTypeInfo#LONG LONG}. */ + int VT_LONG = 4; + + /** The {@link #tag() tag} for verification type info {@link SimpleVerificationTypeInfo#NULL NULL}. */ + int VT_NULL = 5; + + /** The {@link #tag() tag} for verification type info {@link SimpleVerificationTypeInfo#UNINITIALIZED_THIS UNINITIALIZED_THIS}. */ + int VT_UNINITIALIZED_THIS = 6; + + /** The {@link #tag() tag} for verification type info {@link ObjectVerificationTypeInfo OBJECT}. */ + int VT_OBJECT = 7; + + /** The {@link #tag() tag} for verification type info {@link UninitializedVerificationTypeInfo UNINITIALIZED}. */ + int VT_UNINITIALIZED = 8; + /** * {@return the tag of the type info} */ @@ -100,25 +126,25 @@ sealed interface VerificationTypeInfo { public enum SimpleVerificationTypeInfo implements VerificationTypeInfo { /** verification type top */ - ITEM_TOP(VT_TOP), + TOP(VT_TOP), /** verification type int */ - ITEM_INTEGER(VT_INTEGER), + INTEGER(VT_INTEGER), /** verification type float */ - ITEM_FLOAT(VT_FLOAT), + FLOAT(VT_FLOAT), /** verification type double */ - ITEM_DOUBLE(VT_DOUBLE), + DOUBLE(VT_DOUBLE), /** verification type long */ - ITEM_LONG(VT_LONG), + LONG(VT_LONG), /** verification type null */ - ITEM_NULL(VT_NULL), + NULL(VT_NULL), /** verification type uninitializedThis */ - ITEM_UNINITIALIZED_THIS(VT_UNINITIALIZED_THIS); + UNINITIALIZED_THIS(VT_UNINITIALIZED_THIS); private final int tag; @@ -134,7 +160,7 @@ public int tag() { } /** - * A stack value for an object type. + * A stack value for an object type. Its {@link #tag() tag} is {@value #VT_OBJECT}. * * @since 22 */ @@ -173,7 +199,7 @@ default ClassDesc classSymbol() { } /** - * An uninitialized stack value. + * An uninitialized stack value. Its {@link #tag() tag} is {@value #VT_UNINITIALIZED}. * * @since 22 */ --- a/src/java.base/share/classes/java/lang/classfile/constantpool/PoolEntry.java +++ b/src/java.base/share/classes/java/lang/classfile/constantpool/PoolEntry.java @@ -38,6 +38,60 @@ public sealed interface PoolEntry LoadableConstantEntry, MemberRefEntry, ModuleEntry, NameAndTypeEntry, PackageEntry { + /** The value of constant pool {@linkplain #tag tag} CLASS. */ + int TAG_CLASS = 7; + + /** The value of constant pool {@linkplain #tag tag} CONSTANTDYNAMIC. */ + int TAG_CONSTANTDYNAMIC = 17; + + /** The value of constant pool {@linkplain #tag tag} DOUBLE. */ + int TAG_DOUBLE = 6; + + /** The value of constant pool {@linkplain #tag tag} FIELDREF. */ + int TAG_FIELDREF = 9; + + /** The value of constant pool {@linkplain #tag tag} FLOAT. */ + int TAG_FLOAT = 4; + + /** The value of constant pool {@linkplain #tag tag} INTEGER. */ + int TAG_INTEGER = 3; + + /** The value of constant pool {@linkplain #tag tag} INTERFACEMETHODREF. */ + int TAG_INTERFACEMETHODREF = 11; + + /** The value of constant pool {@linkplain #tag tag} INVOKEDYNAMIC. */ + int TAG_INVOKEDYNAMIC = 18; + + /** The value of constant pool {@linkplain #tag tag} LONG. */ + int TAG_LONG = 5; + + /** The value of constant pool {@linkplain #tag tag} METHODHANDLE. */ + int TAG_METHODHANDLE = 15; + + /** The value of constant pool {@linkplain #tag tag} METHODREF. */ + int TAG_METHODREF = 10; + + /** The value of constant pool {@linkplain #tag tag} METHODTYPE. */ + int TAG_METHODTYPE = 16; + + /** The value of constant pool {@linkplain #tag tag} MODULE. */ + int TAG_MODULE = 19; + + /** The value of constant pool {@linkplain #tag tag} NAMEANDTYPE. */ + int TAG_NAMEANDTYPE = 12; + + /** The value of constant pool {@linkplain #tag tag} PACKAGE. */ + int TAG_PACKAGE = 20; + + /** The value of constant pool {@linkplain #tag tag} STRING. */ + int TAG_STRING = 8; + + /** The value of constant pool {@linkplain #tag tag} UNICODE. */ + int TAG_UNICODE = 2; + + /** The value of constant pool {@linkplain #tag tag} UTF8. */ + int TAG_UTF8 = 1; + /** * {@return the constant pool this entry is from} */ --- a/src/java.base/share/classes/java/lang/classfile/instruction/CharacterRange.java +++ b/src/java.base/share/classes/java/lang/classfile/instruction/CharacterRange.java @@ -45,6 +46,34 @@ @PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API) public sealed interface CharacterRange extends PseudoInstruction permits AbstractPseudoInstruction.UnboundCharacterRange, BoundCharacterRange { + + /** The bit mask of STATEMENT {@link CharacterRangeInfo} kind. */ + int CRT_STATEMENT = 0x0001; + + /** The bit mask of BLOCK {@link CharacterRangeInfo} kind. */ + int CRT_BLOCK = 0x0002; + + /** The bit mask of ASSIGNMENT {@link CharacterRangeInfo} kind. */ + int CRT_ASSIGNMENT = 0x0004; + + /** The bit mask of FLOW_CONTROLLER {@link CharacterRangeInfo} kind. */ + int CRT_FLOW_CONTROLLER = 0x0008; + + /** The bit mask of FLOW_TARGET {@link CharacterRangeInfo} kind. */ + int CRT_FLOW_TARGET = 0x0010; + + /** The bit mask of INVOKE {@link CharacterRangeInfo} kind. */ + int CRT_INVOKE = 0x0020; + + /** The bit mask of CREATE {@link CharacterRangeInfo} kind. */ + int CRT_CREATE = 0x0040; + + /** The bit mask of BRANCH_TRUE {@link CharacterRangeInfo} kind. */ + int CRT_BRANCH_TRUE = 0x0080; + + /** The bit mask of BRANCH_FALSE {@link CharacterRangeInfo} kind. */ + int CRT_BRANCH_FALSE = 0x0100; + /** * {@return the start of the instruction range} */