8268368: Adopt cast notation for JavaThread conversions

Reviewed-by: dholmes, stefank
This commit is contained in:
Guoxiong Li 2021-06-23 02:21:24 +00:00 committed by David Holmes
parent b6cfca8a89
commit cd678a383f
64 changed files with 139 additions and 145 deletions

View file

@ -112,7 +112,7 @@ private:
public:
JvmtiThreadEventTransition(Thread *thread) : _rm(), _hm(thread) {
if (thread->is_Java_thread()) {
_jthread = thread->as_Java_thread();
_jthread = JavaThread::cast(thread);
_saved_state = _jthread->thread_state();
if (_saved_state == _thread_in_Java) {
ThreadStateTransition::transition_from_java(_jthread, _thread_in_native);
@ -2307,7 +2307,7 @@ void JvmtiExport::record_vm_internal_object_allocation(oop obj) {
NoSafepointVerifier no_sfpt;
// Cannot take safepoint here so do not use state_for to get
// jvmti thread state.
JvmtiThreadState *state = thread->as_Java_thread()->jvmti_thread_state();
JvmtiThreadState *state = JavaThread::cast(thread)->jvmti_thread_state();
if (state != NULL) {
// state is non NULL when VMObjectAllocEventCollector is enabled.
JvmtiVMObjectAllocEventCollector *collector;
@ -2331,7 +2331,7 @@ void JvmtiExport::record_sampled_internal_object_allocation(oop obj) {
NoSafepointVerifier no_sfpt;
// Cannot take safepoint here so do not use state_for to get
// jvmti thread state.
JvmtiThreadState *state = thread->as_Java_thread()->jvmti_thread_state();
JvmtiThreadState *state = JavaThread::cast(thread)->jvmti_thread_state();
if (state != NULL) {
// state is non NULL when SampledObjectAllocEventCollector is enabled.
JvmtiSampledObjectAllocEventCollector *collector;
@ -2867,7 +2867,7 @@ NoJvmtiVMObjectAllocMark::NoJvmtiVMObjectAllocMark() : _collector(NULL) {
}
Thread* thread = Thread::current_or_null();
if (thread != NULL && thread->is_Java_thread()) {
JavaThread* current_thread = thread->as_Java_thread();
JavaThread* current_thread = JavaThread::cast(thread);
JvmtiThreadState *state = current_thread->jvmti_thread_state();
if (state != NULL) {
JvmtiVMObjectAllocEventCollector *collector;