Is this discussion in reference to this part of InvokeDynamicWriter?

    public void castNonPrimitiveToBool(final ClassNode sourceType) {
        writeIndyCast(sourceType, boolean_TYPE);
    }

    private void writeIndyCast(final ClassNode sourceType, final ClassNode 
targetType) {
        String descriptor = "(" + getTypeDescription(sourceType) + ')' + 
getTypeDescription(targetType);
        
controller.getMethodVisitor().visitInvokeDynamicInsn(CAST.getCallSiteName(), 
descriptor, BSM, CAST_ARGS);
        controller.getOperandStack().replace(targetType); // cast converts top 
operand from source to target type
    }

Reply via email to