hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp
changeset 16611 6807a703dd6b
parent 13886 8d82c4dfa722
child 18507 61bfc8995bb3
equal deleted inserted replaced
16381:806d87cb0cc7 16611:6807a703dd6b
   322 //----------------------------------------------------------------------
   322 //----------------------------------------------------------------------
   323 
   323 
   324 
   324 
   325 void LIRGenerator::do_StoreIndexed(StoreIndexed* x) {
   325 void LIRGenerator::do_StoreIndexed(StoreIndexed* x) {
   326   assert(x->is_pinned(),"");
   326   assert(x->is_pinned(),"");
   327   bool needs_range_check = true;
   327   bool needs_range_check = x->compute_needs_range_check();
   328   bool use_length = x->length() != NULL;
   328   bool use_length = x->length() != NULL;
   329   bool obj_store = x->elt_type() == T_ARRAY || x->elt_type() == T_OBJECT;
   329   bool obj_store = x->elt_type() == T_ARRAY || x->elt_type() == T_OBJECT;
   330   bool needs_store_check = obj_store && (x->value()->as_Constant() == NULL ||
   330   bool needs_store_check = obj_store && (x->value()->as_Constant() == NULL ||
   331                                          !get_jobject_constant(x->value())->is_null_object() ||
   331                                          !get_jobject_constant(x->value())->is_null_object() ||
   332                                          x->should_profile());
   332                                          x->should_profile());
   337   LIRItem length(this);
   337   LIRItem length(this);
   338 
   338 
   339   array.load_item();
   339   array.load_item();
   340   index.load_nonconstant();
   340   index.load_nonconstant();
   341 
   341 
   342   if (use_length) {
   342   if (use_length && needs_range_check) {
   343     needs_range_check = x->compute_needs_range_check();
   343     length.set_instruction(x->length());
   344     if (needs_range_check) {
   344     length.load_item();
   345       length.set_instruction(x->length());
       
   346       length.load_item();
       
   347     }
       
   348   }
   345   }
   349   if (needs_store_check) {
   346   if (needs_store_check) {
   350     value.load_item();
   347     value.load_item();
   351   } else {
   348   } else {
   352     value.load_for_store(x->elt_type());
   349     value.load_for_store(x->elt_type());