Skip to content

Commit

Permalink
x86_32 fails
Browse files Browse the repository at this point in the history
  • Loading branch information
y1yang0 committed May 8, 2021
1 parent f996c99 commit 307d7a1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/hotspot/share/c1/c1_LIRGenerator.cpp
Expand Up @@ -1880,8 +1880,15 @@ void LIRGenerator::do_PreconditionsCheckIndex(Intrinsic* x, BasicType type) {
#endif
__ branch(lir_cond_aboveEqual, deopt);
} else {
__ cmp(lir_cond_belowEqual, length.result(), index.result());
__ branch(lir_cond_belowEqual, deopt);
#if defined(X86) && !defined(_LP64)
// BEWARE! On 32-bit x86 cmp clobbers its left argument so we need a temp copy.
LIR_Opr index_copy = new_register(index.type());
__ move(index.result(), index_copy);
__ cmp(lir_cond_aboveEqual, index_copy, length.result());
#else
__ cmp(lir_cond_aboveEqual, index.result(), length.result());
#endif
__ branch(lir_cond_aboveEqual, deopt);
}
__ move(index.result(), result);
}
Expand Down

0 comments on commit 307d7a1

Please sign in to comment.