private static void reportPrunedTypeFlows(BufferedWriter out) { doWrite(out, String.format("%-35s\n", "Summary")); doWrite(out, String.format("%-35s\t%-10s\n", "Type Flow Class", "Removed Count")); typeFlowBuilders.stream().filter(Objects::nonNull).filter(b -> !b.isMaterialized()).collect(Collectors.groupingBy(TypeFlowBuilder::getFlowClass)).forEach((flowClass, providers) -> { doWrite(out, String.format("%-35s\t%-10d\n", flowClass.getSimpleName(), providers.size())); }); doWrite(out, String.format("\n%-35s\n", "Removed flows")); doWrite(out, String.format("%-35s\t%-10s\n", "Type Flow Class", "Location")); typeFlowBuilders.stream().filter(Objects::nonNull).filter(b -> !b.isMaterialized()).forEach((provider) -> { Object source = provider.getSource(); String sourceStr; if (source instanceof ValueNode) { ValueNode value = (ValueNode) source; NodeSourcePosition srcPosition = value.getNodeSourcePosition(); if (srcPosition != null) { sourceStr = srcPosition.toString(); } else { sourceStr = value.toString() + " @ " + value.graph().method().format("%H.%n(%p)"); } } else { sourceStr = source.toString(); } doWrite(out, String.format("%-35s\t%-10s\n", provider.getFlowClass().getSimpleName(), sourceStr)); }); }
@Override public String toString() { return "dispatchedType=" + (dispatchedType == null ? "null" : dispatchedType.getName()) + " target_method=" + concreteMethod.getName() + " target_method_class=" + concreteMethod.getDeclaringClass().getName() + " position=" + super.toString(); } }
@Override public void lower(DeoptimizeNode node, LoweringTool tool) { LoweringStage loweringStage = tool.getLoweringStage(); if (loweringStage != LoweringTool.StandardLoweringStage.LOW_TIER) { return; } switch (node.getReason()) { case NullCheckException: case BoundsCheckException: case ClassCastException: case ArrayStoreException: case ArithmeticException: case UnreachedCode: case TypeCheckedInliningViolated: case NotCompiledExceptionHandler: case TransferToInterpreter: case Unresolved: break; default: throw shouldNotReachHere("Unexpected reason: " + node.getReason()); } StructuredGraph graph = node.graph(); Arguments args = new Arguments(deopt, graph.getGuardsStage(), loweringStage); args.addConst("reason", node.getReason()); args.addConst("mustNotAllocate", mustNotAllocate(graph.method())); args.add("sourcePosition", node.getNodeSourcePosition() != null ? node.getNodeSourcePosition().toString() : null); template(node, args).instantiate(providers.getMetaAccess(), node, SnippetTemplate.DEFAULT_REPLACER, args); } }