/** * Stores the primitve value on top of the stack in the variable with given * index. * * Operand stack: * ..., value -> ... * * @param variableIndex the index of the variable where to store the * value. * @param type the type of the value to be stored. */ public InstructionSequenceBuilder store(int variableIndex, char type) { switch (type) { case ClassConstants.TYPE_BOOLEAN: case ClassConstants.TYPE_BYTE: case ClassConstants.TYPE_CHAR: case ClassConstants.TYPE_SHORT: case ClassConstants.TYPE_INT: return istore(variableIndex); case ClassConstants.TYPE_LONG: return lstore(variableIndex); case ClassConstants.TYPE_FLOAT: return fstore(variableIndex); case ClassConstants.TYPE_DOUBLE: return dstore(variableIndex); default: return astore(variableIndex); } }
/** * Stores the primitve value on top of the stack in the variable with given * index. * * Operand stack: * ..., value -> ... * * @param variableIndex the index of the variable where to store the * value. * @param type the type of the value to be stored. */ public InstructionSequenceBuilder store(int variableIndex, char type) { switch (type) { case ClassConstants.TYPE_BOOLEAN: case ClassConstants.TYPE_BYTE: case ClassConstants.TYPE_CHAR: case ClassConstants.TYPE_SHORT: case ClassConstants.TYPE_INT: return istore(variableIndex); case ClassConstants.TYPE_LONG: return lstore(variableIndex); case ClassConstants.TYPE_FLOAT: return fstore(variableIndex); case ClassConstants.TYPE_DOUBLE: return dstore(variableIndex); default: return astore(variableIndex); } }
/** * Stores the primitve value on top of the stack in the variable with given * index. * * Operand stack: * ..., value -> ... * * @param variableIndex the index of the variable where to store the * value. * @param type the type of the value to be stored. */ public InstructionSequenceBuilder store(int variableIndex, char type) { switch (type) { case ClassConstants.TYPE_BOOLEAN: case ClassConstants.TYPE_BYTE: case ClassConstants.TYPE_CHAR: case ClassConstants.TYPE_SHORT: case ClassConstants.TYPE_INT: return istore(variableIndex); case ClassConstants.TYPE_LONG: return lstore(variableIndex); case ClassConstants.TYPE_FLOAT: return fstore(variableIndex); case ClassConstants.TYPE_DOUBLE: return dstore(variableIndex); default: return astore(variableIndex); } }
.astore(LOCAL_VARIABLE_INDEX_1) .label(TRY_START) .invokestatic("java/lang/Class", "forName", "(Ljava/lang/String;)Ljava/lang/Class;") .pop() .dup_x2() .astore(LOCAL_VARIABLE_INDEX_1) .label(TRY_START) .invokestatic("java/lang/Class", "forName", "(Ljava/lang/String;ZLjava/lang/ClassLoader;)Ljava/lang/Class;") .astore(LOCAL_VARIABLE_INDEX_1) .label(TRY_START) .invokevirtual("java/lang/ClassLoader", "loadClass", "(Ljava/lang/String;)Ljava/lang/Class;") .astore(LOCAL_VARIABLE_INDEX_2) .dup_x1() .astore(LOCAL_VARIABLE_INDEX_1) .label(TRY_START) .invokevirtual("java/lang/Class", "getDeclaredConstructor", "([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;") .astore(LOCAL_VARIABLE_INDEX_2) .dup_x1() .astore(LOCAL_VARIABLE_INDEX_1) .label(TRY_START) .invokevirtual("java/lang/Class", "getConstructor", "([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;") .astore(LOCAL_VARIABLE_INDEX_3) .dup_x2() .astore(LOCAL_VARIABLE_INDEX_2)
.astore(LOCAL_VARIABLE_INDEX_1) .label(TRY_START) .invokestatic("java/lang/Class", "forName", "(Ljava/lang/String;)Ljava/lang/Class;") .pop() .dup_x2() .astore(LOCAL_VARIABLE_INDEX_1) .label(TRY_START) .invokestatic("java/lang/Class", "forName", "(Ljava/lang/String;ZLjava/lang/ClassLoader;)Ljava/lang/Class;") .astore(LOCAL_VARIABLE_INDEX_1) .label(TRY_START) .invokevirtual("java/lang/ClassLoader", "loadClass", "(Ljava/lang/String;)Ljava/lang/Class;") .astore(LOCAL_VARIABLE_INDEX_2) .dup_x1() .astore(LOCAL_VARIABLE_INDEX_1) .label(TRY_START) .invokevirtual("java/lang/Class", "getDeclaredConstructor", "([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;") .astore(LOCAL_VARIABLE_INDEX_2) .dup_x1() .astore(LOCAL_VARIABLE_INDEX_1) .label(TRY_START) .invokevirtual("java/lang/Class", "getConstructor", "([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;") .astore(LOCAL_VARIABLE_INDEX_3) .dup_x2() .astore(LOCAL_VARIABLE_INDEX_2)
.astore(LOCAL_VARIABLE_INDEX_1) .label(TRY_START) .invokestatic("java/lang/Class", "forName", "(Ljava/lang/String;)Ljava/lang/Class;") .pop() .dup_x2() .astore(LOCAL_VARIABLE_INDEX_1) .label(TRY_START) .invokestatic("java/lang/Class", "forName", "(Ljava/lang/String;ZLjava/lang/ClassLoader;)Ljava/lang/Class;") .astore(LOCAL_VARIABLE_INDEX_1) .label(TRY_START) .invokevirtual("java/lang/ClassLoader", "loadClass", "(Ljava/lang/String;)Ljava/lang/Class;") .astore(LOCAL_VARIABLE_INDEX_2) .dup_x1() .astore(LOCAL_VARIABLE_INDEX_1) .label(TRY_START) .invokevirtual("java/lang/Class", "getDeclaredConstructor", "([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;") .astore(LOCAL_VARIABLE_INDEX_2) .dup_x1() .astore(LOCAL_VARIABLE_INDEX_1) .label(TRY_START) .invokevirtual("java/lang/Class", "getConstructor", "([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;") .astore(LOCAL_VARIABLE_INDEX_3) .dup_x2() .astore(LOCAL_VARIABLE_INDEX_2)
{ // a = a = nothing ____.aload(X) .astore(X).__(), }, { // iload/iload = iload/dup }, { // astore/astore = pop/astore ____.astore(X) .astore(X).__(), .astore(X).__() }, { // istore/iload = dup/istore }, { // astore/aload = dup/astore ____.astore(X) .aload(X).__(), .astore(X).__() }, { // iload/dup/istore = iload ____.aload(X) .dup() .astore(X).__(),
{ // a = a = nothing ____.aload(X) .astore(X).__(), }, { // iload/iload = iload/dup }, { // astore/astore = pop/astore ____.astore(X) .astore(X).__(), .astore(X).__() }, { // istore/iload = dup/istore }, { // astore/aload = dup/astore ____.astore(X) .aload(X).__(), .astore(X).__() }, { // iload/dup/istore = iload ____.aload(X) .dup() .astore(X).__(),
{ // a = a = nothing ____.aload(X) .astore(X).__(), }, { // iload/iload = iload/dup }, { // astore/astore = pop/astore ____.astore(X) .astore(X).__(), .astore(X).__() }, { // istore/iload = dup/istore }, { // astore/aload = dup/astore ____.astore(X) .aload(X).__(), .astore(X).__() }, { // iload/dup/istore = iload ____.aload(X) .dup() .astore(X).__(),