當前位置: 首頁>>代碼示例>>Java>>正文


Java Opcode.NOP屬性代碼示例

本文整理匯總了Java中org.jf.dexlib.Code.Opcode.NOP屬性的典型用法代碼示例。如果您正苦於以下問題:Java Opcode.NOP屬性的具體用法?Java Opcode.NOP怎麽用?Java Opcode.NOP使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.jf.dexlib.Code.Opcode的用法示例。


在下文中一共展示了Opcode.NOP屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: SparseSwitchDataPseudoInstruction

public SparseSwitchDataPseudoInstruction(int[] keys, int[] targets) {
    super(Opcode.NOP);

    if (keys.length != targets.length) {
        throw new RuntimeException("The number of keys and targets don't match");
    }

    if (targets.length == 0) {
        throw new RuntimeException("The sparse-switch data must contain at least 1 key/target");
    }

    if (targets.length > 0xFFFF) {
        throw new RuntimeException("The sparse-switch data contains too many elements. " +
                "The maximum number of switch elements is 65535");
    }

    this.keys = keys;
    this.targets = targets;
}
 
開發者ID:DocGerd,項目名稱:DalvikSSA,代碼行數:19,代碼來源:SparseSwitchDataPseudoInstruction.java

示例2: ArrayDataPseudoInstruction

public ArrayDataPseudoInstruction(byte[] buffer, int bufferIndex) {
    super(Opcode.NOP);

    byte opcodeByte = buffer[bufferIndex];
    if (opcodeByte != 0x00) {
        throw new RuntimeException("Invalid opcode byte for an ArrayData pseudo-instruction");
    }

    byte subopcodeByte = buffer[bufferIndex+1];
    if (subopcodeByte != 0x03) {
        throw new RuntimeException("Invalid sub-opcode byte for an ArrayData pseudo-instruction");
    }

    this.elementWidth = NumberUtils.decodeUnsignedShort(buffer, bufferIndex+2);
    int elementCount = NumberUtils.decodeInt(buffer, bufferIndex+4);
    this.encodedValues = new byte[elementCount * elementWidth];
    System.arraycopy(buffer, bufferIndex+8, encodedValues, 0, elementCount * elementWidth);
}
 
開發者ID:DocGerd,項目名稱:DalvikSSA,代碼行數:18,代碼來源:ArrayDataPseudoInstruction.java

示例3: PackedSwitchDataPseudoInstruction

public PackedSwitchDataPseudoInstruction(byte[] buffer, int bufferIndex) {
    super(Opcode.NOP);

    byte opcodeByte = buffer[bufferIndex];
    if (opcodeByte != 0x00) {
        throw new RuntimeException("Invalid opcode byte for a PackedSwitchData pseudo-instruction");
    }
    byte subopcodeByte = buffer[bufferIndex+1];
    if (subopcodeByte != 0x01) {
        throw new RuntimeException("Invalid sub-opcode byte for a PackedSwitchData pseudo-instruction");
    }

    int targetCount = NumberUtils.decodeUnsignedShort(buffer, bufferIndex + 2);
    this.firstKey = NumberUtils.decodeInt(buffer, bufferIndex + 4);
    this.targets = new int[targetCount];

    for (int i = 0; i<targetCount; i++) {
        targets[i] = NumberUtils.decodeInt(buffer, bufferIndex + 8 + 4*i);
    }
}
 
開發者ID:DocGerd,項目名稱:DalvikSSA,代碼行數:20,代碼來源:PackedSwitchDataPseudoInstruction.java

示例4: isInstructionPaddingNop

/**
 * @param instructions The instructions array for this method
 * @param instruction The instruction
 * @return true if the specified instruction is a NOP, and the next instruction is one of the variable sized
 * switch/array data structures
 */
private boolean isInstructionPaddingNop(List<AnalyzedInstruction> instructions, AnalyzedInstruction instruction) {
    if (instruction.getInstruction().opcode != Opcode.NOP ||
        instruction.getInstruction().getFormat().variableSizeFormat) {

        return false;
    }

    if (instruction.getInstructionIndex() == instructions.size()-1) {
        return false;
    }

    AnalyzedInstruction nextInstruction = instructions.get(instruction.getInstructionIndex()+1);
    if (nextInstruction.getInstruction().getFormat().variableSizeFormat) {
        return true;
    }
    return false;
}
 
開發者ID:DocGerd,項目名稱:DalvikSSA,代碼行數:23,代碼來源:MethodDefinition.java

示例5: makeInstruction

public Instruction makeInstruction(DexFile dexFile, Opcode opcode, byte[] buffer, int bufferIndex) {
    if (opcode != Opcode.NOP) {
        throw new RuntimeException("The opcode for a SparseSwitchDataPseudoInstruction must be NOP");
    }
    return new SparseSwitchDataPseudoInstruction(buffer, bufferIndex);
}
 
開發者ID:DocGerd,項目名稱:DalvikSSA,代碼行數:6,代碼來源:SparseSwitchDataPseudoInstruction.java

示例6: makeInstruction

public Instruction makeInstruction(DexFile dexFile, Opcode opcode, byte[] buffer, int bufferIndex) {
    if (opcode != Opcode.NOP) {
        throw new RuntimeException("The opcode for an ArrayDataPseudoInstruction must be NOP");
    }
    return new ArrayDataPseudoInstruction(buffer, bufferIndex);
}
 
開發者ID:DocGerd,項目名稱:DalvikSSA,代碼行數:6,代碼來源:ArrayDataPseudoInstruction.java

示例7: makeInstruction

public Instruction makeInstruction(DexFile dexFile, Opcode opcode, byte[] buffer, int bufferIndex) {
    if (opcode != Opcode.NOP) {
        throw new RuntimeException("The opcode for a PackedSwitchDataPseudoInstruction must be NOP");
    }
    return new PackedSwitchDataPseudoInstruction(buffer, bufferIndex);
}
 
開發者ID:DocGerd,項目名稱:DalvikSSA,代碼行數:6,代碼來源:PackedSwitchDataPseudoInstruction.java


注:本文中的org.jf.dexlib.Code.Opcode.NOP屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。