--- a/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp Sat Jun 17 11:50:50 2017 -0700
+++ b/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp Tue Jun 20 14:37:25 2017 +0300
@@ -598,12 +598,12 @@
} else {
assert (x->op() == Bytecodes::_imul, "expect imul");
if (right.is_constant()) {
- int c = right.get_jint_constant();
- if (! is_power_of_2(c) && ! is_power_of_2(c + 1) && ! is_power_of_2(c - 1)) {
+ jint c = right.get_jint_constant();
+ if (c > 0 && c < max_jint && (is_power_of_2(c) || is_power_of_2(c - 1) || is_power_of_2(c + 1))) {
+ right_arg->dont_load_item();
+ } else {
// Cannot use constant op.
- right.load_item();
- } else {
- right.dont_load_item();
+ right_arg->load_item();
}
} else {
right.load_item();