From bf9e516f4964ee900d2996abaf60977c1c643aa3 Mon Sep 17 00:00:00 2001 From: Alex Light Date: Wed, 16 Aug 2017 16:07:37 -0700 Subject: Ensure GetPhase returns correct values. We were incorrectly waiting until after the kInit and kStart runtime phase callbacks to change the current runtime phase. The phase should have already changed by the time the VMInit and VMStart are dispatched. Test: ./test.py --host -j50 Change-Id: I959221025a6692f2244048aa852170bb70dc2b7a --- openjdkjvmti/ti_phase.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'openjdkjvmti/ti_phase.cc') diff --git a/openjdkjvmti/ti_phase.cc b/openjdkjvmti/ti_phase.cc index 8893c9b4aa..e8c1ca7335 100644 --- a/openjdkjvmti/ti_phase.cc +++ b/openjdkjvmti/ti_phase.cc @@ -63,18 +63,18 @@ struct PhaseUtil::PhaseCallback : public art::RuntimePhaseCallback { break; case RuntimePhase::kStart: { + PhaseUtil::current_phase_ = JVMTI_PHASE_START; art::ScopedThreadSuspension sts(art::Thread::Current(), art::ThreadState::kNative); event_handler->DispatchEvent(nullptr, GetJniEnv()); - PhaseUtil::current_phase_ = JVMTI_PHASE_START; } break; case RuntimePhase::kInit: { ThreadUtil::CacheData(); + PhaseUtil::current_phase_ = JVMTI_PHASE_LIVE; ScopedLocalRef thread(GetJniEnv(), GetCurrentJThread()); art::ScopedThreadSuspension sts(art::Thread::Current(), art::ThreadState::kNative); event_handler->DispatchEvent(nullptr, GetJniEnv(), thread.get()); - PhaseUtil::current_phase_ = JVMTI_PHASE_LIVE; } break; case RuntimePhase::kDeath: -- cgit v1.2.3-59-g8ed1b