use of org.graalvm.compiler.nodes.virtual.VirtualInstanceNode in project graal by oracle.
the class NewInstanceNode method virtualize.
@Override
public void virtualize(VirtualizerTool tool) {
/*
* Reference objects can escape into their ReferenceQueue at any safepoint, therefore
* they're excluded from escape analysis.
*/
if (!tool.getMetaAccessProvider().lookupJavaType(Reference.class).isAssignableFrom(instanceClass)) {
VirtualInstanceNode virtualObject = createVirtualInstanceNode(true);
ResolvedJavaField[] fields = virtualObject.getFields();
ValueNode[] state = new ValueNode[fields.length];
for (int i = 0; i < state.length; i++) {
state[i] = defaultFieldValue(fields[i]);
}
tool.createVirtualObject(virtualObject, state, Collections.<MonitorIdNode>emptyList(), false);
tool.replaceWithVirtual(virtualObject);
}
}
Aggregations