本文整理匯總了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;
}
示例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);
}
}
示例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())));
}
示例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;
}
示例5: isFinalField
import jdk.vm.ci.meta.ResolvedJavaField; //導入方法依賴的package包/類
@SuppressWarnings("unused")
protected boolean isFinalField(ResolvedJavaField field, ConstantFieldTool<?> tool) {
return field.isFinal();
}