src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/MultiTypeGuardInlineInfo.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2013, 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. |
206 exceptionMerge = graph.add(new MergeNode()); |
206 exceptionMerge = graph.add(new MergeNode()); |
207 |
207 |
208 FixedNode exceptionSux = exceptionEdge.next(); |
208 FixedNode exceptionSux = exceptionEdge.next(); |
209 graph.addBeforeFixed(exceptionSux, exceptionMerge); |
209 graph.addBeforeFixed(exceptionSux, exceptionMerge); |
210 exceptionObjectPhi = graph.addWithoutUnique(new ValuePhiNode(StampFactory.forKind(JavaKind.Object), exceptionMerge)); |
210 exceptionObjectPhi = graph.addWithoutUnique(new ValuePhiNode(StampFactory.forKind(JavaKind.Object), exceptionMerge)); |
211 exceptionMerge.setStateAfter(exceptionEdge.stateAfter().duplicateModified(invoke.stateAfter().bci, true, JavaKind.Object, new JavaKind[]{JavaKind.Object}, |
211 |
212 new ValueNode[]{exceptionObjectPhi})); |
212 assert exceptionEdge.stateAfter().bci == invoke.bci(); |
|
213 assert exceptionEdge.stateAfter().rethrowException(); |
|
214 exceptionMerge.setStateAfter(exceptionEdge.stateAfter().duplicateModified(JavaKind.Object, JavaKind.Object, exceptionObjectPhi)); |
213 } |
215 } |
214 |
216 |
215 // create one separate block for each invoked method |
217 // create one separate block for each invoked method |
216 AbstractBeginNode[] successors = new AbstractBeginNode[numberOfMethods + 1]; |
218 AbstractBeginNode[] successors = new AbstractBeginNode[numberOfMethods + 1]; |
217 for (int i = 0; i < numberOfMethods; i++) { |
219 for (int i = 0; i < numberOfMethods; i++) { |
394 result.setUseForInlining(useForInlining); |
396 result.setUseForInlining(useForInlining); |
395 |
397 |
396 JavaKind kind = invoke.asNode().getStackKind(); |
398 JavaKind kind = invoke.asNode().getStackKind(); |
397 if (kind != JavaKind.Void) { |
399 if (kind != JavaKind.Void) { |
398 FrameState stateAfter = invoke.stateAfter(); |
400 FrameState stateAfter = invoke.stateAfter(); |
399 stateAfter = stateAfter.duplicate(stateAfter.bci); |
401 stateAfter = stateAfter.duplicate(); |
400 stateAfter.replaceFirstInput(invoke.asNode(), result.asNode()); |
402 stateAfter.replaceFirstInput(invoke.asNode(), result.asNode()); |
401 result.setStateAfter(stateAfter); |
403 result.setStateAfter(stateAfter); |
402 } |
404 } |
403 |
405 |
404 if (invoke instanceof InvokeWithExceptionNode) { |
406 if (invoke instanceof InvokeWithExceptionNode) { |