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
diff --git a/runtime/stack.h b/runtime/stack.h
index 8a446ec..992bda5 100644
--- a/runtime/stack.h
+++ b/runtime/stack.h
@@ -469,14 +469,21 @@
}
};
-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 @@
return num_frames_;
}
- size_t GetFrameDepth() REQUIRES_SHARED(Locks::mutator_lock_) {
+ size_t GetFrameDepth() const REQUIRES_SHARED(Locks::mutator_lock_) {
return cur_depth_;
}