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


Java InstructionConstants.OP_RET屬性代碼示例

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


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

示例1: visitVariableInstruction

public void visitVariableInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, VariableInstruction variableInstruction)
{
    // Mark the instruction.
    instructionMarks[offset] |= INSTRUCTION;

    // Check if this is the first instruction of a subroutine.
    checkSubroutine(offset);

    if (variableInstruction.opcode == InstructionConstants.OP_RET)
    {
        // Mark the branch origin.
        markBranchOrigin(offset);

        // Mark the regular subroutine return.
        instructionMarks[offset] |= SUBROUTINE_RETURNING;

        // Mark the next instruction.
        markAfterBranchOrigin(offset + variableInstruction.length(offset));
    }
}
 
開發者ID:tranleduy2000,項目名稱:javaide,代碼行數:20,代碼來源:BranchTargetFinder.java

示例2: visitVariableInstruction

public void visitVariableInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, VariableInstruction variableInstruction)
{
    byte opcode = variableInstruction.opcode;

    // The ret instruction end the current instruction block.
    exitInstructionBlock =
        opcode == InstructionConstants.OP_RET;
}
 
開發者ID:tranleduy2000,項目名稱:javaide,代碼行數:8,代碼來源:StackSizeComputer.java

示例3: visitVariableInstruction

public void visitVariableInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, VariableInstruction variableInstruction)
{
    byte opcode = variableInstruction.opcode;

    // Check for instructions that might cause side effects.
    if (includeReturnInstructions &&
        opcode == InstructionConstants.OP_RET)
    {
        hasSideEffects = true;
    }
}
 
開發者ID:tranleduy2000,項目名稱:javaide,代碼行數:11,代碼來源:SideEffectInstructionChecker.java

示例4: visitVariableInstruction

public void visitVariableInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, VariableInstruction variableInstruction)
{
    if (variableInstruction.opcode == InstructionConstants.OP_RET)
    {
        next = false;
    }
}
 
開發者ID:tranleduy2000,項目名稱:javaide,代碼行數:7,代碼來源:ReachableCodeMarker.java

示例5: visitVariableInstruction

public void visitVariableInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, VariableInstruction variableInstruction)
{
    byte opcode = variableInstruction.opcode;
    if (opcode == InstructionConstants.OP_RET)
    {
        // Is the return instruction the last instruction of the subroutine?
        if (branchTargetFinder.subroutineEnd(offset) == offset + variableInstruction.length(offset))
        {
            if (DEBUG)
            {
                System.out.println("    Replacing subroutine return at ["+offset+"] by a label");
            }

            // Append a label at this offset instead of the subroutine return.
            codeAttributeComposer.appendLabel(offset);
        }
        else
        {
            if (DEBUG)
            {
                System.out.println("    Replacing subroutine return at ["+offset+"] by a simple branch");
            }

            // Replace the instruction by a branch.
            Instruction replacementInstruction =
                new BranchInstruction(InstructionConstants.OP_GOTO,
                                      branchTargetFinder.subroutineEnd(offset) - offset).shrink();

            codeAttributeComposer.appendInstruction(offset, replacementInstruction);
        }
    }
    else if (branchTargetFinder.isSubroutineStart(offset))
    {
        if (DEBUG)
        {
            System.out.println("    Replacing first subroutine instruction at ["+offset+"] by a label");
        }

        // Append a label at this offset instead of saving the subroutine
        // return address.
        codeAttributeComposer.appendLabel(offset);
    }
    else
    {
        // Append the instruction.
        codeAttributeComposer.appendInstruction(offset, variableInstruction);
    }
}
 
開發者ID:tranleduy2000,項目名稱:javaide,代碼行數:48,代碼來源:CodeSubroutineInliner.java

示例6: visitVariableInstruction

public void visitVariableInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, VariableInstruction variableInstruction)
{
    int variableIndex = variableInstruction.variableIndex;

    switch (variableInstruction.opcode)
    {
        case InstructionConstants.OP_ILOAD:
        case InstructionConstants.OP_ILOAD_0:
        case InstructionConstants.OP_ILOAD_1:
        case InstructionConstants.OP_ILOAD_2:
        case InstructionConstants.OP_ILOAD_3:
            replaceIntegerPushInstruction(clazz, offset, variableInstruction, variableIndex);
            break;

        case InstructionConstants.OP_LLOAD:
        case InstructionConstants.OP_LLOAD_0:
        case InstructionConstants.OP_LLOAD_1:
        case InstructionConstants.OP_LLOAD_2:
        case InstructionConstants.OP_LLOAD_3:
            replaceLongPushInstruction(clazz, offset, variableInstruction, variableIndex);
            break;

        case InstructionConstants.OP_FLOAD:
        case InstructionConstants.OP_FLOAD_0:
        case InstructionConstants.OP_FLOAD_1:
        case InstructionConstants.OP_FLOAD_2:
        case InstructionConstants.OP_FLOAD_3:
            replaceFloatPushInstruction(clazz, offset, variableInstruction, variableIndex);
            break;

        case InstructionConstants.OP_DLOAD:
        case InstructionConstants.OP_DLOAD_0:
        case InstructionConstants.OP_DLOAD_1:
        case InstructionConstants.OP_DLOAD_2:
        case InstructionConstants.OP_DLOAD_3:
            replaceDoublePushInstruction(clazz, offset, variableInstruction, variableIndex);
            break;

        case InstructionConstants.OP_ALOAD:
        case InstructionConstants.OP_ALOAD_0:
        case InstructionConstants.OP_ALOAD_1:
        case InstructionConstants.OP_ALOAD_2:
        case InstructionConstants.OP_ALOAD_3:
            replaceReferencePushInstruction(clazz, offset, variableInstruction);
            break;

        case InstructionConstants.OP_ASTORE:
        case InstructionConstants.OP_ASTORE_0:
        case InstructionConstants.OP_ASTORE_1:
        case InstructionConstants.OP_ASTORE_2:
        case InstructionConstants.OP_ASTORE_3:
            deleteReferencePopInstruction(clazz, offset, variableInstruction);
            break;

        case InstructionConstants.OP_RET:
            replaceBranchInstruction(clazz, offset, variableInstruction);
            break;
    }
}
 
開發者ID:tranleduy2000,項目名稱:javaide,代碼行數:59,代碼來源:EvaluationSimplifier.java


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