< prev index next >

src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp

Print this page
rev 49948 : 8201593: Print array length in ArrayIndexOutOfBoundsException.
Reviewed-by: dholmes, mdoerr, smonteith


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



  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     stub_id = Runtime1::throw_index_exception_id;
  79   } else {


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




  31 #include "c1/c1_Runtime1.hpp"
  32 #include "nativeInst_aarch64.hpp"
  33 #include "runtime/sharedRuntime.hpp"
  34 #include "vmreg_aarch64.inline.hpp"
  35 
  36 
  37 #define __ ce->masm()->
  38 
  39 void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
  40   __ bind(_entry);
  41   Metadata *m = _method->as_constant_ptr()->as_metadata();
  42   __ mov_metadata(rscratch1, m);
  43   ce->store_parameter(rscratch1, 1);
  44   ce->store_parameter(_bci, 0);
  45   __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::counter_overflow_id)));
  46   ce->add_call_info_here(_info);
  47   ce->verify_oop_map(_info);
  48   __ b(_continuation);
  49 }
  50 
  51 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
  52   : _throw_index_out_of_bounds_exception(false), _index(index), _array(array) {
  53   assert(info != NULL, "must have info");
  54   _info = new CodeEmitInfo(info);
  55 }
  56 
  57 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index)
  58   : _throw_index_out_of_bounds_exception(true), _index(index), _array(NULL) {
  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(r22, _index->as_register());
  76   } else {
  77     __ mov(r22, _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     assert(_array != NULL, "sanity");
  84     __ mov(r23, _array->as_pointer_register());
  85     stub_id = Runtime1::throw_range_check_failed_id;
  86   }
  87   __ far_call(RuntimeAddress(Runtime1::entry_for(stub_id)), NULL, rscratch2);
  88   ce->add_call_info_here(_info);
  89   ce->verify_oop_map(_info);
  90   debug_only(__ should_not_reach_here());
  91 }
  92 
  93 PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) {
  94   _info = new CodeEmitInfo(info);
  95 }
  96 
  97 void PredicateFailedStub::emit_code(LIR_Assembler* ce) {
  98   __ bind(_entry);
  99   address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
 100   __ far_call(RuntimeAddress(a));
 101   ce->add_call_info_here(_info);
 102   ce->verify_oop_map(_info);
 103   debug_only(__ should_not_reach_here());
 104 }


< prev index next >