diff options
author | buzbee <buzbee@google.com> | 2011-01-14 13:37:31 -0800 |
---|---|---|
committer | buzbee <buzbee@google.com> | 2011-01-19 10:00:50 -0800 |
commit | cb3081f675109049e63380170b60871e8275f9a8 (patch) | |
tree | 9ec66b046bb21b93ef53b4969873042ef60bf89b /vm/jdwp | |
parent | 442d65246ad6c863e8e58a100f5238387865dbdb (diff) | |
download | android_dalvik-cb3081f675109049e63380170b60871e8275f9a8.tar.gz android_dalvik-cb3081f675109049e63380170b60871e8275f9a8.tar.bz2 android_dalvik-cb3081f675109049e63380170b60871e8275f9a8.zip |
Consolidate mterp's debug/profile/suspend control
This is a step towards full debug & profiling support in JIT'd code.
Previously, the interpreter made multiple distinct checks for pending
suspend requests, debugger and profiler checks at each safe point.
This CL moves the individual controls into a single control word,
significantly speeding up the safe-point check code path in the common
fast case.
In short, any time some VM component wants control to break at a safe
point it will set a bit in gDvm.interpBreak, which will be examined
at the safe point check in footer.S. In the old code, the safe point
check consisted of 11 instructions (including 6 loads). The new sequence
is 6 instructions (4 loads - two of which are needed and two are
speculative to fill otherwise stalling slots).
This code path is hot enough in the interpreter that we actually see
some measureable speedups in benchmarks. The old sieve benchmark
improves from 252 to 256 (~1.5%).
As part of the change, global debuggerActive and activeProfilers variables
have been eliminated as redundant. Note also that there is a subtle
change in thread suspension. Thread suspend request counts are kept on
a per-thread basis, and previously each thread would only examine its own
suspend count. With this change, a bit has been allocated in interpBreak
to signify that at least one suspend request is active across all
threads. This bit is treated as "some thread is supposed to
suspend, check to see if it's me".
Change-Id: I527dc918f58d1486ef3324136080ef541a775ba8
Diffstat (limited to 'vm/jdwp')
-rw-r--r-- | vm/jdwp/JdwpMain.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/vm/jdwp/JdwpMain.c b/vm/jdwp/JdwpMain.c index 24e5c6c3c..b4471da97 100644 --- a/vm/jdwp/JdwpMain.c +++ b/vm/jdwp/JdwpMain.c @@ -393,7 +393,7 @@ s8 dvmJdwpGetNowMsec(void) */ s8 dvmJdwpLastDebuggerActivity(JdwpState* state) { - if (!gDvm.debuggerActive) { + if (!DEBUGGER_ACTIVE) { LOGD("dvmJdwpLastDebuggerActivity: no active debugger\n"); return -1; } |