summaryrefslogtreecommitdiffstats
path: root/runtime/debugger.h
diff options
context:
space:
mode:
authorSebastien Hertz <shertz@google.com>2014-09-01 17:07:11 +0200
committerSebastien Hertz <shertz@google.com>2014-09-22 11:29:36 +0200
commit8009f39c6d63181a6cd0e348ce732997dbdf3d20 (patch)
treeff02473e6b0951364234a6038ae19a0875b7bdd7 /runtime/debugger.h
parent5cdd0734d2f79eedc530f5f1e876cd2110e29c86 (diff)
downloadart-8009f39c6d63181a6cd0e348ce732997dbdf3d20.zip
art-8009f39c6d63181a6cd0e348ce732997dbdf3d20.tar.gz
art-8009f39c6d63181a6cd0e348ce732997dbdf3d20.tar.bz2
Optimize JDWP stack local values access
The StackFrame.GetValues and StackFrame.SetValues JDWP commands can refer to multiple variables at the same time in a given frame. However we used to walk the stack until getting to the requested frame for each variable. Now, we walk the stack only once until getting to the frame so the context is initialized. Then we read/write value for each variable from this context. Bug: 17343501 Bug: 15680615 Change-Id: I2a4128f29a3c5856b994e280037c0a09eb48c5c8
Diffstat (limited to 'runtime/debugger.h')
-rw-r--r--runtime/debugger.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/runtime/debugger.h b/runtime/debugger.h
index 97985ec..cb7adae 100644
--- a/runtime/debugger.h
+++ b/runtime/debugger.h
@@ -45,6 +45,7 @@ class Throwable;
class AllocRecord;
class ObjectRegistry;
class ScopedObjectAccessUnchecked;
+class StackVisitor;
class Thread;
class ThrowLocation;
@@ -475,12 +476,10 @@ class Dbg {
LOCKS_EXCLUDED(Locks::thread_list_lock_,
Locks::thread_suspend_count_lock_)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- static JDWP::JdwpError GetLocalValue(JDWP::ObjectId thread_id, JDWP::FrameId frame_id, int slot,
- JDWP::JdwpTag tag, uint8_t* buf, size_t expectedLen)
+ static JDWP::JdwpError GetLocalValues(JDWP::Request* request, JDWP::ExpandBuf* pReply)
LOCKS_EXCLUDED(Locks::thread_list_lock_)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- static JDWP::JdwpError SetLocalValue(JDWP::ObjectId thread_id, JDWP::FrameId frame_id, int slot,
- JDWP::JdwpTag tag, uint64_t value, size_t width)
+ static JDWP::JdwpError SetLocalValues(JDWP::Request* request)
LOCKS_EXCLUDED(Locks::thread_list_lock_)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
@@ -641,6 +640,16 @@ class Dbg {
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
private:
+ static JDWP::JdwpError GetLocalValue(const StackVisitor& visitor,
+ ScopedObjectAccessUnchecked& soa, int slot,
+ JDWP::JdwpTag tag, uint8_t* buf, size_t width)
+ LOCKS_EXCLUDED(Locks::thread_list_lock_)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+ static JDWP::JdwpError SetLocalValue(StackVisitor& visitor, int slot, JDWP::JdwpTag tag,
+ uint64_t value, size_t width)
+ LOCKS_EXCLUDED(Locks::thread_list_lock_)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+
static void DdmBroadcast(bool connect) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
static void PostThreadStartOrStop(Thread*, uint32_t)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);