src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp

changeset 4860
46f6f063b272
parent 4542
db9981fd3124
child 5628
f98f5d48f511
     1.1 --- a/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp	Wed Mar 20 17:04:45 2013 -0700
     1.2 +++ b/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp	Thu Mar 21 09:27:54 2013 +0100
     1.3 @@ -51,6 +51,16 @@
     1.4  void RangeCheckStub::emit_code(LIR_Assembler* ce) {
     1.5    __ bind(_entry);
     1.6  
     1.7 +  if (_info->deoptimize_on_exception()) {
     1.8 +    address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
     1.9 +    __ call(a, relocInfo::runtime_call_type);
    1.10 +    __ delayed()->nop();
    1.11 +    ce->add_call_info_here(_info);
    1.12 +    ce->verify_oop_map(_info);
    1.13 +    debug_only(__ should_not_reach_here());
    1.14 +    return;
    1.15 +  }
    1.16 +
    1.17    if (_index->is_register()) {
    1.18      __ mov(_index->as_register(), G4);
    1.19    } else {
    1.20 @@ -64,11 +74,22 @@
    1.21    __ delayed()->nop();
    1.22    ce->add_call_info_here(_info);
    1.23    ce->verify_oop_map(_info);
    1.24 -#ifdef ASSERT
    1.25 -  __ should_not_reach_here();
    1.26 -#endif
    1.27 +  debug_only(__ should_not_reach_here());
    1.28  }
    1.29  
    1.30 +PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) {
    1.31 +  _info = new CodeEmitInfo(info);
    1.32 +}
    1.33 +
    1.34 +void PredicateFailedStub::emit_code(LIR_Assembler* ce) {
    1.35 +  __ bind(_entry);
    1.36 +  address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
    1.37 +  __ call(a, relocInfo::runtime_call_type);
    1.38 +  __ delayed()->nop();
    1.39 +  ce->add_call_info_here(_info);
    1.40 +  ce->verify_oop_map(_info);
    1.41 +  debug_only(__ should_not_reach_here());
    1.42 +}
    1.43  
    1.44  void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
    1.45    __ bind(_entry);
    1.46 @@ -99,10 +120,17 @@
    1.47  
    1.48  
    1.49  void ImplicitNullCheckStub::emit_code(LIR_Assembler* ce) {
    1.50 +  address a;
    1.51 +  if (_info->deoptimize_on_exception()) {
    1.52 +    // Deoptimize, do not throw the exception, because it is probably wrong to do it here.
    1.53 +    a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
    1.54 +  } else {
    1.55 +    a = Runtime1::entry_for(Runtime1::throw_null_pointer_exception_id);
    1.56 +  }
    1.57 +
    1.58    ce->compilation()->implicit_exception_table()->append(_offset, __ offset());
    1.59    __ bind(_entry);
    1.60 -  __ call(Runtime1::entry_for(Runtime1::throw_null_pointer_exception_id),
    1.61 -          relocInfo::runtime_call_type);
    1.62 +  __ call(a, relocInfo::runtime_call_type);
    1.63    __ delayed()->nop();
    1.64    ce->add_call_info_here(_info);
    1.65    ce->verify_oop_map(_info);

mercurial