Skip to content

Commit fdfdf80

Browse files
committed
Adapt JDK-8323497: On x64, use 32-bit immediate moves for narrow klass base if possible
1 parent 7b61bb2 commit fdfdf80

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/schedule/SchedulePhase.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -735,16 +735,12 @@ protected static boolean isImplicitNullOpportunity(Node currentNode, HIRBlock bl
735735
if (!supportsImplicitNullChecks) {
736736
return false;
737737
}
738-
if (currentNode instanceof FloatingReadNode) {
739-
FloatingReadNode floatingReadNode = (FloatingReadNode) currentNode;
738+
if (currentNode instanceof FloatingReadNode floatingReadNode) {
740739
Node pred = block.getBeginNode().predecessor();
741-
if (pred instanceof IfNode) {
742-
IfNode ifNode = (IfNode) pred;
743-
if (ifNode.condition() instanceof IsNullNode && ifNode.getTrueSuccessorProbability() == 0.0) {
744-
IsNullNode isNullNode = (IsNullNode) ifNode.condition();
745-
if (getUnproxifiedUncompressed(floatingReadNode.getAddress().getBase()) == getUnproxifiedUncompressed(isNullNode.getValue())) {
746-
return true;
747-
}
740+
if (pred instanceof IfNode ifNode) {
741+
if (ifNode.condition() instanceof IsNullNode isNullNode && ifNode.getTrueSuccessorProbability() == 0.0) {
742+
ValueNode base = floatingReadNode.getAddress().getBase();
743+
return base != null && getUnproxifiedUncompressed(base) == getUnproxifiedUncompressed(isNullNode.getValue());
748744
}
749745
}
750746
}

0 commit comments

Comments
 (0)