diff options
author | Sebastien Hertz <shertz@google.com> | 2014-09-22 10:30:36 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-09-22 10:30:36 +0000 |
commit | c4481dbf1052f4ed9cb88aacbe0533e110fe6c1e (patch) | |
tree | 0d5828445b95226d62b16f94abb5d8200bc282b2 /runtime/jdwp | |
parent | 400376f01747427313d4acf31b5ac508a8e368f7 (diff) | |
parent | 8009f39c6d63181a6cd0e348ce732997dbdf3d20 (diff) | |
download | art-c4481dbf1052f4ed9cb88aacbe0533e110fe6c1e.tar.gz art-c4481dbf1052f4ed9cb88aacbe0533e110fe6c1e.tar.bz2 art-c4481dbf1052f4ed9cb88aacbe0533e110fe6c1e.zip |
Merge "Optimize JDWP stack local values access"
Diffstat (limited to 'runtime/jdwp')
-rw-r--r-- | runtime/jdwp/jdwp_handler.cc | 40 |
1 files changed, 2 insertions, 38 deletions
diff --git a/runtime/jdwp/jdwp_handler.cc b/runtime/jdwp/jdwp_handler.cc index e0a83f607b..16a774fdf0 100644 --- a/runtime/jdwp/jdwp_handler.cc +++ b/runtime/jdwp/jdwp_handler.cc @@ -1385,26 +1385,7 @@ static JdwpError ER_Clear(JdwpState* state, Request* request, ExpandBuf*) */ static JdwpError SF_GetValues(JdwpState*, Request* request, ExpandBuf* pReply) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { - ObjectId thread_id = request->ReadThreadId(); - FrameId frame_id = request->ReadFrameId(); - int32_t slot_count = request->ReadSigned32("slot count"); - - expandBufAdd4BE(pReply, slot_count); /* "int values" */ - for (int32_t i = 0; i < slot_count; ++i) { - uint32_t slot = request->ReadUnsigned32("slot"); - JDWP::JdwpTag reqSigByte = request->ReadTag(); - - VLOG(jdwp) << " --> slot " << slot << " " << reqSigByte; - - size_t width = Dbg::GetTagWidth(reqSigByte); - uint8_t* ptr = expandBufAddSpace(pReply, width+1); - JdwpError error = Dbg::GetLocalValue(thread_id, frame_id, slot, reqSigByte, ptr, width); - if (error != ERR_NONE) { - return error; - } - } - - return ERR_NONE; + return Dbg::GetLocalValues(request, pReply); } /* @@ -1412,24 +1393,7 @@ static JdwpError SF_GetValues(JdwpState*, Request* request, ExpandBuf* pReply) */ static JdwpError SF_SetValues(JdwpState*, Request* request, ExpandBuf*) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { - ObjectId thread_id = request->ReadThreadId(); - FrameId frame_id = request->ReadFrameId(); - int32_t slot_count = request->ReadSigned32("slot count"); - - for (int32_t i = 0; i < slot_count; ++i) { - uint32_t slot = request->ReadUnsigned32("slot"); - JDWP::JdwpTag sigByte = request->ReadTag(); - size_t width = Dbg::GetTagWidth(sigByte); - uint64_t value = request->ReadValue(width); - - VLOG(jdwp) << " --> slot " << slot << " " << sigByte << " " << value; - JdwpError error = Dbg::SetLocalValue(thread_id, frame_id, slot, sigByte, value, width); - if (error != ERR_NONE) { - return error; - } - } - - return ERR_NONE; + return Dbg::SetLocalValues(request); } static JdwpError SF_ThisObject(JdwpState*, Request* request, ExpandBuf* reply) |