summaryrefslogtreecommitdiff
path: root/openjdkjvmti/ti_phase.cc
diff options
context:
space:
mode:
author Alex Light <allight@google.com> 2017-08-16 16:07:37 -0700
committer Alex Light <allight@google.com> 2017-08-16 16:18:12 -0700
commitbf9e516f4964ee900d2996abaf60977c1c643aa3 (patch)
tree0656e7a0c692ca4539c67ea1684dfbe7a6f95048 /openjdkjvmti/ti_phase.cc
parent675c779cb046bca49229e1e5268d0eb622159214 (diff)
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
Diffstat (limited to 'openjdkjvmti/ti_phase.cc')
-rw-r--r--openjdkjvmti/ti_phase.cc4
1 files changed, 2 insertions, 2 deletions
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<ArtJvmtiEvent::kVmStart>(nullptr, GetJniEnv());
- PhaseUtil::current_phase_ = JVMTI_PHASE_START;
}
break;
case RuntimePhase::kInit:
{
ThreadUtil::CacheData();
+ PhaseUtil::current_phase_ = JVMTI_PHASE_LIVE;
ScopedLocalRef<jthread> thread(GetJniEnv(), GetCurrentJThread());
art::ScopedThreadSuspension sts(art::Thread::Current(), art::ThreadState::kNative);
event_handler->DispatchEvent<ArtJvmtiEvent::kVmInit>(nullptr, GetJniEnv(), thread.get());
- PhaseUtil::current_phase_ = JVMTI_PHASE_LIVE;
}
break;
case RuntimePhase::kDeath: