< prev index next >

src/hotspot/cpu/sparc/c1_LIRGenerator_sparc.cpp

Print this page
rev 49800 : 8201593: Print array length in ArrayIndexOutOfBoundsException.


 343     value.load_for_store(x->elt_type());
 344   }
 345 
 346   set_no_result(x);
 347 
 348   // the CodeEmitInfo must be duplicated for each different
 349   // LIR-instruction because spilling can occur anywhere between two
 350   // instructions and so the debug information must be different
 351   CodeEmitInfo* range_check_info = state_for(x);
 352   CodeEmitInfo* null_check_info = NULL;
 353   if (x->needs_null_check()) {
 354     null_check_info = new CodeEmitInfo(range_check_info);
 355   }
 356 
 357   // emit array address setup early so it schedules better
 358   LIR_Address* array_addr = emit_array_address(array.result(), index.result(), x->elt_type(), obj_store);
 359 
 360   if (GenerateRangeChecks && needs_range_check) {
 361     if (use_length) {
 362       __ cmp(lir_cond_belowEqual, length.result(), index.result());
 363       __ branch(lir_cond_belowEqual, T_INT, new RangeCheckStub(range_check_info, index.result()));
 364     } else {
 365       array_range_check(array.result(), index.result(), null_check_info, range_check_info);
 366       // range_check also does the null check
 367       null_check_info = NULL;
 368     }
 369   }
 370 
 371   if (GenerateArrayStoreCheck && needs_store_check) {
 372     LIR_Opr tmp1 = FrameMap::G1_opr;
 373     LIR_Opr tmp2 = FrameMap::G3_opr;
 374     LIR_Opr tmp3 = FrameMap::G5_opr;
 375 
 376     CodeEmitInfo* store_check_info = new CodeEmitInfo(range_check_info);
 377     __ store_check(value.result(), array.result(), tmp1, tmp2, tmp3, store_check_info, x->profiled_method(), x->profiled_bci());
 378   }
 379 
 380   if (obj_store) {
 381     // Needs GC write barriers.
 382     pre_barrier(LIR_OprFact::address(array_addr), LIR_OprFact::illegalOpr /* pre_val */,
 383                 true /* do_load */, false /* patch */, NULL);




 343     value.load_for_store(x->elt_type());
 344   }
 345 
 346   set_no_result(x);
 347 
 348   // the CodeEmitInfo must be duplicated for each different
 349   // LIR-instruction because spilling can occur anywhere between two
 350   // instructions and so the debug information must be different
 351   CodeEmitInfo* range_check_info = state_for(x);
 352   CodeEmitInfo* null_check_info = NULL;
 353   if (x->needs_null_check()) {
 354     null_check_info = new CodeEmitInfo(range_check_info);
 355   }
 356 
 357   // emit array address setup early so it schedules better
 358   LIR_Address* array_addr = emit_array_address(array.result(), index.result(), x->elt_type(), obj_store);
 359 
 360   if (GenerateRangeChecks && needs_range_check) {
 361     if (use_length) {
 362       __ cmp(lir_cond_belowEqual, length.result(), index.result());
 363       __ branch(lir_cond_belowEqual, T_INT, new RangeCheckStub(range_check_info, index.result(), array.result()));
 364     } else {
 365       array_range_check(array.result(), index.result(), null_check_info, range_check_info);
 366       // range_check also does the null check
 367       null_check_info = NULL;
 368     }
 369   }
 370 
 371   if (GenerateArrayStoreCheck && needs_store_check) {
 372     LIR_Opr tmp1 = FrameMap::G1_opr;
 373     LIR_Opr tmp2 = FrameMap::G3_opr;
 374     LIR_Opr tmp3 = FrameMap::G5_opr;
 375 
 376     CodeEmitInfo* store_check_info = new CodeEmitInfo(range_check_info);
 377     __ store_check(value.result(), array.result(), tmp1, tmp2, tmp3, store_check_info, x->profiled_method(), x->profiled_bci());
 378   }
 379 
 380   if (obj_store) {
 381     // Needs GC write barriers.
 382     pre_barrier(LIR_OprFact::address(array_addr), LIR_OprFact::illegalOpr /* pre_val */,
 383                 true /* do_load */, false /* patch */, NULL);


< prev index next >