summaryrefslogtreecommitdiff
path: root/runtime/thread.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2015-05-06 11:34:34 +0100
committer Nicolas Geoffray <ngeoffray@google.com> 2015-05-11 15:23:25 +0100
commit8e5bd18fc665d7ec5461ea068e98740a65da754c (patch)
tree83441cdfdab06709b573aad2ab731cc65c10b9f1 /runtime/thread.cc
parentcdeb0b5fede4c06488f43a212591e661d946bc78 (diff)
Add a flag to StackVisitor for inlining.
The flag tells whether the stack walk needs to include inlined Java frames. This does not do anything just yet, as we're not inlining anyways. Change-Id: I716e25094fe56fa335ca1f9a398c1bcdba478e73
Diffstat (limited to 'runtime/thread.cc')
-rw-r--r--runtime/thread.cc32
1 files changed, 23 insertions, 9 deletions
diff --git a/runtime/thread.cc b/runtime/thread.cc
index 605a1b5419..b7cfc7299d 100644
--- a/runtime/thread.cc
+++ b/runtime/thread.cc
@@ -940,10 +940,14 @@ void Thread::DumpState(std::ostream& os) const {
struct StackDumpVisitor : public StackVisitor {
StackDumpVisitor(std::ostream& os_in, Thread* thread_in, Context* context, bool can_allocate_in)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
- : StackVisitor(thread_in, context), os(os_in), thread(thread_in),
- can_allocate(can_allocate_in), last_method(nullptr), last_line_number(0),
- repetition_count(0), frame_count(0) {
- }
+ : StackVisitor(thread_in, context, StackVisitor::StackWalkKind::kIncludeInlinedFrames),
+ os(os_in),
+ thread(thread_in),
+ can_allocate(can_allocate_in),
+ last_method(nullptr),
+ last_line_number(0),
+ repetition_count(0),
+ frame_count(0) {}
virtual ~StackDumpVisitor() {
if (frame_count == 0) {
@@ -1528,7 +1532,7 @@ class CountStackDepthVisitor : public StackVisitor {
public:
explicit CountStackDepthVisitor(Thread* thread)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
- : StackVisitor(thread, nullptr),
+ : StackVisitor(thread, nullptr, StackVisitor::StackWalkKind::kIncludeInlinedFrames),
depth_(0), skip_depth_(0), skipping_(true) {}
bool VisitFrame() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
@@ -1568,8 +1572,12 @@ template<bool kTransactionActive>
class BuildInternalStackTraceVisitor : public StackVisitor {
public:
explicit BuildInternalStackTraceVisitor(Thread* self, Thread* thread, int skip_depth)
- : StackVisitor(thread, nullptr), self_(self),
- skip_depth_(skip_depth), count_(0), dex_pc_trace_(nullptr), method_trace_(nullptr) {}
+ : StackVisitor(thread, nullptr, StackVisitor::StackWalkKind::kIncludeInlinedFrames),
+ self_(self),
+ skip_depth_(skip_depth),
+ count_(0),
+ dex_pc_trace_(nullptr),
+ method_trace_(nullptr) {}
bool Init(int depth)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
@@ -2111,7 +2119,10 @@ Context* Thread::GetLongJumpContext() {
struct CurrentMethodVisitor FINAL : public StackVisitor {
CurrentMethodVisitor(Thread* thread, Context* context, bool abort_on_error)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
- : StackVisitor(thread, context), this_object_(nullptr), method_(nullptr), dex_pc_(0),
+ : StackVisitor(thread, context, StackVisitor::StackWalkKind::kIncludeInlinedFrames),
+ this_object_(nullptr),
+ method_(nullptr),
+ dex_pc_(0),
abort_on_error_(abort_on_error) {}
bool VisitFrame() OVERRIDE SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
mirror::ArtMethod* m = GetMethod();
@@ -2154,7 +2165,10 @@ class ReferenceMapVisitor : public StackVisitor {
public:
ReferenceMapVisitor(Thread* thread, Context* context, RootVisitor& visitor)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
- : StackVisitor(thread, context), visitor_(visitor) {}
+ // We are visiting the references in compiled frames, so we do not need
+ // to know the inlined frames.
+ : StackVisitor(thread, context, StackVisitor::StackWalkKind::kSkipInlinedFrames),
+ visitor_(visitor) {}
bool VisitFrame() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
if (false) {