summaryrefslogtreecommitdiffstats
path: root/runtime/jdwp
diff options
context:
space:
mode:
authorDaniel Mihalyi <daniel.mihalyi@mattakis.com>2014-08-22 17:33:31 +0200
committerSebastien Hertz <shertz@google.com>2015-03-24 14:43:57 +0100
commiteb07669e9784ccb41d75df180727e57fc4520e28 (patch)
treebc15da11ee0ce906252a33371f8f59138bc5a38f /runtime/jdwp
parentbce0855ca1dbb1fa226c5b6a81760272ce0b64ef (diff)
downloadart-eb07669e9784ccb41d75df180727e57fc4520e28.tar.gz
art-eb07669e9784ccb41d75df180727e57fc4520e28.tar.bz2
art-eb07669e9784ccb41d75df180727e57fc4520e28.zip
JDWP: Optimized single step during debugging
For single stepping full deoptimization and undeoptimizations were performed with significant overhead, because every code will be executed in interpreted mode during a single step, even if it is not strictly required. For example, if we have a computation heavy method call and we would like to step over it, that method (and all the methods called from it) will run in interpreter mode. This can take so long in some cases (e.g. multiple minutes) that it makes debugging process unusable. The solution for this limitation is not using full deoptimizations for single steps and force interpreter only for those methods that we are about to step into, and require stack deoptimization before step outs. Bug: 17750566 Bug: 18094282 Bug: https://code.google.com/p/android/issues/detail?id=77984 Change-Id: I683c52465883146c4c84ec47bf96f8efd920527f Signed-off-by: Daniel Mihalyi <daniel.mihalyi@mattakis.com>
Diffstat (limited to 'runtime/jdwp')
-rw-r--r--runtime/jdwp/jdwp_event.cc12
-rw-r--r--runtime/jdwp/jdwp_handler.cc3
-rw-r--r--runtime/jdwp/jdwp_main.cc2
3 files changed, 1 insertions, 16 deletions
diff --git a/runtime/jdwp/jdwp_event.cc b/runtime/jdwp/jdwp_event.cc
index 4bf7142692..c9a4483188 100644
--- a/runtime/jdwp/jdwp_event.cc
+++ b/runtime/jdwp/jdwp_event.cc
@@ -133,7 +133,6 @@ static bool NeedsFullDeoptimization(JdwpEventKind eventKind) {
case EK_METHOD_ENTRY:
case EK_METHOD_EXIT:
case EK_METHOD_EXIT_WITH_RETURN_VALUE:
- case EK_SINGLE_STEP:
case EK_FIELD_ACCESS:
case EK_FIELD_MODIFICATION:
return true;
@@ -278,16 +277,7 @@ void JdwpState::UnregisterEvent(JdwpEvent* pEvent) {
Dbg::UnconfigureStep(pMod->step.threadId);
}
}
- 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)) {
+ if (NeedsFullDeoptimization(pEvent->eventKind)) {
CHECK_EQ(req.GetKind(), DeoptimizationRequest::kNothing);
CHECK(req.Method() == nullptr);
req.SetKind(DeoptimizationRequest::kFullUndeoptimization);
diff --git a/runtime/jdwp/jdwp_handler.cc b/runtime/jdwp/jdwp_handler.cc
index c7083dcedc..add1394f2d 100644
--- a/runtime/jdwp/jdwp_handler.cc
+++ b/runtime/jdwp/jdwp_handler.cc
@@ -295,7 +295,6 @@ 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;
}
@@ -989,8 +988,6 @@ 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 3d69796fb1..e2b88a5e79 100644
--- a/runtime/jdwp/jdwp_main.cc
+++ b/runtime/jdwp/jdwp_main.cc
@@ -322,8 +322,6 @@ void JdwpState::ResetState() {
CHECK(event_list_ == nullptr);
}
- Dbg::ProcessDelayedFullUndeoptimizations();
-
/*
* Should not have one of these in progress. If the debugger went away
* mid-request, though, we could see this.