summaryrefslogtreecommitdiffstats
path: root/runtime/interpreter
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/interpreter
parentbce0855ca1dbb1fa226c5b6a81760272ce0b64ef (diff)
downloadart-eb07669e9784ccb41d75df180727e57fc4520e28.zip
art-eb07669e9784ccb41d75df180727e57fc4520e28.tar.gz
art-eb07669e9784ccb41d75df180727e57fc4520e28.tar.bz2
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/interpreter')
-rw-r--r--runtime/interpreter/interpreter_common.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc
index 26ab602..a3ab026 100644
--- a/runtime/interpreter/interpreter_common.cc
+++ b/runtime/interpreter/interpreter_common.cc
@@ -18,6 +18,7 @@
#include <cmath>
+#include "debugger.h"
#include "mirror/array-inl.h"
#include "unstarted_runtime.h"
@@ -616,8 +617,14 @@ bool DoCall(ArtMethod* called_method, Thread* self, ShadowFrame& shadow_frame,
<< PrettyMethod(new_shadow_frame->GetMethod());
UNREACHABLE();
}
- (new_shadow_frame->GetMethod()->GetEntryPointFromInterpreter())(self, code_item,
- new_shadow_frame, result);
+ // Force the use of interpreter when it is required by the debugger.
+ mirror::EntryPointFromInterpreter* entry;
+ if (UNLIKELY(Dbg::IsForcedInterpreterNeededForCalling(self, new_shadow_frame->GetMethod()))) {
+ entry = &art::artInterpreterToInterpreterBridge;
+ } else {
+ entry = new_shadow_frame->GetMethod()->GetEntryPointFromInterpreter();
+ }
+ entry(self, code_item, new_shadow_frame, result);
} else {
UnstartedRuntimeInvoke(self, code_item, new_shadow_frame, result, first_dest_reg);
}