< prev index next >

src/hotspot/share/runtime/thread.hpp

Print this page

        

*** 86,98 **** class GCTaskQueue; class ThreadClosure; class ICRefillVerifier; class IdealGraphPrinter; - class JVMCIEnv; - class JVMCIPrimitiveArray; - class Metadata; class ResourceArea; DEBUG_ONLY(class ResourceMark;) --- 86,95 ----
*** 287,296 **** --- 284,294 ---- // NOTE: avoid using the sign-bit as cc generates different test code // when the sign-bit is used, and sometimes incorrectly - see CR 6398077 _external_suspend = 0x20000000U, // thread is asked to self suspend _ext_suspended = 0x40000000U, // thread has self-suspended + _deopt_suspend = 0x10000000U, // thread needs to self suspend for deopt _has_async_exception = 0x00000001U, // there is a pending async exception _critical_native_unlock = 0x00000002U, // Must call back to unlock JNI critical lock _trace_flag = 0x00000004U // call tracing backend
*** 730,740 **** void set_lgrp_id(int value) { _lgrp_id = value; } // Printing void print_on(outputStream* st, bool print_extended_info) const; virtual void print_on(outputStream* st) const { print_on(st, false); } ! void print() const; virtual void print_on_error(outputStream* st, char* buf, int buflen) const; void print_value_on(outputStream* st) const; // Debug-only code #ifdef ASSERT --- 728,738 ---- void set_lgrp_id(int value) { _lgrp_id = value; } // Printing void print_on(outputStream* st, bool print_extended_info) const; virtual void print_on(outputStream* st) const { print_on(st, false); } ! void print() const { print_on(tty); } virtual void print_on_error(outputStream* st, char* buf, int buflen) const; void print_value_on(outputStream* st) const; // Debug-only code #ifdef ASSERT
*** 981,990 **** --- 979,989 ---- class JavaThread: public Thread { friend class VMStructs; friend class JVMCIVMStructs; friend class WhiteBox; private: + JavaThread* _next; // The next thread in the Threads list bool _on_thread_list; // Is set when this JavaThread is added to the Threads list oop _threadObj; // The Java level thread object #ifdef ASSERT private:
*** 1126,1142 **** bool _pending_monitorenter; // Specifies if the DeoptReason for the last uncommon trap was Reason_transfer_to_interpreter bool _pending_transfer_to_interpreter; // True if in a runtime call from compiled code that will deoptimize // and re-execute a failed heap allocation in the interpreter. bool _in_retryable_allocation; // An id of a speculation that JVMCI compiled code can use to further describe and // uniquely identify the speculative optimization guarded by the uncommon trap ! jlong _pending_failed_speculation; // These fields are mutually exclusive in terms of live ranges. union { // Communicates the pc at which the most recent implicit exception occurred // from the signal handler to a deoptimization stub. --- 1125,1144 ---- bool _pending_monitorenter; // Specifies if the DeoptReason for the last uncommon trap was Reason_transfer_to_interpreter bool _pending_transfer_to_interpreter; + // Guard for re-entrant call to JVMCIRuntime::adjust_comp_level + bool _adjusting_comp_level; + // True if in a runtime call from compiled code that will deoptimize // and re-execute a failed heap allocation in the interpreter. bool _in_retryable_allocation; // An id of a speculation that JVMCI compiled code can use to further describe and // uniquely identify the speculative optimization guarded by the uncommon trap ! long _pending_failed_speculation; // These fields are mutually exclusive in terms of live ranges. union { // Communicates the pc at which the most recent implicit exception occurred // from the signal handler to a deoptimization stub.
*** 1149,1159 **** // Support for high precision, thread sensitive counters in JVMCI compiled code. jlong* _jvmci_counters; public: static jlong* _jvmci_old_thread_counters; ! static void collect_counters(jlong* array, int length); private: #endif // INCLUDE_JVMCI StackGuardState _stack_guard_state; --- 1151,1161 ---- // Support for high precision, thread sensitive counters in JVMCI compiled code. jlong* _jvmci_counters; public: static jlong* _jvmci_old_thread_counters; ! static void collect_counters(typeArrayOop array); private: #endif // INCLUDE_JVMCI StackGuardState _stack_guard_state;
*** 1244,1253 **** --- 1246,1259 ---- // Testers virtual bool is_Java_thread() const { return true; } virtual bool can_call_java() const { return true; } + // Thread chain operations + JavaThread* next() const { return _next; } + void set_next(JavaThread* p) { _next = p; } + // Thread oop. threadObj() can be NULL for initial JavaThread // (or for threads attached via JNI) oop threadObj() const { return _threadObj; } void set_threadObj(oop p) { _threadObj = p; }
*** 1280,1290 **** address last_Java_pc(void) { return _anchor.last_Java_pc(); } // Safepoint support inline JavaThreadState thread_state() const; inline void set_thread_state(JavaThreadState s); - inline void set_thread_state_fence(JavaThreadState s); // fence after setting thread state inline ThreadSafepointState* safepoint_state() const; inline void set_safepoint_state(ThreadSafepointState* state); inline bool is_at_poll_safepoint(); // JavaThread termination and lifecycle support: --- 1286,1295 ----
*** 1375,1385 **** // block. static void check_special_condition_for_native_trans_and_transition(JavaThread *thread); bool is_ext_suspend_completed(bool called_by_wait, int delay, uint32_t *bits); bool is_ext_suspend_completed_with_lock(uint32_t *bits) { ! MutexLocker ml(SR_lock(), Mutex::_no_safepoint_check_flag); // Warning: is_ext_suspend_completed() may temporarily drop the // SR_lock to allow the thread to reach a stable thread state if // it is currently in a transient thread state. return is_ext_suspend_completed(false /* !called_by_wait */, SuspendRetryDelay, bits); --- 1380,1390 ---- // block. static void check_special_condition_for_native_trans_and_transition(JavaThread *thread); bool is_ext_suspend_completed(bool called_by_wait, int delay, uint32_t *bits); bool is_ext_suspend_completed_with_lock(uint32_t *bits) { ! MutexLockerEx ml(SR_lock(), Mutex::_no_safepoint_check_flag); // Warning: is_ext_suspend_completed() may temporarily drop the // SR_lock to allow the thread to reach a stable thread state if // it is currently in a transient thread state. return is_ext_suspend_completed(false /* !called_by_wait */, SuspendRetryDelay, bits);
*** 1397,1431 **** bool is_thread_fully_suspended(bool wait_for_suspend, uint32_t *bits); inline void set_external_suspend(); inline void clear_external_suspend(); bool is_external_suspend() const { return (_suspend_flags & _external_suspend) != 0; } // Whenever a thread transitions from native to vm/java it must suspend // if external|deopt suspend is present. bool is_suspend_after_native() const { ! return (_suspend_flags & (_external_suspend JFR_ONLY(| _trace_flag))) != 0; } // external suspend request is completed bool is_ext_suspended() const { return (_suspend_flags & _ext_suspended) != 0; } bool is_external_suspend_with_lock() const { ! MutexLocker ml(SR_lock(), Mutex::_no_safepoint_check_flag); return is_external_suspend(); } // Special method to handle a pending external suspend request // when a suspend equivalent condition lifts. bool handle_special_suspend_equivalent_condition() { assert(is_suspend_equivalent(), "should only be called in a suspend equivalence condition"); ! MutexLocker ml(SR_lock(), Mutex::_no_safepoint_check_flag); bool ret = is_external_suspend(); if (!ret) { // not about to self-suspend so clear suspend equivalence clear_suspend_equivalent(); } --- 1402,1440 ---- bool is_thread_fully_suspended(bool wait_for_suspend, uint32_t *bits); inline void set_external_suspend(); inline void clear_external_suspend(); + inline void set_deopt_suspend(); + inline void clear_deopt_suspend(); + bool is_deopt_suspend() { return (_suspend_flags & _deopt_suspend) != 0; } + bool is_external_suspend() const { return (_suspend_flags & _external_suspend) != 0; } // Whenever a thread transitions from native to vm/java it must suspend // if external|deopt suspend is present. bool is_suspend_after_native() const { ! return (_suspend_flags & (_external_suspend | _deopt_suspend)) != 0; } // external suspend request is completed bool is_ext_suspended() const { return (_suspend_flags & _ext_suspended) != 0; } bool is_external_suspend_with_lock() const { ! MutexLockerEx ml(SR_lock(), Mutex::_no_safepoint_check_flag); return is_external_suspend(); } // Special method to handle a pending external suspend request // when a suspend equivalent condition lifts. bool handle_special_suspend_equivalent_condition() { assert(is_suspend_equivalent(), "should only be called in a suspend equivalence condition"); ! MutexLockerEx ml(SR_lock(), Mutex::_no_safepoint_check_flag); bool ret = is_external_suspend(); if (!ret) { // not about to self-suspend so clear suspend equivalence clear_suspend_equivalent(); }
*** 1438,1448 **** return ret; } // utility methods to see if we are doing some kind of suspension bool is_being_ext_suspended() const { ! MutexLocker ml(SR_lock(), Mutex::_no_safepoint_check_flag); return is_ext_suspended() || is_external_suspend(); } bool is_suspend_equivalent() const { return _suspend_equivalent; } --- 1447,1457 ---- return ret; } // utility methods to see if we are doing some kind of suspension bool is_being_ext_suspended() const { ! MutexLockerEx ml(SR_lock(), Mutex::_no_safepoint_check_flag); return is_ext_suspended() || is_external_suspend(); } bool is_suspend_equivalent() const { return _suspend_equivalent; }
*** 1528,1542 **** MemRegion deferred_card_mark() const { return _deferred_card_mark; } void set_deferred_card_mark(MemRegion mr) { _deferred_card_mark = mr; } #if INCLUDE_JVMCI int pending_deoptimization() const { return _pending_deoptimization; } ! jlong pending_failed_speculation() const { return _pending_failed_speculation; } bool has_pending_monitorenter() const { return _pending_monitorenter; } void set_pending_monitorenter(bool b) { _pending_monitorenter = b; } void set_pending_deoptimization(int reason) { _pending_deoptimization = reason; } ! void set_pending_failed_speculation(jlong failed_speculation) { _pending_failed_speculation = failed_speculation; } void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; } void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == NULL, "must be"); _jvmci._alternate_call_target = a; } void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == NULL, "must be"); _jvmci._implicit_exception_pc = a; } virtual bool in_retryable_allocation() const { return _in_retryable_allocation; } --- 1537,1553 ---- MemRegion deferred_card_mark() const { return _deferred_card_mark; } void set_deferred_card_mark(MemRegion mr) { _deferred_card_mark = mr; } #if INCLUDE_JVMCI int pending_deoptimization() const { return _pending_deoptimization; } ! long pending_failed_speculation() const { return _pending_failed_speculation; } ! bool adjusting_comp_level() const { return _adjusting_comp_level; } ! void set_adjusting_comp_level(bool b) { _adjusting_comp_level = b; } bool has_pending_monitorenter() const { return _pending_monitorenter; } void set_pending_monitorenter(bool b) { _pending_monitorenter = b; } void set_pending_deoptimization(int reason) { _pending_deoptimization = reason; } ! void set_pending_failed_speculation(long failed_speculation) { _pending_failed_speculation = failed_speculation; } void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; } void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == NULL, "must be"); _jvmci._alternate_call_target = a; } void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == NULL, "must be"); _jvmci._implicit_exception_pc = a; } virtual bool in_retryable_allocation() const { return _in_retryable_allocation; }
*** 1867,1877 **** // Misc. operations char* name() const { return (char*)get_thread_name(); } void print_on(outputStream* st, bool print_extended_info) const; void print_on(outputStream* st) const { print_on(st, false); } - void print() const; void print_value(); void print_thread_state_on(outputStream*) const PRODUCT_RETURN; void print_thread_state() const PRODUCT_RETURN; void print_on_error(outputStream* st, char* buf, int buflen) const; void print_name_on_error(outputStream* st, char* buf, int buflen) const; --- 1878,1887 ----
*** 1916,1926 **** // Function for testing deoptimization void deoptimize(); void make_zombies(); ! void deoptimize_marked_methods(bool in_handshake); public: // Returns the running thread as a JavaThread static inline JavaThread* current(); --- 1926,1936 ---- // Function for testing deoptimization void deoptimize(); void make_zombies(); ! void deoptimized_wrt_marked_nmethods(); public: // Returns the running thread as a JavaThread static inline JavaThread* current();
*** 2206,2215 **** --- 2216,2226 ---- // The active thread queue. It also keeps track of the current used // thread priorities. class Threads: AllStatic { friend class VMStructs; private: + static JavaThread* _thread_list; static int _number_of_threads; static int _number_of_non_daemon_threads; static int _return_code; static uintx _thread_claim_token; #ifdef ASSERT
< prev index next >