< prev index next >

src/hotspot/cpu/sparc/c1_CodeStubs_sparc.cpp

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


  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(false), _index(index), _array(array) {



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


< prev index next >