src/share/vm/c1/c1_LIRGenerator.cpp

changeset 9843
a6f289d66efe
parent 9842
4df47a343601
child 9852
70aa912cebe5
child 9896
1b8c45b8216a
equal deleted inserted replaced
9842:4df47a343601 9843:a6f289d66efe
537 } 537 }
538 break; 538 break;
539 539
540 case Bytecodes::_imul: 540 case Bytecodes::_imul:
541 { 541 {
542 bool did_strength_reduce = false; 542 bool did_strength_reduce = false;
543 543
544 if (right->is_constant()) { 544 if (right->is_constant()) {
545 int c = right->as_jint(); 545 jint c = right->as_jint();
546 if (is_power_of_2(c)) { 546 if (c > 0 && is_power_of_2(c)) {
547 // do not need tmp here 547 // do not need tmp here
548 __ shift_left(left_op, exact_log2(c), result_op); 548 __ shift_left(left_op, exact_log2(c), result_op);
549 did_strength_reduce = true; 549 did_strength_reduce = true;
550 } else { 550 } else {
551 did_strength_reduce = strength_reduce_multiply(left_op, c, result_op, tmp_op); 551 did_strength_reduce = strength_reduce_multiply(left_op, c, result_op, tmp_op);

mercurial