use of com.oracle.svm.core.graal.nodes.SubstrateVirtualArrayNode in project graal by oracle.
the class SubstrateArraysCopyOfNode method virtualize.
@Override
public void virtualize(VirtualizerTool tool) {
if (!newArrayType.isConstant()) {
/*
* This is an object array copy. If the new array type is not a constant then it cannot
* be vitualized.
*/
return;
}
/* from index is always 0 for Arrays.copyOf. */
ValueNode from = ConstantNode.forInt(0);
ResolvedJavaType newComponentType = tool.getConstantReflectionProvider().asJavaType(newArrayType.asConstant()).getComponentType();
GraphUtil.virtualizeArrayCopy(tool, original, originalLength, newLength, from, newComponentType, JavaKind.Object, graph(), (componentType, length) -> new SubstrateVirtualArrayNode(componentType, length));
}
Aggregations