hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
changeset 37480 291ee208fb72
parent 37291 f13632a2a389
child 38060 954c9575f653
equal deleted inserted replaced
37479:14a195eaf2c5 37480:291ee208fb72
  3678       case lir_membar_storeload : __ membar_storeload(); break;
  3678       case lir_membar_storeload : __ membar_storeload(); break;
  3679       default                   : ShouldNotReachHere(); break;
  3679       default                   : ShouldNotReachHere(); break;
  3680     }
  3680     }
  3681   }
  3681   }
  3682 }
  3682 }
       
  3683 
       
  3684 LIR_Opr LIRGenerator::maybe_mask_boolean(StoreIndexed* x, LIR_Opr array, LIR_Opr value, CodeEmitInfo*& null_check_info) {
       
  3685   if (x->check_boolean()) {
       
  3686     LIR_Opr value_fixed = rlock_byte(T_BYTE);
       
  3687     if (TwoOperandLIRForm) {
       
  3688       __ move(value, value_fixed);
       
  3689       __ logical_and(value_fixed, LIR_OprFact::intConst(1), value_fixed);
       
  3690     } else {
       
  3691       __ logical_and(value, LIR_OprFact::intConst(1), value_fixed);
       
  3692     }
       
  3693     LIR_Opr klass = new_register(T_METADATA);
       
  3694     __ move(new LIR_Address(array, oopDesc::klass_offset_in_bytes(), T_ADDRESS), klass, null_check_info);
       
  3695     null_check_info = NULL;
       
  3696     LIR_Opr layout = new_register(T_INT);
       
  3697     __ move(new LIR_Address(klass, in_bytes(Klass::layout_helper_offset()), T_INT), layout);
       
  3698     int diffbit = Klass::layout_helper_boolean_diffbit();
       
  3699     __ logical_and(layout, LIR_OprFact::intConst(diffbit), layout);
       
  3700     __ cmp(lir_cond_notEqual, layout, LIR_OprFact::intConst(0));
       
  3701     __ cmove(lir_cond_notEqual, value_fixed, value, value_fixed, T_BYTE);
       
  3702     value = value_fixed;
       
  3703   }
       
  3704   return value;
       
  3705 }