summaryrefslogtreecommitdiffstats
path: root/runtime/jdwp
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/jdwp')
-rw-r--r--runtime/jdwp/jdwp_event.cc11
-rw-r--r--runtime/jdwp/jdwp_handler.cc3
-rw-r--r--runtime/jdwp/jdwp_main.cc2
3 files changed, 15 insertions, 1 deletions
diff --git a/runtime/jdwp/jdwp_event.cc b/runtime/jdwp/jdwp_event.cc
index 6908047..adc1074 100644
--- a/runtime/jdwp/jdwp_event.cc
+++ b/runtime/jdwp/jdwp_event.cc
@@ -233,7 +233,16 @@ void JdwpState::UnregisterEvent(JdwpEvent* pEvent) {
Dbg::UnconfigureStep(pMod->step.threadId);
}
}
- if (NeedsFullDeoptimization(pEvent->eventKind)) {
+ if (pEvent->eventKind == EK_SINGLE_STEP) {
+ // Special case for single-steps where we want to avoid the slow pattern deoptimize/undeoptimize
+ // loop between each single-step. In a IDE, this would happens each time the user click on the
+ // "single-step" button. Here we delay the full undeoptimization to the next resume
+ // (VM.Resume or ThreadReference.Resume) or the end of the debugging session (VM.Dispose or
+ // runtime shutdown).
+ // Therefore, in a singles-stepping sequence, only the first single-step will trigger a full
+ // deoptimization and only the last single-step will trigger a full undeoptimization.
+ Dbg::DelayFullUndeoptimization();
+ } else if (NeedsFullDeoptimization(pEvent->eventKind)) {
CHECK_EQ(req.kind, DeoptimizationRequest::kNothing);
CHECK(req.method == nullptr);
req.kind = DeoptimizationRequest::kFullUndeoptimization;
diff --git a/runtime/jdwp/jdwp_handler.cc b/runtime/jdwp/jdwp_handler.cc
index 5ffe753..8ef375b 100644
--- a/runtime/jdwp/jdwp_handler.cc
+++ b/runtime/jdwp/jdwp_handler.cc
@@ -291,6 +291,7 @@ static JdwpError VM_Suspend(JdwpState*, Request&, ExpandBuf*)
*/
static JdwpError VM_Resume(JdwpState*, Request&, ExpandBuf*)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+ Dbg::ProcessDelayedFullUndeoptimizations();
Dbg::ResumeVM();
return ERR_NONE;
}
@@ -980,6 +981,8 @@ static JdwpError TR_Resume(JdwpState*, Request& request, ExpandBuf*)
return ERR_NONE;
}
+ Dbg::ProcessDelayedFullUndeoptimizations();
+
Dbg::ResumeThread(thread_id);
return ERR_NONE;
}
diff --git a/runtime/jdwp/jdwp_main.cc b/runtime/jdwp/jdwp_main.cc
index 8e22c1d..f480256 100644
--- a/runtime/jdwp/jdwp_main.cc
+++ b/runtime/jdwp/jdwp_main.cc
@@ -318,6 +318,8 @@ void JdwpState::ResetState() {
CHECK(event_list_ == NULL);
}
+ Dbg::ProcessDelayedFullUndeoptimizations();
+
/*
* Should not have one of these in progress. If the debugger went away
* mid-request, though, we could see this.