private void prebox(TypeDesc from, TypeDesc to) {
        if (mTarget >= 0x00010005) {
            // No need to prebox since static valueOf method can be called
            // instead.
            return;
        }

        // Wouldn't it be cool if I could walk backwards in the instruction
        // list and insert the new-dup pair before the value to box was even
        // put on the stack?

        switch (from.getTypeCode()) {
        default:
            break;
        case TypeDesc.BOOLEAN_CODE:
            if (to.toPrimitiveType().getTypeCode() == TypeDesc.BOOLEAN_CODE) {
                break;
            }
            // fall through
        case TypeDesc.CHAR_CODE:
        case TypeDesc.FLOAT_CODE:
        case TypeDesc.BYTE_CODE:
        case TypeDesc.SHORT_CODE:
        case TypeDesc.INT_CODE:
            newObject(to);
            dupX1();
            swap();
            break;
        case TypeDesc.DOUBLE_CODE:
        case TypeDesc.LONG_CODE:
            newObject(to);
            dupX2();
            dupX2();
            pop();
            break;
        }
    }
private void prebox ( TypeDesc from , TypeDesc to ) { if ( mTarget >= 0x00010005 ) { return ; } switch ( from . getTypeCode ( ) ) { default : break ; case TypeDesc . BOOLEAN_CODE : if ( to . toPrimitiveType ( ) . getTypeCode ( ) == TypeDesc . BOOLEAN_CODE ) { break ; } case TypeDesc . CHAR_CODE : case TypeDesc . FLOAT_CODE : case TypeDesc . BYTE_CODE : case TypeDesc . SHORT_CODE : case TypeDesc . INT_CODE : newObject ( to ) ; dupX1 ( ) ; swap ( ) ; break ; case TypeDesc . DOUBLE_CODE : case TypeDesc . LONG_CODE : newObject ( to ) ; dupX2 ( ) ; dupX2 ( ) ; pop ( ) ; break ; } }
@param from must be a primitive type
@param to must be an object type