bytekit-core/src/main/java/com/alibaba/bytekit/utils/AsmOpUtils.java [233:262]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	public static void box(final InsnList instructions, Type type) {
		if (type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY) {
			return;
		}

		if (type == Type.VOID_TYPE) {
			// push null
			instructions.add(new InsnNode(Opcodes.ACONST_NULL));
		} else {
			Type boxed = getBoxedType(type);
			// new instance.
			newInstance(instructions, boxed);
			if (type.getSize() == 2) {
				// Pp -> Ppo -> oPpo -> ooPpo -> ooPp -> o
				// dupX2
				dupX2(instructions);
				// dupX2
				dupX2(instructions);
				// pop
				pop(instructions);
			} else {
				// p -> po -> opo -> oop -> o
				// dupX1
				dupX1(instructions);
				// swap
				swap(instructions);
			}
			invokeConstructor(instructions, boxed, new Method("<init>", Type.VOID_TYPE, new Type[] { type }));
		}
	}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



bytekit-core/src/main/java/com/alibaba/bytekit/asm/MethodProcessor.java [516:545]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    void box(final InsnList instructions, Type type) {
        if (type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY) {
            return;
        }

        if (type == Type.VOID_TYPE) {
            // push null
            instructions.add(new InsnNode(Opcodes.ACONST_NULL));
        } else {
            Type boxed = getBoxedType(type);
            // new instance.
            newInstance(instructions, boxed);
            if (type.getSize() == 2) {
                // Pp -> Ppo -> oPpo -> ooPpo -> ooPp -> o
                // dupX2
                dupX2(instructions);
                // dupX2
                dupX2(instructions);
                // pop
                pop(instructions);
            } else {
                // p -> po -> opo -> oop -> o
                // dupX1
                dupX1(instructions);
                // swap
                swap(instructions);
            }
            invokeConstructor(instructions, boxed, new Method("<init>", Type.VOID_TYPE, new Type[] { type }));
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



