summaryrefslogtreecommitdiffstats
path: root/runtime/mirror
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/mirror
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/mirror')
-rw-r--r--runtime/mirror/art_method.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/mirror/art_method.cc b/runtime/mirror/art_method.cc
index ffee59edc0..c1f7594578 100644
--- a/runtime/mirror/art_method.cc
+++ b/runtime/mirror/art_method.cc
@@ -401,7 +401,9 @@ void ArtMethod::Invoke(Thread* self, uint32_t* args, uint32_t args_size, JValue*
Runtime* runtime = Runtime::Current();
// Call the invoke stub, passing everything as arguments.
- if (UNLIKELY(!runtime->IsStarted())) {
+ // If the runtime is not yet started or it is required by the debugger, then perform the
+ // Invocation by the interpreter.
+ if (UNLIKELY(!runtime->IsStarted() || Dbg::IsForcedInterpreterNeededForCalling(self, this))) {
if (IsStatic()) {
art::interpreter::EnterInterpreterFromInvoke(self, this, nullptr, args, result);
} else {