< prev index next >
src/share/vm/c1/c1_LIRGenerator.cpp
Print this page
@@ -546,12 +546,12 @@
case Bytecodes::_imul:
{
bool did_strength_reduce = false;
if (right->is_constant()) {
- int c = right->as_jint();
- if (is_power_of_2(c)) {
+ jint c = right->as_jint();
+ if (c > 0 && is_power_of_2(c)) {
// do not need tmp here
__ shift_left(left_op, exact_log2(c), result_op);
did_strength_reduce = true;
} else {
did_strength_reduce = strength_reduce_multiply(left_op, c, result_op, tmp_op);
< prev index next >