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


Java InstructionConstants.OP_NEW屬性代碼示例

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


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

示例1: visitConstantInstruction

public void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction)
{
    if (constantInstruction.opcode == InstructionConstants.OP_NEW)
    {
        clazz.constantPoolEntryAccept(constantInstruction.constantIndex, this);
    }
}
 
開發者ID:tranleduy2000,項目名稱:javaide,代碼行數:7,代碼來源:InstantiationClassMarker.java

示例2: visitConstantInstruction

public void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction)
    {
        byte opcode = constantInstruction.opcode;

        // Check for instructions that may throw exceptions.
        switch (opcode)
        {
            case InstructionConstants.OP_GETSTATIC:
            case InstructionConstants.OP_PUTSTATIC:
            case InstructionConstants.OP_GETFIELD:
            case InstructionConstants.OP_PUTFIELD:
            case InstructionConstants.OP_INVOKEVIRTUAL:
            case InstructionConstants.OP_INVOKESPECIAL:
            case InstructionConstants.OP_INVOKESTATIC:
            case InstructionConstants.OP_INVOKEINTERFACE:
            case InstructionConstants.OP_NEW:
            case InstructionConstants.OP_ANEWARRAY:
            case InstructionConstants.OP_CHECKCAST:
            case InstructionConstants.OP_INSTANCEOF:
            case InstructionConstants.OP_MULTIANEWARRAY:
                // These instructions may throw exceptions.
                mayThrowExceptions = true;
        }

//          case InstructionConstants.OP_INVOKEVIRTUAL:
//          case InstructionConstants.OP_INVOKESPECIAL:
//          case InstructionConstants.OP_INVOKESTATIC:
//          case InstructionConstants.OP_INVOKEINTERFACE:
//            // Check if the invoking the method may throw an exception.
//            clazz.constantPoolEntryAccept(constantInstruction.constantIndex, this);
    }
 
開發者ID:tranleduy2000,項目名稱:javaide,代碼行數:31,代碼來源:ExceptionInstructionChecker.java

示例3: visitConstantInstruction

public void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction)
{
    // Mark the initializer invocation, if this is a 'new' instruction.
    if (constantInstruction.opcode == InstructionConstants.OP_NEW)
    {
        markInitialization(offset);
    }

    markStackProducers(clazz, offset, constantInstruction);
}
 
開發者ID:tranleduy2000,項目名稱:javaide,代碼行數:10,代碼來源:EvaluationShrinker.java

示例4: visitConstantInstruction

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

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

    // Check if the instruction is a 'new' instruction.
    if (constantInstruction.opcode == InstructionConstants.OP_NEW)
    {
        // Push the 'new' instruction offset on the stack.
        recentCreationOffsets[recentCreationOffsetIndex++] = offset;
    }
    else
    {
        // Check if the instruction is an initializer invocation.
        isInitializer = false;
        clazz.constantPoolEntryAccept(constantInstruction.constantIndex, this);
        if (isInitializer)
        {
            // Pop the 'new' instruction offset from the stack.
            int recentCreationOffset = recentCreationOffsets[--recentCreationOffsetIndex];

            // Fill it out in the creation offsets.
            creationOffsets[offset] = recentCreationOffset;

            // Fill out the initialization offsets.
            if (recentCreationOffset == AT_METHOD_ENTRY)
            {
                superInitializationOffset = offset;
            }
            else
            {
                initializationOffsets[recentCreationOffset] = offset;
            }
        }
    }
}
 
開發者ID:tranleduy2000,項目名稱:javaide,代碼行數:39,代碼來源:BranchTargetFinder.java

示例5: visitConstantInstruction

public void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction)
{
    // Is it a method invocation?
    switch (constantInstruction.opcode)
    {
        case InstructionConstants.OP_NEW:
            uninitializedObjectCount++;
            break;

        case InstructionConstants.OP_INVOKEVIRTUAL:
        case InstructionConstants.OP_INVOKESPECIAL:
        case InstructionConstants.OP_INVOKESTATIC:
        case InstructionConstants.OP_INVOKEINTERFACE:
            // See if we can inline it.
            inlined = false;

            // Append a label, in case the invocation will be inlined.
            codeAttributeComposer.appendLabel(offset);

            emptyInvokingStack =
                !inlining &&
                stackSizeComputer.isReachable(offset) &&
                stackSizeComputer.getStackSize(offset) == 0;

            variableOffset += codeAttribute.u2maxLocals;

            clazz.constantPoolEntryAccept(constantInstruction.constantIndex, this);

            variableOffset -= codeAttribute.u2maxLocals;

            // Was the method inlined?
            if (inlined)
            {
                if (extraInlinedInvocationVisitor != null)
                {
                    extraInlinedInvocationVisitor.visitConstantInstruction(clazz, method, codeAttribute, offset, constantInstruction);
                }

                // The invocation itself is no longer necessary.
                return;
            }

            break;
    }

    // Are we inlining this instruction?
    if (inlining)
    {
        // Make sure the constant is present in the constant pool of the
        // target class.
        constantInstruction.constantIndex =
            constantAdder.addConstant(clazz, constantInstruction.constantIndex);
    }

    codeAttributeComposer.appendInstruction(offset, constantInstruction.shrink());
}
 
開發者ID:tranleduy2000,項目名稱:javaide,代碼行數:56,代碼來源:MethodInliner.java


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