Java Code Examples for com.android.dx.cf.code.ByteOps#BIPUSH

The following examples show how to use com.android.dx.cf.code.ByteOps#BIPUSH . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CodeObserver.java    From Box with Apache License 2.0 6 votes vote down vote up
/**
 * Helper for {@link #visitConstant} where the constant is an
 * {@code int}.
 *
 * @param opcode the opcode
 * @param offset offset to the instruction
 * @param length instruction length
 * @param value constant value
 */
private void visitLiteralInt(int opcode, int offset, int length,
        int value) {
    String commentOrSpace = (length == 1) ? " // " : " ";
    String valueStr;

    opcode = bytes.getUnsignedByte(offset); // Compare with orig op below.
    if ((length == 1) || (opcode == ByteOps.BIPUSH)) {
        valueStr = "#" + Hex.s1(value);
    } else if (opcode == ByteOps.SIPUSH) {
        valueStr = "#" + Hex.s2(value);
    } else {
        valueStr = "#" + Hex.s4(value);
    }

    observer.parsed(bytes, offset, length,
                    header(offset) + commentOrSpace + valueStr);
}
 
Example 2
Source File: CodeObserver.java    From Box with Apache License 2.0 6 votes vote down vote up
/**
 * Helper for {@link #visitConstant} where the constant is an
 * {@code int}.
 *
 * @param opcode the opcode
 * @param offset offset to the instruction
 * @param length instruction length
 * @param value constant value
 */
private void visitLiteralInt(int opcode, int offset, int length,
        int value) {
    String commentOrSpace = (length == 1) ? " // " : " ";
    String valueStr;

    opcode = bytes.getUnsignedByte(offset); // Compare with orig op below.
    if ((length == 1) || (opcode == ByteOps.BIPUSH)) {
        valueStr = "#" + Hex.s1(value);
    } else if (opcode == ByteOps.SIPUSH) {
        valueStr = "#" + Hex.s2(value);
    } else {
        valueStr = "#" + Hex.s4(value);
    }

    observer.parsed(bytes, offset, length,
                    header(offset) + commentOrSpace + valueStr);
}
 
Example 3
Source File: CodeObserver.java    From J2ME-Loader with Apache License 2.0 6 votes vote down vote up
/**
 * Helper for {@link #visitConstant} where the constant is an
 * {@code int}.
 *
 * @param opcode the opcode
 * @param offset offset to the instruction
 * @param length instruction length
 * @param value constant value
 */
private void visitLiteralInt(int opcode, int offset, int length,
        int value) {
    String commentOrSpace = (length == 1) ? " // " : " ";
    String valueStr;

    opcode = bytes.getUnsignedByte(offset); // Compare with orig op below.
    if ((length == 1) || (opcode == ByteOps.BIPUSH)) {
        valueStr = "#" + Hex.s1(value);
    } else if (opcode == ByteOps.SIPUSH) {
        valueStr = "#" + Hex.s2(value);
    } else {
        valueStr = "#" + Hex.s4(value);
    }

    observer.parsed(bytes, offset, length,
                    header(offset) + commentOrSpace + valueStr);
}
 
Example 4
Source File: CodeObserver.java    From buck with Apache License 2.0 6 votes vote down vote up
/**
 * Helper for {@link #visitConstant} where the constant is an
 * {@code int}.
 *
 * @param opcode the opcode
 * @param offset offset to the instruction
 * @param length instruction length
 * @param value constant value
 */
private void visitLiteralInt(int opcode, int offset, int length,
        int value) {
    String commentOrSpace = (length == 1) ? " // " : " ";
    String valueStr;

    opcode = bytes.getUnsignedByte(offset); // Compare with orig op below.
    if ((length == 1) || (opcode == ByteOps.BIPUSH)) {
        valueStr = "#" + Hex.s1(value);
    } else if (opcode == ByteOps.SIPUSH) {
        valueStr = "#" + Hex.s2(value);
    } else {
        valueStr = "#" + Hex.s4(value);
    }

    observer.parsed(bytes, offset, length,
                    header(offset) + commentOrSpace + valueStr);
}