1 /* |
1 /* |
2 * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
379 FixedNode firstCFGNode = entryPointNode.next(); |
379 FixedNode firstCFGNode = entryPointNode.next(); |
380 if (firstCFGNode == null) { |
380 if (firstCFGNode == null) { |
381 throw new IllegalStateException("Inlined graph is in invalid state: " + inlineGraph); |
381 throw new IllegalStateException("Inlined graph is in invalid state: " + inlineGraph); |
382 } |
382 } |
383 for (Node node : inlineGraph.getNodes()) { |
383 for (Node node : inlineGraph.getNodes()) { |
384 if (node == entryPointNode || (node == entryPointNode.stateAfter() && node.usages().count() == 1) || node instanceof ParameterNode) { |
384 if (node == entryPointNode || (node == entryPointNode.stateAfter() && node.hasExactlyOneUsage()) || node instanceof ParameterNode) { |
385 // Do nothing. |
385 // Do nothing. |
386 } else { |
386 } else { |
387 nodes.add(node); |
387 nodes.add(node); |
388 if (node instanceof ReturnNode) { |
388 if (node instanceof ReturnNode) { |
389 returnNodes.add((ReturnNode) node); |
389 returnNodes.add((ReturnNode) node); |
726 protected static void processFrameStates(Invoke invoke, StructuredGraph inlineGraph, EconomicMap<Node, Node> duplicates, FrameState stateAtExceptionEdge, |
726 protected static void processFrameStates(Invoke invoke, StructuredGraph inlineGraph, EconomicMap<Node, Node> duplicates, FrameState stateAtExceptionEdge, |
727 boolean alwaysDuplicateStateAfter) { |
727 boolean alwaysDuplicateStateAfter) { |
728 FrameState stateAtReturn = invoke.stateAfter(); |
728 FrameState stateAtReturn = invoke.stateAfter(); |
729 FrameState outerFrameState = null; |
729 FrameState outerFrameState = null; |
730 JavaKind invokeReturnKind = invoke.asNode().getStackKind(); |
730 JavaKind invokeReturnKind = invoke.asNode().getStackKind(); |
731 EconomicMap<Node, Node> replacements = EconomicMap.create(); |
731 EconomicMap<Node, Node> replacements = EconomicMap.create(Equivalence.IDENTITY); |
732 for (FrameState original : inlineGraph.getNodes(FrameState.TYPE)) { |
732 for (FrameState original : inlineGraph.getNodes(FrameState.TYPE)) { |
733 FrameState frameState = (FrameState) duplicates.get(original); |
733 FrameState frameState = (FrameState) duplicates.get(original); |
734 if (frameState != null && frameState.isAlive()) { |
734 if (frameState != null && frameState.isAlive()) { |
735 if (outerFrameState == null) { |
735 if (outerFrameState == null) { |
736 outerFrameState = stateAtReturn.duplicateModifiedDuringCall(invoke.bci(), invokeReturnKind); |
736 outerFrameState = stateAtReturn.duplicateModifiedDuringCall(invoke.bci(), invokeReturnKind); |