< prev index next >

src/hotspot/cpu/sparc/c1_CodeStubs_sparc.cpp

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


  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "c1/c1_CodeStubs.hpp"
  27 #include "c1/c1_FrameMap.hpp"
  28 #include "c1/c1_LIRAssembler.hpp"
  29 #include "c1/c1_MacroAssembler.hpp"
  30 #include "c1/c1_Runtime1.hpp"
  31 #include "nativeInst_sparc.hpp"
  32 #include "runtime/sharedRuntime.hpp"
  33 #include "utilities/macros.hpp"
  34 #include "vmreg_sparc.inline.hpp"
  35 #if INCLUDE_ALL_GCS
  36 #include "gc/g1/g1BarrierSet.hpp"
  37 #endif // INCLUDE_ALL_GCS
  38 
  39 #define __ ce->masm()->
  40 
  41 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index,
  42                                bool throw_index_out_of_bounds_exception)
  43   : _throw_index_out_of_bounds_exception(throw_index_out_of_bounds_exception)
  44   , _index(index)
  45 {
  46   assert(info != NULL, "must have info");
  47   _info = new CodeEmitInfo(info);
  48 }
  49 
  50 
  51 void RangeCheckStub::emit_code(LIR_Assembler* ce) {
  52   __ bind(_entry);
  53 
  54   if (_info->deoptimize_on_exception()) {
  55     address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
  56     __ call(a, relocInfo::runtime_call_type);
  57     __ delayed()->nop();
  58     ce->add_call_info_here(_info);
  59     ce->verify_oop_map(_info);
  60     debug_only(__ should_not_reach_here());
  61     return;
  62   }
  63 
  64   if (_index->is_register()) {
  65     __ mov(_index->as_register(), G4);
  66   } else {
  67     __ set(_index->as_jint(), G4);
  68   }
  69   if (_throw_index_out_of_bounds_exception) {
  70     __ call(Runtime1::entry_for(Runtime1::throw_index_exception_id), relocInfo::runtime_call_type);
  71   } else {

  72     __ call(Runtime1::entry_for(Runtime1::throw_range_check_failed_id), relocInfo::runtime_call_type);
  73   }
  74   __ delayed()->nop();
  75   ce->add_call_info_here(_info);
  76   ce->verify_oop_map(_info);
  77   debug_only(__ should_not_reach_here());
  78 }
  79 
  80 PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) {
  81   _info = new CodeEmitInfo(info);
  82 }
  83 
  84 void PredicateFailedStub::emit_code(LIR_Assembler* ce) {
  85   __ bind(_entry);
  86   address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
  87   __ call(a, relocInfo::runtime_call_type);
  88   __ delayed()->nop();
  89   ce->add_call_info_here(_info);
  90   ce->verify_oop_map(_info);
  91   debug_only(__ should_not_reach_here());




  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "c1/c1_CodeStubs.hpp"
  27 #include "c1/c1_FrameMap.hpp"
  28 #include "c1/c1_LIRAssembler.hpp"
  29 #include "c1/c1_MacroAssembler.hpp"
  30 #include "c1/c1_Runtime1.hpp"
  31 #include "nativeInst_sparc.hpp"
  32 #include "runtime/sharedRuntime.hpp"
  33 #include "utilities/macros.hpp"
  34 #include "vmreg_sparc.inline.hpp"
  35 #if INCLUDE_ALL_GCS
  36 #include "gc/g1/g1BarrierSet.hpp"
  37 #endif // INCLUDE_ALL_GCS
  38 
  39 #define __ ce->masm()->
  40 
  41 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
  42   : _throw_index_out_of_bounds_exception(array == NULL), _index(index), _array(array) {



  43   assert(info != NULL, "must have info");
  44   _info = new CodeEmitInfo(info);
  45 }
  46 
  47 
  48 void RangeCheckStub::emit_code(LIR_Assembler* ce) {
  49   __ bind(_entry);
  50 
  51   if (_info->deoptimize_on_exception()) {
  52     address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
  53     __ call(a, relocInfo::runtime_call_type);
  54     __ delayed()->nop();
  55     ce->add_call_info_here(_info);
  56     ce->verify_oop_map(_info);
  57     debug_only(__ should_not_reach_here());
  58     return;
  59   }
  60 
  61   if (_index->is_register()) {
  62     __ mov(_index->as_register(), G4);
  63   } else {
  64     __ set(_index->as_jint(), G4);
  65   }
  66   if (_throw_index_out_of_bounds_exception) {
  67     __ call(Runtime1::entry_for(Runtime1::throw_index_exception_id), relocInfo::runtime_call_type);
  68   } else {
  69     __ mov(_array->as_pointer_register(), G5);
  70     __ call(Runtime1::entry_for(Runtime1::throw_range_check_failed_id), relocInfo::runtime_call_type);
  71   }
  72   __ delayed()->nop();
  73   ce->add_call_info_here(_info);
  74   ce->verify_oop_map(_info);
  75   debug_only(__ should_not_reach_here());
  76 }
  77 
  78 PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) {
  79   _info = new CodeEmitInfo(info);
  80 }
  81 
  82 void PredicateFailedStub::emit_code(LIR_Assembler* ce) {
  83   __ bind(_entry);
  84   address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
  85   __ call(a, relocInfo::runtime_call_type);
  86   __ delayed()->nop();
  87   ce->add_call_info_here(_info);
  88   ce->verify_oop_map(_info);
  89   debug_only(__ should_not_reach_here());


< prev index next >