src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningUtil.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningUtil.java

Print this page




 499         Assumptions assumptions = graph.getAssumptions();
 500         if (assumptions != null) {
 501             if (inlinedAssumptions != null) {
 502                 assumptions.record(inlinedAssumptions);
 503             }
 504         } else {
 505             assert inlinedAssumptions == null : String.format("cannot inline graph (%s) which makes assumptions into a graph (%s) that doesn't", inlineGraph, graph);
 506         }
 507 
 508         // Copy inlined methods from inlinee to caller
 509         graph.updateMethods(inlineGraph);
 510 
 511         // Update the set of accessed fields
 512         if (GraalOptions.GeneratePIC.getValue(graph.getOptions())) {
 513             graph.updateFields(inlineGraph);
 514         }
 515 
 516         if (inlineGraph.hasUnsafeAccess()) {
 517             graph.markUnsafeAccess();
 518         }
 519         assert inlineGraph.getSpeculationLog() == null : "Only the root graph should have a speculation log";
 520 
 521         return returnValue;
 522     }
 523 
 524     private static void fixFrameStates(StructuredGraph graph, MergeNode originalMerge, PhiNode returnPhi) {
 525         // It is possible that some of the frame states that came from AFTER_BCI reference a Phi
 526         // node that was created to merge multiple returns. This can create cycles
 527         // (see GR-3949 and GR-3957).
 528         // To detect this, we follow the control paths starting from the merge node,
 529         // split the Phi node inputs at merges and assign the proper input to each frame state.
 530         NodeMap<Node> seen = new NodeMap<>(graph);
 531         ArrayDeque<Node> workList = new ArrayDeque<>();
 532         ArrayDeque<ValueNode> valueList = new ArrayDeque<>();
 533         workList.push(originalMerge);
 534         valueList.push(returnPhi);
 535         while (!workList.isEmpty()) {
 536             Node current = workList.pop();
 537             ValueNode currentValue = valueList.pop();
 538             if (seen.containsKey(current)) {
 539                 continue;




 499         Assumptions assumptions = graph.getAssumptions();
 500         if (assumptions != null) {
 501             if (inlinedAssumptions != null) {
 502                 assumptions.record(inlinedAssumptions);
 503             }
 504         } else {
 505             assert inlinedAssumptions == null : String.format("cannot inline graph (%s) which makes assumptions into a graph (%s) that doesn't", inlineGraph, graph);
 506         }
 507 
 508         // Copy inlined methods from inlinee to caller
 509         graph.updateMethods(inlineGraph);
 510 
 511         // Update the set of accessed fields
 512         if (GraalOptions.GeneratePIC.getValue(graph.getOptions())) {
 513             graph.updateFields(inlineGraph);
 514         }
 515 
 516         if (inlineGraph.hasUnsafeAccess()) {
 517             graph.markUnsafeAccess();
 518         }
 519         assert inlineGraph.getSpeculationLog() == null || inlineGraph.getSpeculationLog() == graph.getSpeculationLog() : "Only the root graph should have a speculation log";
 520 
 521         return returnValue;
 522     }
 523 
 524     private static void fixFrameStates(StructuredGraph graph, MergeNode originalMerge, PhiNode returnPhi) {
 525         // It is possible that some of the frame states that came from AFTER_BCI reference a Phi
 526         // node that was created to merge multiple returns. This can create cycles
 527         // (see GR-3949 and GR-3957).
 528         // To detect this, we follow the control paths starting from the merge node,
 529         // split the Phi node inputs at merges and assign the proper input to each frame state.
 530         NodeMap<Node> seen = new NodeMap<>(graph);
 531         ArrayDeque<Node> workList = new ArrayDeque<>();
 532         ArrayDeque<ValueNode> valueList = new ArrayDeque<>();
 533         workList.push(originalMerge);
 534         valueList.push(returnPhi);
 535         while (!workList.isEmpty()) {
 536             Node current = workList.pop();
 537             ValueNode currentValue = valueList.pop();
 538             if (seen.containsKey(current)) {
 539                 continue;


src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningUtil.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File