< prev index next >

src/hotspot/share/runtime/javaThread.cpp

Print this page
@@ -496,10 +496,12 @@
    _cont_fastpath_thread_state(1),
    _held_monitor_count(0),
    _jni_monitor_count(0),
    _unlocked_inflated_monitor(nullptr),
  
+   _can_call_java(true),
+ 
    _preempt_alternate_return(nullptr),
    _preemption_cancelled(false),
    _pending_interrupted_exception(false),
  
    _handshake(this),

@@ -981,11 +983,11 @@
    }
  
    // We need to cache the thread name for logging purposes below as once
    // we have called on_thread_detach this thread must not access any oops.
    char* thread_name = nullptr;
-   if (log_is_enabled(Debug, os, thread, timer)) {
+   if (log_is_enabled(Debug, os, thread, timer) || (CountBytecodesPerThread && log_is_enabled(Info, init))) {
      ResourceMark rm(this);
      thread_name = os::strdup(name());
    }
  
    if (log_is_enabled(Info, os, thread)) {

@@ -1008,10 +1010,15 @@
        }
      }
    }
  #endif // INCLUDE_JVMCI
  
+   if (bc_counter_value() > 0) {
+     log_info(init)("Thread '%s': " JLONG_FORMAT " bytecodes executed (during clinit: " JLONG_FORMAT ")",
+                    thread_name, bc_counter_value(), clinit_bc_counter_value());
+   }
+ 
    // Remove from list of active threads list, and notify VM thread if we are the last non-daemon thread.
    // We call BarrierSet::barrier_set()->on_thread_detach() here so no touching of oops after this point.
    Threads::remove(this, daemon);
  
    if (log_is_enabled(Debug, os, thread, timer)) {
< prev index next >