public void visitVarInsn(final int opcode, final int var) {
        lastBytecodeOffset = code.length;
        // Add the instruction to the bytecode of the method.
        if (var < 4 && opcode != Opcodes.RET) {
            int optimizedOpcode;
            if (opcode < Opcodes.ISTORE) {
                optimizedOpcode = Constants.ILOAD_0 + ((opcode - Opcodes.ILOAD) << 2) + var;
            } else {
                optimizedOpcode = Constants.ISTORE_0 + ((opcode - Opcodes.ISTORE) << 2) + var;
            }
            code.putByte(optimizedOpcode);
        } else if (var >= 256) {
            code.putByte(Constants.WIDE).put12(opcode, var);
        } else {
            code.put11(opcode, var);
        }
        // If needed, update the maximum stack size and number of locals, and stack map frames.
        if (currentBasicBlock != null) {
            currentBasicBlock.frame.execute(opcode, var, null, null);
        }

        int currentMaxLocals;
        if (opcode == Opcodes.LLOAD
                || opcode == Opcodes.DLOAD
                || opcode == Opcodes.LSTORE
                || opcode == Opcodes.DSTORE) {
            currentMaxLocals = var + 2;
        } else {
            currentMaxLocals = var + 1;
        }
        if (currentMaxLocals > maxLocals) {
            maxLocals = currentMaxLocals;
        }
    }
Constructs a new {@link MethodWriter}.

@param symbolTable where the constants used in this AnnotationWriter must be stored.
@param access      the method's access flags (see {@link Opcodes}).
@param name        the method's name.
@param descriptor  the method's descriptor (see {@link Type}).
core/src/main/java/com/alibaba/fastjson2/internal/asm/MethodWriter.java