Search in sources :

Example 1 with ShortArrayCodeOutput

use of com.android.dx.io.instructions.ShortArrayCodeOutput in project buck by facebook.

the class InstructionTransformer method transform.

public short[] transform(IndexMap indexMap, short[] encodedInstructions) throws DexException {
    DecodedInstruction[] decodedInstructions = DecodedInstruction.decodeAll(encodedInstructions);
    int size = decodedInstructions.length;
    this.indexMap = indexMap;
    mappedInstructions = new DecodedInstruction[size];
    mappedAt = 0;
    reader.visitAll(decodedInstructions);
    ShortArrayCodeOutput out = new ShortArrayCodeOutput(size);
    for (DecodedInstruction instruction : mappedInstructions) {
        if (instruction != null) {
            instruction.encode(out);
        }
    }
    this.indexMap = null;
    return out.getArray();
}
Also used : DecodedInstruction(com.android.dx.io.instructions.DecodedInstruction) ShortArrayCodeOutput(com.android.dx.io.instructions.ShortArrayCodeOutput)

Example 2 with ShortArrayCodeOutput

use of com.android.dx.io.instructions.ShortArrayCodeOutput in project J2ME-Loader by nikita36078.

the class InstructionTransformer method transform.

public short[] transform(IndexMap indexMap, short[] encodedInstructions) throws DexException {
    DecodedInstruction[] decodedInstructions = DecodedInstruction.decodeAll(encodedInstructions);
    int size = decodedInstructions.length;
    this.indexMap = indexMap;
    mappedInstructions = new DecodedInstruction[size];
    mappedAt = 0;
    reader.visitAll(decodedInstructions);
    ShortArrayCodeOutput out = new ShortArrayCodeOutput(size);
    for (DecodedInstruction instruction : mappedInstructions) {
        if (instruction != null) {
            instruction.encode(out);
        }
    }
    this.indexMap = null;
    return out.getArray();
}
Also used : DecodedInstruction(com.android.dx.io.instructions.DecodedInstruction) ShortArrayCodeOutput(com.android.dx.io.instructions.ShortArrayCodeOutput)

Aggregations

DecodedInstruction (com.android.dx.io.instructions.DecodedInstruction)2 ShortArrayCodeOutput (com.android.dx.io.instructions.ShortArrayCodeOutput)2