< prev index next >

src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp

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


  34 #include "vmreg_aarch64.inline.hpp"
  35 #if INCLUDE_ALL_GCS
  36 #include "gc/g1/g1BarrierSet.hpp"
  37 #endif
  38 
  39 
  40 #define __ ce->masm()->
  41 
  42 void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
  43   __ bind(_entry);
  44   Metadata *m = _method->as_constant_ptr()->as_metadata();
  45   __ mov_metadata(rscratch1, m);
  46   ce->store_parameter(rscratch1, 1);
  47   ce->store_parameter(_bci, 0);
  48   __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::counter_overflow_id)));
  49   ce->add_call_info_here(_info);
  50   ce->verify_oop_map(_info);
  51   __ b(_continuation);
  52 }
  53 
  54 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index,
  55                                bool throw_index_out_of_bounds_exception)
  56   : _throw_index_out_of_bounds_exception(throw_index_out_of_bounds_exception)
  57   , _index(index)
  58 {
  59   assert(info != NULL, "must have info");
  60   _info = new CodeEmitInfo(info);
  61 }
  62 
  63 void RangeCheckStub::emit_code(LIR_Assembler* ce) {
  64   __ bind(_entry);
  65   if (_info->deoptimize_on_exception()) {
  66     address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
  67     __ far_call(RuntimeAddress(a));
  68     ce->add_call_info_here(_info);
  69     ce->verify_oop_map(_info);
  70     debug_only(__ should_not_reach_here());
  71     return;
  72   }
  73 
  74   if (_index->is_cpu_register()) {
  75     __ mov(rscratch1, _index->as_register());
  76   } else {
  77     __ mov(rscratch1, _index->as_jint());
  78   }
  79   Runtime1::StubID stub_id;
  80   if (_throw_index_out_of_bounds_exception) {


  81     stub_id = Runtime1::throw_index_exception_id;
  82   } else {
  83     stub_id = Runtime1::throw_range_check_failed_id;
  84   }
  85   __ far_call(RuntimeAddress(Runtime1::entry_for(stub_id)), NULL, rscratch2);
  86   ce->add_call_info_here(_info);
  87   ce->verify_oop_map(_info);
  88   debug_only(__ should_not_reach_here());
  89 }
  90 
  91 PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) {
  92   _info = new CodeEmitInfo(info);
  93 }
  94 
  95 void PredicateFailedStub::emit_code(LIR_Assembler* ce) {
  96   __ bind(_entry);
  97   address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
  98   __ far_call(RuntimeAddress(a));
  99   ce->add_call_info_here(_info);
 100   ce->verify_oop_map(_info);




  34 #include "vmreg_aarch64.inline.hpp"
  35 #if INCLUDE_ALL_GCS
  36 #include "gc/g1/g1BarrierSet.hpp"
  37 #endif
  38 
  39 
  40 #define __ ce->masm()->
  41 
  42 void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
  43   __ bind(_entry);
  44   Metadata *m = _method->as_constant_ptr()->as_metadata();
  45   __ mov_metadata(rscratch1, m);
  46   ce->store_parameter(rscratch1, 1);
  47   ce->store_parameter(_bci, 0);
  48   __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::counter_overflow_id)));
  49   ce->add_call_info_here(_info);
  50   ce->verify_oop_map(_info);
  51   __ b(_continuation);
  52 }
  53 
  54 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
  55   : _throw_index_out_of_bounds_exception(array == NULL), _index(index), _array(array) {



  56   assert(info != NULL, "must have info");
  57   _info = new CodeEmitInfo(info);
  58 }
  59 
  60 void RangeCheckStub::emit_code(LIR_Assembler* ce) {
  61   __ bind(_entry);
  62   if (_info->deoptimize_on_exception()) {
  63     address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
  64     __ far_call(RuntimeAddress(a));
  65     ce->add_call_info_here(_info);
  66     ce->verify_oop_map(_info);
  67     debug_only(__ should_not_reach_here());
  68     return;
  69   }
  70 
  71   if (_index->is_cpu_register()) {
  72     __ mov(rscratch1, _index->as_register());
  73   } else {
  74     __ mov(rscratch1, _index->as_jint());
  75   }
  76   Runtime1::StubID stub_id;
  77   if (_throw_index_out_of_bounds_exception) {
  78     assert(_array != NULL, "sanity");
  79     __ mov(rscratch2, _array->as_pointer_register());
  80     stub_id = Runtime1::throw_index_exception_id;
  81   } else {
  82     stub_id = Runtime1::throw_range_check_failed_id;
  83   }
  84   __ far_call(RuntimeAddress(Runtime1::entry_for(stub_id)), NULL, rscratch2);
  85   ce->add_call_info_here(_info);
  86   ce->verify_oop_map(_info);
  87   debug_only(__ should_not_reach_here());
  88 }
  89 
  90 PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) {
  91   _info = new CodeEmitInfo(info);
  92 }
  93 
  94 void PredicateFailedStub::emit_code(LIR_Assembler* ce) {
  95   __ bind(_entry);
  96   address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
  97   __ far_call(RuntimeAddress(a));
  98   ce->add_call_info_here(_info);
  99   ce->verify_oop_map(_info);


< prev index next >