use of org.graalvm.compiler.core.common.type.StampPair in project graal by oracle.
the class SubstrateObjectCloneNode method genLoadFieldNode.
@Override
protected LoadFieldNode genLoadFieldNode(Assumptions assumptions, ValueNode originalAlias, ResolvedJavaField field) {
if (field.getJavaKind() == JavaKind.Object && field.getType() instanceof SharedType) {
/*
* We have the static analysis to check interface types, e.g.., if a parameter of field
* has a declared interface type and is assigned something that does not implement the
* interface, the static analysis reports an error.
*/
TypeReference trusted = TypeReference.createTrustedWithoutAssumptions((SharedType) field.getType());
StampPair pair = StampPair.createSingle(StampFactory.object(trusted, false));
return LoadFieldNode.createOverrideStamp(pair, originalAlias, field);
} else {
return super.genLoadFieldNode(assumptions, originalAlias, field);
}
}
use of org.graalvm.compiler.core.common.type.StampPair in project graal by oracle.
the class WordOperationPlugin method handleLoadField.
@Override
public boolean handleLoadField(GraphBuilderContext b, ValueNode receiver, ResolvedJavaField field) {
StampPair wordStamp = interceptType(b, field.getType(), false);
if (wordStamp != null) {
LoadFieldNode loadFieldNode = LoadFieldNode.createOverrideStamp(wordStamp, receiver, field);
b.addPush(field.getJavaKind(), loadFieldNode);
return true;
}
return false;
}
Aggregations