< prev index next >

src/hotspot/share/opto/compile.cpp

Print this page
*** 633,10 ***
--- 633,11 ---
                    _igv_idx(0),
                    _trace_opto_output(directive->TraceOptoOutputOption),
  #endif
                    _has_method_handle_invokes(false),
                    _clinit_barrier_on_entry(false),
+                   _has_clinit_barriers(false),
                    _stress_seed(0),
                    _comp_arena(mtCompiler),
                    _barrier_set_state(BarrierSet::barrier_set()->barrier_set_c2()->create_barrier_state(comp_arena())),
                    _env(ci_env),
                    _directive(directive),

*** 914,10 ***
--- 915,11 ---
      _igv_idx(0),
      _trace_opto_output(directive->TraceOptoOutputOption),
  #endif
      _has_method_handle_invokes(false),
      _clinit_barrier_on_entry(false),
+     _has_clinit_barriers(false),
      _stress_seed(0),
      _comp_arena(mtCompiler),
      _barrier_set_state(BarrierSet::barrier_set()->barrier_set_c2()->create_barrier_state(comp_arena())),
      _env(ci_env),
      _directive(directive),

*** 1092,12 ***
        // code if UseRTMDeopt is on.
        set_rtm_state(ProfileRTM);
      }
    }
  #endif
!   if (VM_Version::supports_fast_class_init_checks() && has_method() && !is_osr_compilation() && method()->needs_clinit_barrier()) {
      set_clinit_barrier_on_entry(true);
    }
    if (debug_info()->recording_non_safepoints()) {
      set_node_note_array(new(comp_arena()) GrowableArray<Node_Notes*>
                          (comp_arena(), 8, 0, nullptr));
      set_default_node_notes(Node_Notes::make(this));
--- 1094,16 ---
        // code if UseRTMDeopt is on.
        set_rtm_state(ProfileRTM);
      }
    }
  #endif
!   if (VM_Version::supports_fast_class_init_checks() && has_method() && !is_osr_compilation() &&
+       (method()->needs_clinit_barrier() || (do_clinit_barriers() && method()->is_static()))) {
      set_clinit_barrier_on_entry(true);
+     if (do_clinit_barriers()) {
+       set_has_clinit_barriers(true); // Entry clinit barrier is in prolog code.
+     }
    }
    if (debug_info()->recording_non_safepoints()) {
      set_node_note_array(new(comp_arena()) GrowableArray<Node_Notes*>
                          (comp_arena(), 8, 0, nullptr));
      set_default_node_notes(Node_Notes::make(this));

*** 4141,10 ***
--- 4147,13 ---
  // Report if there are too many traps at the current method and bci.
  // Return true if there was a trap, and/or PerMethodTrapLimit is exceeded.
  bool Compile::too_many_traps(ciMethod* method,
                               int bci,
                               Deoptimization::DeoptReason reason) {
+   if (method->has_trap_at(bci)) {
+     return true;
+   }
    ciMethodData* md = method->method_data();
    if (md->is_empty()) {
      // Assume the trap has not occurred, or that it occurred only
      // because of a transient condition during start-up in the interpreter.
      return false;

*** 4255,14 ***
  bool Compile::needs_clinit_barrier(ciField* field, ciMethod* accessing_method) {
    return field->is_static() && needs_clinit_barrier(field->holder(), accessing_method);
  }
  
  bool Compile::needs_clinit_barrier(ciInstanceKlass* holder, ciMethod* accessing_method) {
!   if (holder->is_initialized()) {
      return false;
    }
!   if (holder->is_being_initialized()) {
      if (accessing_method->holder() == holder) {
        // Access inside a class. The barrier can be elided when access happens in <clinit>,
        // <init>, or a static method. In all those cases, there was an initialization
        // barrier on the holder klass passed.
        if (accessing_method->is_static_initializer() ||
--- 4264,14 ---
  bool Compile::needs_clinit_barrier(ciField* field, ciMethod* accessing_method) {
    return field->is_static() && needs_clinit_barrier(field->holder(), accessing_method);
  }
  
  bool Compile::needs_clinit_barrier(ciInstanceKlass* holder, ciMethod* accessing_method) {
!   if (holder->is_initialized() && !do_clinit_barriers()) {
      return false;
    }
!   if (holder->is_being_initialized() || do_clinit_barriers()) {
      if (accessing_method->holder() == holder) {
        // Access inside a class. The barrier can be elided when access happens in <clinit>,
        // <init>, or a static method. In all those cases, there was an initialization
        // barrier on the holder klass passed.
        if (accessing_method->is_static_initializer() ||

*** 4641,11 ***
    }
  }
  
  void Compile::log_late_inline(CallGenerator* cg) {
    if (log() != nullptr) {
!     log()->head("late_inline method='%d'  inline_id='" JLONG_FORMAT "'", log()->identify(cg->method()),
                  cg->unique_id());
      JVMState* p = cg->call_node()->jvms();
      while (p != nullptr) {
        log()->elem("jvms bci='%d' method='%d'", p->bci(), log()->identify(p->method()));
        p = p->caller();
--- 4650,11 ---
    }
  }
  
  void Compile::log_late_inline(CallGenerator* cg) {
    if (log() != nullptr) {
!     log()->head("late_inline method='%d' inline_id='" JLONG_FORMAT "'", log()->identify(cg->method()),
                  cg->unique_id());
      JVMState* p = cg->call_node()->jvms();
      while (p != nullptr) {
        log()->elem("jvms bci='%d' method='%d'", p->bci(), log()->identify(p->method()));
        p = p->caller();
< prev index next >