< prev index next >

src/hotspot/cpu/arm/c1_CodeStubs_arm.cpp

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


  36 #if INCLUDE_ALL_GCS
  37 #include "gc/g1/g1BarrierSet.hpp"
  38 #endif // INCLUDE_ALL_GCS
  39 
  40 #define __ ce->masm()->
  41 
  42 void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
  43   __ bind(_entry);
  44   ce->store_parameter(_bci, 0);
  45   ce->store_parameter(_method->as_constant_ptr()->as_metadata(), 1);
  46   __ call(Runtime1::entry_for(Runtime1::counter_overflow_id), relocInfo::runtime_call_type);
  47   ce->add_call_info_here(_info);
  48   ce->verify_oop_map(_info);
  49 
  50   __ b(_continuation);
  51 }
  52 
  53 
  54 // TODO: ARM - is it possible to inline these stubs into the main code stream?
  55 
  56 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index,
  57                                bool throw_index_out_of_bounds_exception)
  58   : _throw_index_out_of_bounds_exception(throw_index_out_of_bounds_exception)
  59   , _index(index)
  60 {
  61   _info = info == NULL ? NULL : new CodeEmitInfo(info);
  62 }
  63 
  64 
  65 void RangeCheckStub::emit_code(LIR_Assembler* ce) {
  66   __ bind(_entry);
  67 
  68   if (_info->deoptimize_on_exception()) {
  69 #ifdef AARCH64
  70     __ NOT_TESTED();
  71 #endif
  72     __ call(Runtime1::entry_for(Runtime1::predicate_failed_trap_id), relocInfo::runtime_call_type);
  73     ce->add_call_info_here(_info);
  74     ce->verify_oop_map(_info);
  75     debug_only(__ should_not_reach_here());
  76     return;
  77   }
  78   // Pass the array index on stack because all registers must be preserved
  79   ce->verify_reserved_argument_area_size(1);
  80   if (_index->is_cpu_register()) {
  81     __ str_32(_index->as_register(), Address(SP));
  82   } else {
  83     __ mov_slow(Rtemp, _index->as_jint()); // Rtemp should be OK in C1
  84     __ str_32(Rtemp, Address(SP));
  85   }


  86 
  87   if (_throw_index_out_of_bounds_exception) {
  88 #ifdef AARCH64
  89     __ NOT_TESTED();
  90 #endif
  91     __ call(Runtime1::entry_for(Runtime1::throw_index_exception_id), relocInfo::runtime_call_type);
  92   } else {
  93     __ call(Runtime1::entry_for(Runtime1::throw_range_check_failed_id), relocInfo::runtime_call_type);
  94   }
  95   ce->add_call_info_here(_info);
  96   ce->verify_oop_map(_info);
  97   DEBUG_ONLY(STOP("RangeCheck");)
  98 }
  99 
 100 PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) {
 101   _info = new CodeEmitInfo(info);
 102 }
 103 
 104 void PredicateFailedStub::emit_code(LIR_Assembler* ce) {
 105   __ bind(_entry);




  36 #if INCLUDE_ALL_GCS
  37 #include "gc/g1/g1BarrierSet.hpp"
  38 #endif // INCLUDE_ALL_GCS
  39 
  40 #define __ ce->masm()->
  41 
  42 void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
  43   __ bind(_entry);
  44   ce->store_parameter(_bci, 0);
  45   ce->store_parameter(_method->as_constant_ptr()->as_metadata(), 1);
  46   __ call(Runtime1::entry_for(Runtime1::counter_overflow_id), relocInfo::runtime_call_type);
  47   ce->add_call_info_here(_info);
  48   ce->verify_oop_map(_info);
  49 
  50   __ b(_continuation);
  51 }
  52 
  53 
  54 // TODO: ARM - is it possible to inline these stubs into the main code stream?
  55 
  56 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
  57   : _throw_index_out_of_bounds_exception(array == NULL), _index(index), _array(array) {



  58   _info = info == NULL ? NULL : new CodeEmitInfo(info);
  59 }
  60 
  61 
  62 void RangeCheckStub::emit_code(LIR_Assembler* ce) {
  63   __ bind(_entry);
  64 
  65   if (_info->deoptimize_on_exception()) {
  66 #ifdef AARCH64
  67     __ NOT_TESTED();
  68 #endif
  69     __ call(Runtime1::entry_for(Runtime1::predicate_failed_trap_id), relocInfo::runtime_call_type);
  70     ce->add_call_info_here(_info);
  71     ce->verify_oop_map(_info);
  72     debug_only(__ should_not_reach_here());
  73     return;
  74   }
  75   // Pass the array index on stack because all registers must be preserved
  76   ce->verify_reserved_argument_area_size(1);
  77   if (_index->is_cpu_register()) {
  78     __ str_32(_index->as_register(), Address(SP));
  79   } else {
  80     __ mov_slow(Rtemp, _index->as_jint()); // Rtemp should be OK in C1
  81     __ str_32(Rtemp, Address(SP));
  82   }
  83   __ mov_slow(Rtemp, _array->as_pointer_register());
  84   __ str(Rtemp, Address(SP, BytesPerWord)); // ??? Correct offset? Correct instruction?
  85 
  86   if (_throw_index_out_of_bounds_exception) {
  87 #ifdef AARCH64
  88     __ NOT_TESTED();
  89 #endif
  90     __ call(Runtime1::entry_for(Runtime1::throw_index_exception_id), relocInfo::runtime_call_type);
  91   } else {
  92     __ call(Runtime1::entry_for(Runtime1::throw_range_check_failed_id), relocInfo::runtime_call_type);
  93   }
  94   ce->add_call_info_here(_info);
  95   ce->verify_oop_map(_info);
  96   DEBUG_ONLY(STOP("RangeCheck");)
  97 }
  98 
  99 PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) {
 100   _info = new CodeEmitInfo(info);
 101 }
 102 
 103 void PredicateFailedStub::emit_code(LIR_Assembler* ce) {
 104   __ bind(_entry);


< prev index next >