< prev index next >

src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp

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


 286     value.load_for_store(x->elt_type());
 287   }
 288 
 289   set_no_result(x);
 290 
 291   // the CodeEmitInfo must be duplicated for each different
 292   // LIR-instruction because spilling can occur anywhere between two
 293   // instructions and so the debug information must be different
 294   CodeEmitInfo* range_check_info = state_for(x);
 295   CodeEmitInfo* null_check_info = NULL;
 296   if (x->needs_null_check()) {
 297     null_check_info = new CodeEmitInfo(range_check_info);
 298   }
 299 
 300   // emit array address setup early so it schedules better
 301   LIR_Address* array_addr = emit_array_address(array.result(), index.result(), x->elt_type(), obj_store);
 302 
 303   if (GenerateRangeChecks && needs_range_check) {
 304     if (use_length) {
 305       __ cmp(lir_cond_belowEqual, length.result(), index.result());
 306       __ branch(lir_cond_belowEqual, T_INT, new RangeCheckStub(range_check_info, index.result()));
 307     } else {
 308       array_range_check(array.result(), index.result(), null_check_info, range_check_info);
 309       // range_check also does the null check
 310       null_check_info = NULL;
 311     }
 312   }
 313 
 314   if (GenerateArrayStoreCheck && needs_store_check) {
 315     LIR_Opr tmp1 = new_register(objectType);
 316     LIR_Opr tmp2 = new_register(objectType);
 317     LIR_Opr tmp3 = new_register(objectType);
 318 
 319     CodeEmitInfo* store_check_info = new CodeEmitInfo(range_check_info);
 320     __ store_check(value.result(), array.result(), tmp1, tmp2, tmp3, store_check_info, x->profiled_method(), x->profiled_bci());
 321   }
 322 
 323   if (obj_store) {
 324     // Needs GC write barriers.
 325     pre_barrier(LIR_OprFact::address(array_addr), LIR_OprFact::illegalOpr /* pre_val */,
 326                 true /* do_load */, false /* patch */, NULL);




 286     value.load_for_store(x->elt_type());
 287   }
 288 
 289   set_no_result(x);
 290 
 291   // the CodeEmitInfo must be duplicated for each different
 292   // LIR-instruction because spilling can occur anywhere between two
 293   // instructions and so the debug information must be different
 294   CodeEmitInfo* range_check_info = state_for(x);
 295   CodeEmitInfo* null_check_info = NULL;
 296   if (x->needs_null_check()) {
 297     null_check_info = new CodeEmitInfo(range_check_info);
 298   }
 299 
 300   // emit array address setup early so it schedules better
 301   LIR_Address* array_addr = emit_array_address(array.result(), index.result(), x->elt_type(), obj_store);
 302 
 303   if (GenerateRangeChecks && needs_range_check) {
 304     if (use_length) {
 305       __ cmp(lir_cond_belowEqual, length.result(), index.result());
 306       __ branch(lir_cond_belowEqual, T_INT, new RangeCheckStub(range_check_info, index.result(), array.result()));
 307     } else {
 308       array_range_check(array.result(), index.result(), null_check_info, range_check_info);
 309       // range_check also does the null check
 310       null_check_info = NULL;
 311     }
 312   }
 313 
 314   if (GenerateArrayStoreCheck && needs_store_check) {
 315     LIR_Opr tmp1 = new_register(objectType);
 316     LIR_Opr tmp2 = new_register(objectType);
 317     LIR_Opr tmp3 = new_register(objectType);
 318 
 319     CodeEmitInfo* store_check_info = new CodeEmitInfo(range_check_info);
 320     __ store_check(value.result(), array.result(), tmp1, tmp2, tmp3, store_check_info, x->profiled_method(), x->profiled_bci());
 321   }
 322 
 323   if (obj_store) {
 324     // Needs GC write barriers.
 325     pre_barrier(LIR_OprFact::address(array_addr), LIR_OprFact::illegalOpr /* pre_val */,
 326                 true /* do_load */, false /* patch */, NULL);


< prev index next >