< prev index next >

src/hotspot/cpu/s390/c1_CodeStubs_s390.cpp

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


  25 
  26 #include "precompiled.hpp"
  27 #include "c1/c1_CodeStubs.hpp"
  28 #include "c1/c1_FrameMap.hpp"
  29 #include "c1/c1_LIRAssembler.hpp"
  30 #include "c1/c1_MacroAssembler.hpp"
  31 #include "c1/c1_Runtime1.hpp"
  32 #include "nativeInst_s390.hpp"
  33 #include "runtime/sharedRuntime.hpp"
  34 #include "utilities/align.hpp"
  35 #include "utilities/macros.hpp"
  36 #include "vmreg_s390.inline.hpp"
  37 #if INCLUDE_ALL_GCS
  38 #include "gc/g1/g1BarrierSet.hpp"
  39 #endif // INCLUDE_ALL_GCS
  40 
  41 #define __ ce->masm()->
  42 #undef  CHECK_BAILOUT
  43 #define CHECK_BAILOUT() { if (ce->compilation()->bailed_out()) return; }
  44 
  45 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index,
  46                                bool throw_index_out_of_bounds_exception) :
  47   _throw_index_out_of_bounds_exception(throw_index_out_of_bounds_exception),
  48   _index(index) {
  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   if (_info->deoptimize_on_exception()) {
  56     address a = Runtime1::entry_for (Runtime1::predicate_failed_trap_id);
  57     ce->emit_call_c(a);
  58     CHECK_BAILOUT();
  59     ce->add_call_info_here(_info);
  60     ce->verify_oop_map(_info);
  61     debug_only(__ should_not_reach_here());
  62     return;
  63   }
  64 
  65   // Pass the array index in Z_R1_scratch which is not managed by linear scan.
  66   if (_index->is_cpu_register()) {
  67     __ lgr_if_needed(Z_R1_scratch, _index->as_register());
  68   } else {
  69     __ load_const_optimized(Z_R1_scratch, _index->as_jint());
  70   }
  71 
  72   Runtime1::StubID stub_id;
  73   if (_throw_index_out_of_bounds_exception) {
  74     stub_id = Runtime1::throw_index_exception_id;
  75   } else {
  76     stub_id = Runtime1::throw_range_check_failed_id;

  77   }
  78   ce->emit_call_c(Runtime1::entry_for (stub_id));
  79   CHECK_BAILOUT();
  80   ce->add_call_info_here(_info);
  81   ce->verify_oop_map(_info);
  82   debug_only(__ should_not_reach_here());
  83 }
  84 
  85 PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) {
  86   _info = new CodeEmitInfo(info);
  87 }
  88 
  89 void PredicateFailedStub::emit_code(LIR_Assembler* ce) {
  90   __ bind(_entry);
  91   address a = Runtime1::entry_for (Runtime1::predicate_failed_trap_id);
  92   ce->emit_call_c(a);
  93   CHECK_BAILOUT();
  94   ce->add_call_info_here(_info);
  95   ce->verify_oop_map(_info);
  96   debug_only(__ should_not_reach_here());




  25 
  26 #include "precompiled.hpp"
  27 #include "c1/c1_CodeStubs.hpp"
  28 #include "c1/c1_FrameMap.hpp"
  29 #include "c1/c1_LIRAssembler.hpp"
  30 #include "c1/c1_MacroAssembler.hpp"
  31 #include "c1/c1_Runtime1.hpp"
  32 #include "nativeInst_s390.hpp"
  33 #include "runtime/sharedRuntime.hpp"
  34 #include "utilities/align.hpp"
  35 #include "utilities/macros.hpp"
  36 #include "vmreg_s390.inline.hpp"
  37 #if INCLUDE_ALL_GCS
  38 #include "gc/g1/g1BarrierSet.hpp"
  39 #endif // INCLUDE_ALL_GCS
  40 
  41 #define __ ce->masm()->
  42 #undef  CHECK_BAILOUT
  43 #define CHECK_BAILOUT() { if (ce->compilation()->bailed_out()) return; }
  44 
  45 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array) :
  46   _throw_index_out_of_bounds_exception(array == NULL), _index(index), _array(array) {


  47   assert(info != NULL, "must have info");
  48   _info = new CodeEmitInfo(info);
  49 }
  50 
  51 void RangeCheckStub::emit_code(LIR_Assembler* ce) {
  52   __ bind(_entry);
  53   if (_info->deoptimize_on_exception()) {
  54     address a = Runtime1::entry_for (Runtime1::predicate_failed_trap_id);
  55     ce->emit_call_c(a);
  56     CHECK_BAILOUT();
  57     ce->add_call_info_here(_info);
  58     ce->verify_oop_map(_info);
  59     debug_only(__ should_not_reach_here());
  60     return;
  61   }
  62 
  63   // Pass the array index in Z_R1_scratch which is not managed by linear scan.
  64   if (_index->is_cpu_register()) {
  65     __ lgr_if_needed(Z_R1_scratch, _index->as_register());
  66   } else {
  67     __ load_const_optimized(Z_R1_scratch, _index->as_jint());
  68   }
  69 
  70   Runtime1::StubID stub_id;
  71   if (_throw_index_out_of_bounds_exception) {
  72     stub_id = Runtime1::throw_index_exception_id;
  73   } else {
  74     stub_id = Runtime1::throw_range_check_failed_id;
  75     __ lgr_if_needed(Z_R0_scratch, _array->as_pointer_register());
  76   }
  77   ce->emit_call_c(Runtime1::entry_for (stub_id));
  78   CHECK_BAILOUT();
  79   ce->add_call_info_here(_info);
  80   ce->verify_oop_map(_info);
  81   debug_only(__ should_not_reach_here());
  82 }
  83 
  84 PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) {
  85   _info = new CodeEmitInfo(info);
  86 }
  87 
  88 void PredicateFailedStub::emit_code(LIR_Assembler* ce) {
  89   __ bind(_entry);
  90   address a = Runtime1::entry_for (Runtime1::predicate_failed_trap_id);
  91   ce->emit_call_c(a);
  92   CHECK_BAILOUT();
  93   ce->add_call_info_here(_info);
  94   ce->verify_oop_map(_info);
  95   debug_only(__ should_not_reach_here());


< prev index next >