From 140da3bc84df5fff08f092b3143416e44319ebed Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Tue, 8 Nov 2016 16:01:00 -0800 Subject: ART: Expose vreg and visitor in RootInfo Expose the register and visitor in JavaFrameRootInfo, to be able to investigate a root programmatically. Also mark StackVisitor::GetFrameDepth() as a const function. Bug: 31385354 Test: m test-art-host Change-Id: Ie05d2cfe3f4e9def89311bb18bd0c0bbf1a45625 --- runtime/stack.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'runtime/stack.h') diff --git a/runtime/stack.h b/runtime/stack.h index 8a446ecfd4..992bda5a1e 100644 --- a/runtime/stack.h +++ b/runtime/stack.h @@ -469,14 +469,21 @@ struct ShadowFrameDeleter { } }; -class JavaFrameRootInfo : public RootInfo { +class JavaFrameRootInfo FINAL : public RootInfo { public: JavaFrameRootInfo(uint32_t thread_id, const StackVisitor* stack_visitor, size_t vreg) : RootInfo(kRootJavaFrame, thread_id), stack_visitor_(stack_visitor), vreg_(vreg) { } - virtual void Describe(std::ostream& os) const OVERRIDE + void Describe(std::ostream& os) const OVERRIDE REQUIRES_SHARED(Locks::mutator_lock_); + size_t GetVReg() const { + return vreg_; + } + const StackVisitor* GetVisitor() const { + return stack_visitor_; + } + private: const StackVisitor* const stack_visitor_; const size_t vreg_; @@ -623,7 +630,7 @@ class StackVisitor { return num_frames_; } - size_t GetFrameDepth() REQUIRES_SHARED(Locks::mutator_lock_) { + size_t GetFrameDepth() const REQUIRES_SHARED(Locks::mutator_lock_) { return cur_depth_; } -- cgit v1.2.3-59-g8ed1b