From 0054aa59c50374751cc65e8de31a1d813912e67d Mon Sep 17 00:00:00 2001 From: Alex Light Date: Tue, 10 Sep 2019 16:46:48 -0700 Subject: Have JavaFrameRootInfo give more info about provenance of root. It can be useful to differentiate between java frame roots being the methods declaring class, from a proxy method, being unknown due to an imprecise walk or being indeterminable. This passes that information with the Vreg. Test: ./test.py --host Bug: 134162467 Change-Id: I74842d3eeedee5c836511e046652502a53de0f7e --- runtime/java_frame_root_info.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'runtime/java_frame_root_info.h') diff --git a/runtime/java_frame_root_info.h b/runtime/java_frame_root_info.h index 8141ea24fd..c21eee1b32 100644 --- a/runtime/java_frame_root_info.h +++ b/runtime/java_frame_root_info.h @@ -18,6 +18,7 @@ #define ART_RUNTIME_JAVA_FRAME_ROOT_INFO_H_ #include +#include #include "base/locks.h" #include "base/macros.h" @@ -29,6 +30,20 @@ class StackVisitor; class JavaFrameRootInfo final : public RootInfo { public: + static_assert(std::numeric_limits::max() > std::numeric_limits::max(), + "No extra space in vreg to store meta-data"); + // Unable to determine what register number the root is from. + static constexpr size_t kUnknownVreg = -1; + // The register number for the root might be determinable but we did not attempt to find that + // information. + static constexpr size_t kImpreciseVreg = -2; + // The root is from the declaring class of the current method. + static constexpr size_t kMethodDeclaringClass = -3; + // The root is from the argument to a Proxy invoke. + static constexpr size_t kProxyReferenceArgument = -4; + // The maximum precise vreg number + static constexpr size_t kMaxVReg = std::numeric_limits::max(); + JavaFrameRootInfo(uint32_t thread_id, const StackVisitor* stack_visitor, size_t vreg) : RootInfo(kRootJavaFrame, thread_id), stack_visitor_(stack_visitor), vreg_(vreg) { } -- cgit v1.2.3-59-g8ed1b