< prev index next >

src/hotspot/share/runtime/thread.cpp

Print this page

  52 #include "interpreter/oopMapCache.hpp"
  53 #include "jfr/jfrEvents.hpp"
  54 #include "jvmtifiles/jvmtiEnv.hpp"
  55 #include "logging/log.hpp"
  56 #include "logging/logAsyncWriter.hpp"
  57 #include "logging/logConfiguration.hpp"
  58 #include "logging/logStream.hpp"
  59 #include "memory/allocation.inline.hpp"
  60 #include "memory/iterator.hpp"
  61 #include "memory/oopFactory.hpp"
  62 #include "memory/resourceArea.hpp"
  63 #include "memory/universe.hpp"
  64 #include "oops/access.inline.hpp"
  65 #include "oops/instanceKlass.hpp"
  66 #include "oops/klass.inline.hpp"
  67 #include "oops/objArrayOop.hpp"
  68 #include "oops/oop.inline.hpp"
  69 #include "oops/oopHandle.inline.hpp"
  70 #include "oops/symbol.hpp"
  71 #include "oops/typeArrayOop.inline.hpp"

  72 #include "oops/verifyOopClosure.hpp"
  73 #include "prims/jvm_misc.hpp"
  74 #include "prims/jvmtiDeferredUpdates.hpp"
  75 #include "prims/jvmtiExport.hpp"
  76 #include "prims/jvmtiThreadState.hpp"
  77 #include "runtime/arguments.hpp"
  78 #include "runtime/atomic.hpp"
  79 #include "runtime/fieldDescriptor.inline.hpp"
  80 #include "runtime/flags/jvmFlagLimit.hpp"
  81 #include "runtime/deoptimization.hpp"
  82 #include "runtime/frame.inline.hpp"
  83 #include "runtime/handles.inline.hpp"
  84 #include "runtime/handshake.hpp"
  85 #include "runtime/init.hpp"
  86 #include "runtime/interfaceSupport.inline.hpp"
  87 #include "runtime/java.hpp"
  88 #include "runtime/javaCalls.hpp"
  89 #include "runtime/jniHandles.inline.hpp"
  90 #include "runtime/jniPeriodicChecker.hpp"
  91 #include "runtime/monitorDeflationThread.hpp"

 975   }
 976 }
 977 #endif // ASSERT
 978 
 979 // A JavaThread is a normal Java thread
 980 
 981 JavaThread::JavaThread() :
 982   // Initialize fields
 983 
 984   _on_thread_list(false),
 985   DEBUG_ONLY(_java_call_counter(0) COMMA)
 986   _entry_point(nullptr),
 987   _deopt_mark(nullptr),
 988   _deopt_nmethod(nullptr),
 989   _vframe_array_head(nullptr),
 990   _vframe_array_last(nullptr),
 991   _jvmti_deferred_updates(nullptr),
 992   _callee_target(nullptr),
 993   _vm_result(nullptr),
 994   _vm_result_2(nullptr),

 995 
 996   _current_pending_monitor(NULL),
 997   _current_pending_monitor_is_from_java(true),
 998   _current_waiting_monitor(NULL),
 999   _Stalled(0),
1000 
1001   _monitor_chunks(nullptr),
1002 
1003   _suspend_flags(0),
1004   _async_exception_condition(_no_async_condition),
1005   _pending_async_exception(nullptr),
1006 
1007   _thread_state(_thread_new),
1008   _saved_exception_pc(nullptr),
1009 #ifdef ASSERT
1010   _no_safepoint_count(0),
1011   _visited_for_critical_count(false),
1012 #endif
1013 
1014   _terminated(_not_terminated),

1042   _popframe_condition(popframe_inactive),
1043   _frames_to_pop_failed_realloc(0),
1044 
1045   _handshake(this),
1046 
1047   _popframe_preserved_args(nullptr),
1048   _popframe_preserved_args_size(0),
1049 
1050   _jvmti_thread_state(nullptr),
1051   _interp_only_mode(0),
1052   _should_post_on_exceptions_flag(JNI_FALSE),
1053   _thread_stat(new ThreadStatistics()),
1054 
1055   _parker(),
1056 
1057   _class_to_be_initialized(nullptr),
1058 
1059   _SleepEvent(ParkEvent::Allocate(this))
1060 {
1061   set_jni_functions(jni_functions());
1062 
1063 #if INCLUDE_JVMCI
1064   assert(_jvmci._implicit_exception_pc == nullptr, "must be");
1065   if (JVMCICounterSize > 0) {
1066     resize_counters(0, (int) JVMCICounterSize);
1067   }
1068 #endif // INCLUDE_JVMCI
1069 
1070   // Setup safepoint state info for this thread
1071   ThreadSafepointState::create(this);
1072 
1073   SafepointMechanism::initialize_header(this);
1074 
1075   set_requires_cross_modify_fence(false);
1076 
1077   pd_initialize();
1078   assert(deferred_card_mark().is_empty(), "Default MemRegion ctor");
1079 }
1080 
1081 JavaThread::JavaThread(bool is_attaching_via_jni) : JavaThread() {
1082   if (is_attaching_via_jni) {

  52 #include "interpreter/oopMapCache.hpp"
  53 #include "jfr/jfrEvents.hpp"
  54 #include "jvmtifiles/jvmtiEnv.hpp"
  55 #include "logging/log.hpp"
  56 #include "logging/logAsyncWriter.hpp"
  57 #include "logging/logConfiguration.hpp"
  58 #include "logging/logStream.hpp"
  59 #include "memory/allocation.inline.hpp"
  60 #include "memory/iterator.hpp"
  61 #include "memory/oopFactory.hpp"
  62 #include "memory/resourceArea.hpp"
  63 #include "memory/universe.hpp"
  64 #include "oops/access.inline.hpp"
  65 #include "oops/instanceKlass.hpp"
  66 #include "oops/klass.inline.hpp"
  67 #include "oops/objArrayOop.hpp"
  68 #include "oops/oop.inline.hpp"
  69 #include "oops/oopHandle.inline.hpp"
  70 #include "oops/symbol.hpp"
  71 #include "oops/typeArrayOop.inline.hpp"
  72 #include "oops/inlineKlass.hpp"
  73 #include "oops/verifyOopClosure.hpp"
  74 #include "prims/jvm_misc.hpp"
  75 #include "prims/jvmtiDeferredUpdates.hpp"
  76 #include "prims/jvmtiExport.hpp"
  77 #include "prims/jvmtiThreadState.hpp"
  78 #include "runtime/arguments.hpp"
  79 #include "runtime/atomic.hpp"
  80 #include "runtime/fieldDescriptor.inline.hpp"
  81 #include "runtime/flags/jvmFlagLimit.hpp"
  82 #include "runtime/deoptimization.hpp"
  83 #include "runtime/frame.inline.hpp"
  84 #include "runtime/handles.inline.hpp"
  85 #include "runtime/handshake.hpp"
  86 #include "runtime/init.hpp"
  87 #include "runtime/interfaceSupport.inline.hpp"
  88 #include "runtime/java.hpp"
  89 #include "runtime/javaCalls.hpp"
  90 #include "runtime/jniHandles.inline.hpp"
  91 #include "runtime/jniPeriodicChecker.hpp"
  92 #include "runtime/monitorDeflationThread.hpp"

 976   }
 977 }
 978 #endif // ASSERT
 979 
 980 // A JavaThread is a normal Java thread
 981 
 982 JavaThread::JavaThread() :
 983   // Initialize fields
 984 
 985   _on_thread_list(false),
 986   DEBUG_ONLY(_java_call_counter(0) COMMA)
 987   _entry_point(nullptr),
 988   _deopt_mark(nullptr),
 989   _deopt_nmethod(nullptr),
 990   _vframe_array_head(nullptr),
 991   _vframe_array_last(nullptr),
 992   _jvmti_deferred_updates(nullptr),
 993   _callee_target(nullptr),
 994   _vm_result(nullptr),
 995   _vm_result_2(nullptr),
 996   _return_buffered_value(nullptr),
 997 
 998   _current_pending_monitor(NULL),
 999   _current_pending_monitor_is_from_java(true),
1000   _current_waiting_monitor(NULL),
1001   _Stalled(0),
1002 
1003   _monitor_chunks(nullptr),
1004 
1005   _suspend_flags(0),
1006   _async_exception_condition(_no_async_condition),
1007   _pending_async_exception(nullptr),
1008 
1009   _thread_state(_thread_new),
1010   _saved_exception_pc(nullptr),
1011 #ifdef ASSERT
1012   _no_safepoint_count(0),
1013   _visited_for_critical_count(false),
1014 #endif
1015 
1016   _terminated(_not_terminated),

1044   _popframe_condition(popframe_inactive),
1045   _frames_to_pop_failed_realloc(0),
1046 
1047   _handshake(this),
1048 
1049   _popframe_preserved_args(nullptr),
1050   _popframe_preserved_args_size(0),
1051 
1052   _jvmti_thread_state(nullptr),
1053   _interp_only_mode(0),
1054   _should_post_on_exceptions_flag(JNI_FALSE),
1055   _thread_stat(new ThreadStatistics()),
1056 
1057   _parker(),
1058 
1059   _class_to_be_initialized(nullptr),
1060 
1061   _SleepEvent(ParkEvent::Allocate(this))
1062 {
1063   set_jni_functions(jni_functions());

1064 #if INCLUDE_JVMCI
1065   assert(_jvmci._implicit_exception_pc == nullptr, "must be");
1066   if (JVMCICounterSize > 0) {
1067     resize_counters(0, (int) JVMCICounterSize);
1068   }
1069 #endif // INCLUDE_JVMCI
1070 
1071   // Setup safepoint state info for this thread
1072   ThreadSafepointState::create(this);
1073 
1074   SafepointMechanism::initialize_header(this);
1075 
1076   set_requires_cross_modify_fence(false);
1077 
1078   pd_initialize();
1079   assert(deferred_card_mark().is_empty(), "Default MemRegion ctor");
1080 }
1081 
1082 JavaThread::JavaThread(bool is_attaching_via_jni) : JavaThread() {
1083   if (is_attaching_via_jni) {
< prev index next >