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


Java ResolvedJavaField.isFinal方法代碼示例

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


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

示例1: asPhi

import jdk.vm.ci.meta.ResolvedJavaField; //導入方法依賴的package包/類
private static PhiNode asPhi(ConstantFieldProvider constantFields, ConstantReflectionProvider constantReflection,
                MetaAccessProvider metaAcccess, OptionValues options, ValueNode forObject, ResolvedJavaField field, Stamp stamp) {
    if (!field.isStatic() && field.isFinal() && forObject instanceof ValuePhiNode && ((ValuePhiNode) forObject).values().filter(isNotA(ConstantNode.class)).isEmpty()) {
        PhiNode phi = (PhiNode) forObject;
        ConstantNode[] constantNodes = new ConstantNode[phi.valueCount()];
        for (int i = 0; i < phi.valueCount(); i++) {
            ConstantNode constant = ConstantFoldUtil.tryConstantFold(constantFields, constantReflection, metaAcccess, field, phi.valueAt(i).asJavaConstant(),
                            options);
            if (constant == null) {
                return null;
            }
            constantNodes[i] = constant;
        }
        return new ValuePhiNode(stamp, phi.merge(), constantNodes);
    }
    return null;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:18,代碼來源:LoadFieldNode.java

示例2: genPutField

import jdk.vm.ci.meta.ResolvedJavaField; //導入方法依賴的package包/類
private void genPutField(JavaField field, ValueNode value) {
    ValueNode receiver = emitExplicitExceptions(frameState.pop(JavaKind.Object));
    if (field instanceof ResolvedJavaField) {
        ResolvedJavaField resolvedField = (ResolvedJavaField) field;

        if (!parsingIntrinsic() && GeneratePIC.getValue(getOptions())) {
            graph.recordField(resolvedField);
        }

        for (NodePlugin plugin : graphBuilderConfig.getPlugins().getNodePlugins()) {
            if (plugin.handleStoreField(this, receiver, resolvedField, value)) {
                return;
            }
        }

        if (resolvedField.isFinal() && method.isConstructor()) {
            finalBarrierRequired = true;
        }
        genStoreField(receiver, resolvedField, value);
    } else {
        handleUnresolvedStoreField(field, value, receiver);
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:24,代碼來源:BytecodeParser.java

示例3: insertAllocationBarrier

import jdk.vm.ci.meta.ResolvedJavaField; //導入方法依賴的package包/類
/**
 * Insert the required {@link MemoryBarriers#STORE_STORE} barrier for an allocation and also
 * include the {@link MemoryBarriers#LOAD_STORE} required for final fields if any final fields
 * are being written, as if {@link FinalFieldBarrierNode} were emitted.
 */
private static void insertAllocationBarrier(CommitAllocationNode commit, StructuredGraph graph) {
    int barrier = MemoryBarriers.STORE_STORE;
    outer: for (VirtualObjectNode vobj : commit.getVirtualObjects()) {
        for (ResolvedJavaField field : vobj.type().getInstanceFields(true)) {
            if (field.isFinal()) {
                barrier = barrier | MemoryBarriers.LOAD_STORE;
                break outer;
            }
        }
    }
    graph.addAfterFixed(commit, graph.add(new MembarNode(barrier, LocationIdentity.init())));
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:18,代碼來源:DefaultJavaLoweringProvider.java

示例4: isSyntheticEnumSwitchMap

import jdk.vm.ci.meta.ResolvedJavaField; //導入方法依賴的package包/類
protected boolean isSyntheticEnumSwitchMap(ResolvedJavaField field) {
    if (field.isSynthetic() && field.isStatic() && isArray(field)) {
        String name = field.getName();
        if (field.isFinal() && name.equals("$VALUES") || name.equals("ENUM$VALUES")) {
            // generated int[] field for EnumClass::values()
            return true;
        } else if (name.startsWith("$SwitchMap$") || name.startsWith("$SWITCH_TABLE$")) {
            // javac and ecj generate a static field in an inner class for a switch on an enum
            // named $SwitchMap$p$k$g$EnumClass and $SWITCH_TABLE$p$k$g$EnumClass, respectively
            return true;
        }
    }
    return false;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:15,代碼來源:JavaConstantFieldProvider.java

示例5: isFinalField

import jdk.vm.ci.meta.ResolvedJavaField; //導入方法依賴的package包/類
@SuppressWarnings("unused")
protected boolean isFinalField(ResolvedJavaField field, ConstantFieldTool<?> tool) {
    return field.isFinal();
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:5,代碼來源:JavaConstantFieldProvider.java


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