< 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"

 986   }
 987 }
 988 #endif // ASSERT
 989 
 990 // A JavaThread is a normal Java thread
 991 
 992 JavaThread::JavaThread() :
 993   // Initialize fields
 994 
 995   _on_thread_list(false),
 996   DEBUG_ONLY(_java_call_counter(0) COMMA)
 997   _entry_point(nullptr),
 998   _deopt_mark(nullptr),
 999   _deopt_nmethod(nullptr),
1000   _vframe_array_head(nullptr),
1001   _vframe_array_last(nullptr),
1002   _jvmti_deferred_updates(nullptr),
1003   _callee_target(nullptr),
1004   _vm_result(nullptr),
1005   _vm_result_2(nullptr),

1006 
1007   _current_pending_monitor(NULL),
1008   _current_pending_monitor_is_from_java(true),
1009   _current_waiting_monitor(NULL),
1010   _active_handles(NULL),
1011   _free_handle_block(NULL),
1012   _Stalled(0),
1013 
1014   _monitor_chunks(nullptr),
1015 
1016   _suspend_flags(0),
1017   _pending_async_exception(nullptr),
1018 #ifdef ASSERT
1019   _is_unsafe_access_error(false),
1020 #endif
1021 
1022   _thread_state(_thread_new),
1023   _saved_exception_pc(nullptr),
1024 #ifdef ASSERT
1025   _no_safepoint_count(0),

1057   _popframe_condition(popframe_inactive),
1058   _frames_to_pop_failed_realloc(0),
1059 
1060   _handshake(this),
1061 
1062   _popframe_preserved_args(nullptr),
1063   _popframe_preserved_args_size(0),
1064 
1065   _jvmti_thread_state(nullptr),
1066   _interp_only_mode(0),
1067   _should_post_on_exceptions_flag(JNI_FALSE),
1068   _thread_stat(new ThreadStatistics()),
1069 
1070   _parker(),
1071 
1072   _class_to_be_initialized(nullptr),
1073 
1074   _SleepEvent(ParkEvent::Allocate(this))
1075 {
1076   set_jni_functions(jni_functions());
1077 
1078 #if INCLUDE_JVMCI
1079   assert(_jvmci._implicit_exception_pc == nullptr, "must be");
1080   if (JVMCICounterSize > 0) {
1081     resize_counters(0, (int) JVMCICounterSize);
1082   }
1083 #endif // INCLUDE_JVMCI
1084 
1085   // Setup safepoint state info for this thread
1086   ThreadSafepointState::create(this);
1087 
1088   SafepointMechanism::initialize_header(this);
1089 
1090   set_requires_cross_modify_fence(false);
1091 
1092   pd_initialize();
1093   assert(deferred_card_mark().is_empty(), "Default MemRegion ctor");
1094 }
1095 
1096 JavaThread::JavaThread(bool is_attaching_via_jni) : JavaThread() {
1097   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"

 987   }
 988 }
 989 #endif // ASSERT
 990 
 991 // A JavaThread is a normal Java thread
 992 
 993 JavaThread::JavaThread() :
 994   // Initialize fields
 995 
 996   _on_thread_list(false),
 997   DEBUG_ONLY(_java_call_counter(0) COMMA)
 998   _entry_point(nullptr),
 999   _deopt_mark(nullptr),
1000   _deopt_nmethod(nullptr),
1001   _vframe_array_head(nullptr),
1002   _vframe_array_last(nullptr),
1003   _jvmti_deferred_updates(nullptr),
1004   _callee_target(nullptr),
1005   _vm_result(nullptr),
1006   _vm_result_2(nullptr),
1007   _return_buffered_value(nullptr),
1008 
1009   _current_pending_monitor(NULL),
1010   _current_pending_monitor_is_from_java(true),
1011   _current_waiting_monitor(NULL),
1012   _active_handles(NULL),
1013   _free_handle_block(NULL),
1014   _Stalled(0),
1015 
1016   _monitor_chunks(nullptr),
1017 
1018   _suspend_flags(0),
1019   _pending_async_exception(nullptr),
1020 #ifdef ASSERT
1021   _is_unsafe_access_error(false),
1022 #endif
1023 
1024   _thread_state(_thread_new),
1025   _saved_exception_pc(nullptr),
1026 #ifdef ASSERT
1027   _no_safepoint_count(0),

1059   _popframe_condition(popframe_inactive),
1060   _frames_to_pop_failed_realloc(0),
1061 
1062   _handshake(this),
1063 
1064   _popframe_preserved_args(nullptr),
1065   _popframe_preserved_args_size(0),
1066 
1067   _jvmti_thread_state(nullptr),
1068   _interp_only_mode(0),
1069   _should_post_on_exceptions_flag(JNI_FALSE),
1070   _thread_stat(new ThreadStatistics()),
1071 
1072   _parker(),
1073 
1074   _class_to_be_initialized(nullptr),
1075 
1076   _SleepEvent(ParkEvent::Allocate(this))
1077 {
1078   set_jni_functions(jni_functions());

1079 #if INCLUDE_JVMCI
1080   assert(_jvmci._implicit_exception_pc == nullptr, "must be");
1081   if (JVMCICounterSize > 0) {
1082     resize_counters(0, (int) JVMCICounterSize);
1083   }
1084 #endif // INCLUDE_JVMCI
1085 
1086   // Setup safepoint state info for this thread
1087   ThreadSafepointState::create(this);
1088 
1089   SafepointMechanism::initialize_header(this);
1090 
1091   set_requires_cross_modify_fence(false);
1092 
1093   pd_initialize();
1094   assert(deferred_card_mark().is_empty(), "Default MemRegion ctor");
1095 }
1096 
1097 JavaThread::JavaThread(bool is_attaching_via_jni) : JavaThread() {
1098   if (is_attaching_via_jni) {
< prev index next >