summaryrefslogtreecommitdiffstats
path: root/runtime/quick_exception_handler.cc
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2015-05-06 11:34:34 +0100
committerNicolas Geoffray <ngeoffray@google.com>2015-05-11 15:23:25 +0100
commit8e5bd18fc665d7ec5461ea068e98740a65da754c (patch)
tree83441cdfdab06709b573aad2ab731cc65c10b9f1 /runtime/quick_exception_handler.cc
parentcdeb0b5fede4c06488f43a212591e661d946bc78 (diff)
downloadart-8e5bd18fc665d7ec5461ea068e98740a65da754c.zip
art-8e5bd18fc665d7ec5461ea068e98740a65da754c.tar.gz
art-8e5bd18fc665d7ec5461ea068e98740a65da754c.tar.bz2
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/quick_exception_handler.cc')
-rw-r--r--runtime/quick_exception_handler.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/runtime/quick_exception_handler.cc b/runtime/quick_exception_handler.cc
index 9e79bd2..730759a 100644
--- a/runtime/quick_exception_handler.cc
+++ b/runtime/quick_exception_handler.cc
@@ -46,7 +46,9 @@ class CatchBlockStackVisitor FINAL : public StackVisitor {
CatchBlockStackVisitor(Thread* self, Context* context, Handle<mirror::Throwable>* exception,
QuickExceptionHandler* exception_handler)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
- : StackVisitor(self, context), self_(self), exception_(exception),
+ : StackVisitor(self, context, StackVisitor::StackWalkKind::kIncludeInlinedFrames),
+ self_(self),
+ exception_(exception),
exception_handler_(exception_handler) {
}
@@ -160,7 +162,9 @@ class DeoptimizeStackVisitor FINAL : public StackVisitor {
public:
DeoptimizeStackVisitor(Thread* self, Context* context, QuickExceptionHandler* exception_handler)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
- : StackVisitor(self, context), self_(self), exception_handler_(exception_handler),
+ : StackVisitor(self, context, StackVisitor::StackWalkKind::kIncludeInlinedFrames),
+ self_(self),
+ exception_handler_(exception_handler),
prev_shadow_frame_(nullptr) {
CHECK(!self_->HasDeoptimizationShadowFrame());
}
@@ -338,7 +342,7 @@ class InstrumentationStackVisitor : public StackVisitor {
public:
InstrumentationStackVisitor(Thread* self, size_t frame_depth)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
- : StackVisitor(self, nullptr),
+ : StackVisitor(self, nullptr, StackVisitor::StackWalkKind::kIncludeInlinedFrames),
frame_depth_(frame_depth),
instrumentation_frames_to_pop_(0) {
CHECK_NE(frame_depth_, kInvalidFrameDepth);
@@ -349,7 +353,12 @@ class InstrumentationStackVisitor : public StackVisitor {
if (current_frame_depth < frame_depth_) {
CHECK(GetMethod() != nullptr);
if (UNLIKELY(reinterpret_cast<uintptr_t>(GetQuickInstrumentationExitPc()) == GetReturnPc())) {
- ++instrumentation_frames_to_pop_;
+ if (!IsInInlinedFrame()) {
+ // We do not count inlined frames, because we do not instrument them. The reason we
+ // include them in the stack walking is the check against `frame_depth_`, which is
+ // given to us by a visitor that visits inlined frames.
+ ++instrumentation_frames_to_pop_;
+ }
}
return true;
} else {