diff options
author | 2019-09-10 16:46:48 -0700 | |
---|---|---|
committer | 2019-09-11 17:17:22 +0000 | |
commit | 0054aa59c50374751cc65e8de31a1d813912e67d (patch) | |
tree | e09f2fdc04fdfda86b2c7ecb3b980a3687323597 /runtime/java_frame_root_info.h | |
parent | 4945b29e6ea494fffc924f5940601af58d2b28ab (diff) |
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
Diffstat (limited to 'runtime/java_frame_root_info.h')
-rw-r--r-- | runtime/java_frame_root_info.h | 15 |
1 files changed, 15 insertions, 0 deletions
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 <iosfwd> +#include <limits> #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<size_t>::max() > std::numeric_limits<uint16_t>::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<uint16_t>::max(); + JavaFrameRootInfo(uint32_t thread_id, const StackVisitor* stack_visitor, size_t vreg) : RootInfo(kRootJavaFrame, thread_id), stack_visitor_(stack_visitor), vreg_(vreg) { } |