1061 // Communicates an alternative call target to an i2c stub from a JavaCall . 1062 address _alternate_call_target; 1063 } _jvmci; 1064 1065 // Support for high precision, thread sensitive counters in JVMCI compiled code. 1066 jlong* _jvmci_counters; 1067 1068 public: 1069 static jlong* _jvmci_old_thread_counters; 1070 static void collect_counters(typeArrayOop array); 1071 private: 1072 #endif // INCLUDE_JVMCI 1073 1074 StackGuardState _stack_guard_state; 1075 1076 // Precompute the limit of the stack as used in stack overflow checks. 1077 // We load it from here to simplify the stack overflow check in assembly. 1078 address _stack_overflow_limit; 1079 address _reserved_stack_activation; 1080 1081 // Compiler exception handling (NOTE: The _exception_oop is *NOT* the same as _pending_exception. It is 1082 // used to temp. parsing values into and out of the runtime system during exception handling for compiled 1083 // code) 1084 volatile oop _exception_oop; // Exception thrown in compiled code 1085 volatile address _exception_pc; // PC where exception happened 1086 volatile address _exception_handler_pc; // PC for handler of exception 1087 volatile int _is_method_handle_return; // true (== 1) if the current exception PC is a MethodHandle call site. 1088 1089 private: 1090 // support for JNI critical regions 1091 jint _jni_active_critical; // count of entries into JNI critical region 1092 1093 // Checked JNI: function name requires exception check 1094 char* _pending_jni_exception_check_fn; 1095 1096 // For deadlock detection. 1097 int _depth_first_number; 1098 1099 // JVMTI PopFrame support 1100 // This is set to popframe_pending to signal that top Java frame should be popped immediately 1699 static ByteSize pending_deoptimization_offset() { return byte_offset_of(JavaThread, _pending_deoptimization); } 1700 static ByteSize pending_monitorenter_offset() { return byte_offset_of(JavaThread, _pending_monitorenter); } 1701 static ByteSize pending_failed_speculation_offset() { return byte_offset_of(JavaThread, _pending_failed_speculation); } 1702 static ByteSize jvmci_alternate_call_target_offset() { return byte_offset_of(JavaThread, _jvmci._alternate_call_target); } 1703 static ByteSize jvmci_implicit_exception_pc_offset() { return byte_offset_of(JavaThread, _jvmci._implicit_exception_pc); } 1704 static ByteSize jvmci_counters_offset() { return byte_offset_of(JavaThread, _jvmci_counters); } 1705 #endif // INCLUDE_JVMCI 1706 static ByteSize exception_oop_offset() { return byte_offset_of(JavaThread, _exception_oop); } 1707 static ByteSize exception_pc_offset() { return byte_offset_of(JavaThread, _exception_pc); } 1708 static ByteSize exception_handler_pc_offset() { return byte_offset_of(JavaThread, _exception_handler_pc); } 1709 static ByteSize stack_overflow_limit_offset() { return byte_offset_of(JavaThread, _stack_overflow_limit); } 1710 static ByteSize is_method_handle_return_offset() { return byte_offset_of(JavaThread, _is_method_handle_return); } 1711 static ByteSize stack_guard_state_offset() { return byte_offset_of(JavaThread, _stack_guard_state); } 1712 static ByteSize reserved_stack_activation_offset() { return byte_offset_of(JavaThread, _reserved_stack_activation); } 1713 static ByteSize suspend_flags_offset() { return byte_offset_of(JavaThread, _suspend_flags); } 1714 1715 static ByteSize do_not_unlock_if_synchronized_offset() { return byte_offset_of(JavaThread, _do_not_unlock_if_synchronized); } 1716 static ByteSize should_post_on_exceptions_flag_offset() { 1717 return byte_offset_of(JavaThread, _should_post_on_exceptions_flag); 1718 } 1719 1720 // Returns the jni environment for this thread 1721 JNIEnv* jni_environment() { return &_jni_environment; } 1722 1723 static JavaThread* thread_from_jni_environment(JNIEnv* env) { 1724 JavaThread *thread_from_jni_env = (JavaThread*)((intptr_t)env - in_bytes(jni_environment_offset())); 1725 // Only return NULL if thread is off the thread list; starting to 1726 // exit should not return NULL. 1727 if (thread_from_jni_env->is_terminated()) { 1728 thread_from_jni_env->block_if_vm_exited(); 1729 return NULL; 1730 } else { 1731 return thread_from_jni_env; 1732 } 1733 } 1734 1735 // JNI critical regions. These can nest. 1736 bool in_critical() { return _jni_active_critical > 0; } 1737 bool in_last_critical() { return _jni_active_critical == 1; } 1738 void enter_critical() { | 1061 // Communicates an alternative call target to an i2c stub from a JavaCall . 1062 address _alternate_call_target; 1063 } _jvmci; 1064 1065 // Support for high precision, thread sensitive counters in JVMCI compiled code. 1066 jlong* _jvmci_counters; 1067 1068 public: 1069 static jlong* _jvmci_old_thread_counters; 1070 static void collect_counters(typeArrayOop array); 1071 private: 1072 #endif // INCLUDE_JVMCI 1073 1074 StackGuardState _stack_guard_state; 1075 1076 // Precompute the limit of the stack as used in stack overflow checks. 1077 // We load it from here to simplify the stack overflow check in assembly. 1078 address _stack_overflow_limit; 1079 address _reserved_stack_activation; 1080 1081 #ifdef _WIN64 1082 // On windows, in the stubGenerator, there's nowhere to save callee saved regs 1083 address _windows_saved_rsi; 1084 address _windows_saved_rdi; 1085 #endif // _WIN64 1086 1087 // Compiler exception handling (NOTE: The _exception_oop is *NOT* the same as _pending_exception. It is 1088 // used to temp. parsing values into and out of the runtime system during exception handling for compiled 1089 // code) 1090 volatile oop _exception_oop; // Exception thrown in compiled code 1091 volatile address _exception_pc; // PC where exception happened 1092 volatile address _exception_handler_pc; // PC for handler of exception 1093 volatile int _is_method_handle_return; // true (== 1) if the current exception PC is a MethodHandle call site. 1094 1095 private: 1096 // support for JNI critical regions 1097 jint _jni_active_critical; // count of entries into JNI critical region 1098 1099 // Checked JNI: function name requires exception check 1100 char* _pending_jni_exception_check_fn; 1101 1102 // For deadlock detection. 1103 int _depth_first_number; 1104 1105 // JVMTI PopFrame support 1106 // This is set to popframe_pending to signal that top Java frame should be popped immediately 1705 static ByteSize pending_deoptimization_offset() { return byte_offset_of(JavaThread, _pending_deoptimization); } 1706 static ByteSize pending_monitorenter_offset() { return byte_offset_of(JavaThread, _pending_monitorenter); } 1707 static ByteSize pending_failed_speculation_offset() { return byte_offset_of(JavaThread, _pending_failed_speculation); } 1708 static ByteSize jvmci_alternate_call_target_offset() { return byte_offset_of(JavaThread, _jvmci._alternate_call_target); } 1709 static ByteSize jvmci_implicit_exception_pc_offset() { return byte_offset_of(JavaThread, _jvmci._implicit_exception_pc); } 1710 static ByteSize jvmci_counters_offset() { return byte_offset_of(JavaThread, _jvmci_counters); } 1711 #endif // INCLUDE_JVMCI 1712 static ByteSize exception_oop_offset() { return byte_offset_of(JavaThread, _exception_oop); } 1713 static ByteSize exception_pc_offset() { return byte_offset_of(JavaThread, _exception_pc); } 1714 static ByteSize exception_handler_pc_offset() { return byte_offset_of(JavaThread, _exception_handler_pc); } 1715 static ByteSize stack_overflow_limit_offset() { return byte_offset_of(JavaThread, _stack_overflow_limit); } 1716 static ByteSize is_method_handle_return_offset() { return byte_offset_of(JavaThread, _is_method_handle_return); } 1717 static ByteSize stack_guard_state_offset() { return byte_offset_of(JavaThread, _stack_guard_state); } 1718 static ByteSize reserved_stack_activation_offset() { return byte_offset_of(JavaThread, _reserved_stack_activation); } 1719 static ByteSize suspend_flags_offset() { return byte_offset_of(JavaThread, _suspend_flags); } 1720 1721 static ByteSize do_not_unlock_if_synchronized_offset() { return byte_offset_of(JavaThread, _do_not_unlock_if_synchronized); } 1722 static ByteSize should_post_on_exceptions_flag_offset() { 1723 return byte_offset_of(JavaThread, _should_post_on_exceptions_flag); 1724 } 1725 1726 #ifdef _WIN64 1727 static ByteSize windows_saved_rsi_offset() { return byte_offset_of(JavaThread, _windows_saved_rsi); } 1728 static ByteSize windows_saved_rdi_offset() { return byte_offset_of(JavaThread, _windows_saved_rdi); } 1729 #endif // _WIN64 1730 1731 // Returns the jni environment for this thread 1732 JNIEnv* jni_environment() { return &_jni_environment; } 1733 1734 static JavaThread* thread_from_jni_environment(JNIEnv* env) { 1735 JavaThread *thread_from_jni_env = (JavaThread*)((intptr_t)env - in_bytes(jni_environment_offset())); 1736 // Only return NULL if thread is off the thread list; starting to 1737 // exit should not return NULL. 1738 if (thread_from_jni_env->is_terminated()) { 1739 thread_from_jni_env->block_if_vm_exited(); 1740 return NULL; 1741 } else { 1742 return thread_from_jni_env; 1743 } 1744 } 1745 1746 // JNI critical regions. These can nest. 1747 bool in_critical() { return _jni_active_critical > 0; } 1748 bool in_last_critical() { return _jni_active_critical == 1; } 1749 void enter_critical() { |