@Override public Node canonical(CanonicalizerTool tool) { if (clazz.isConstant()) { if (GeneratePIC.getValue(tool.getOptions())) { // Can't fold for AOT, because the resulting NewInstanceNode will be missing its // InitializeKlassNode. return this; } ResolvedJavaType type = tool.getConstantReflection().asJavaType(clazz.asConstant()); if (type != null && type.isInitialized() && !throwsInstantiationException(type, tool.getMetaAccess())) { return createNewInstanceNode(type); } } return this; }