Skip to content

Commit 1d9b076

Browse files
committed
Optimize returned parameter only when all possible callees are visible.
1 parent 0e944fc commit 1d9b076

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/results/StrengthenGraphs.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,8 @@ private void handleInvoke(Invoke invoke, SimplifierTool tool) {
739739
}
740740
}
741741

742-
if (allowOptimizeReturnParameter) {
742+
if (allowOptimizeReturnParameter && (isClosedTypeWorld || callTarget.invokeKind().isDirect() || targetMethod.canBeStaticallyBound())) {
743+
/* Can only optimize returned parameter when all possible callees are visible. */
743744
optimizeReturnedParameter(callees, arguments, node, tool);
744745
}
745746

0 commit comments

Comments
 (0)