src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp
changeset 50094 2f79462aab9b
parent 49906 4bb58f644e4e
child 50380 bec342339138
equal deleted inserted replaced
50093:55153a374d18 50094:2f79462aab9b
    46   ce->add_call_info_here(_info);
    46   ce->add_call_info_here(_info);
    47   ce->verify_oop_map(_info);
    47   ce->verify_oop_map(_info);
    48   __ b(_continuation);
    48   __ b(_continuation);
    49 }
    49 }
    50 
    50 
    51 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index,
    51 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
    52                                bool throw_index_out_of_bounds_exception)
    52   : _throw_index_out_of_bounds_exception(false), _index(index), _array(array) {
    53   : _throw_index_out_of_bounds_exception(throw_index_out_of_bounds_exception)
    53   assert(info != NULL, "must have info");
    54   , _index(index)
    54   _info = new CodeEmitInfo(info);
    55 {
    55 }
       
    56 
       
    57 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index)
       
    58   : _throw_index_out_of_bounds_exception(true), _index(index), _array(NULL) {
    56   assert(info != NULL, "must have info");
    59   assert(info != NULL, "must have info");
    57   _info = new CodeEmitInfo(info);
    60   _info = new CodeEmitInfo(info);
    58 }
    61 }
    59 
    62 
    60 void RangeCheckStub::emit_code(LIR_Assembler* ce) {
    63 void RangeCheckStub::emit_code(LIR_Assembler* ce) {
    67     debug_only(__ should_not_reach_here());
    70     debug_only(__ should_not_reach_here());
    68     return;
    71     return;
    69   }
    72   }
    70 
    73 
    71   if (_index->is_cpu_register()) {
    74   if (_index->is_cpu_register()) {
    72     __ mov(rscratch1, _index->as_register());
    75     __ mov(r22, _index->as_register());
    73   } else {
    76   } else {
    74     __ mov(rscratch1, _index->as_jint());
    77     __ mov(r22, _index->as_jint());
    75   }
    78   }
    76   Runtime1::StubID stub_id;
    79   Runtime1::StubID stub_id;
    77   if (_throw_index_out_of_bounds_exception) {
    80   if (_throw_index_out_of_bounds_exception) {
    78     stub_id = Runtime1::throw_index_exception_id;
    81     stub_id = Runtime1::throw_index_exception_id;
    79   } else {
    82   } else {
       
    83     assert(_array != NULL, "sanity");
       
    84     __ mov(r23, _array->as_pointer_register());
    80     stub_id = Runtime1::throw_range_check_failed_id;
    85     stub_id = Runtime1::throw_range_check_failed_id;
    81   }
    86   }
    82   __ far_call(RuntimeAddress(Runtime1::entry_for(stub_id)), NULL, rscratch2);
    87   __ far_call(RuntimeAddress(Runtime1::entry_for(stub_id)), NULL, rscratch2);
    83   ce->add_call_info_here(_info);
    88   ce->add_call_info_here(_info);
    84   ce->verify_oop_map(_info);
    89   ce->verify_oop_map(_info);