summaryrefslogtreecommitdiff
path: root/runtime/stack.cc
diff options
context:
space:
mode:
author Sebastien Hertz <shertz@google.com> 2015-10-12 07:07:29 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-10-12 07:07:29 +0000
commit89792b9c5ed09dda2937944b69b1b2016807b6aa (patch)
treeb17f003a121f0b1a27bd237dfbc83c2514538f99 /runtime/stack.cc
parent296a7dc68449fb49d47bf2cb93f1ed469bc3228b (diff)
parent3079e28b00accd19aa1153929fb00497d00956d9 (diff)
Merge "Fix instrumentation frame check with inlining"
Diffstat (limited to 'runtime/stack.cc')
-rw-r--r--runtime/stack.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/runtime/stack.cc b/runtime/stack.cc
index 1d21a6494a..840c0cb3e2 100644
--- a/runtime/stack.cc
+++ b/runtime/stack.cc
@@ -891,6 +891,7 @@ void StackVisitor::WalkStack(bool include_transitions) {
CHECK_EQ(cur_depth_, 0U);
bool exit_stubs_installed = Runtime::Current()->GetInstrumentation()->AreExitStubsInstalled();
uint32_t instrumentation_stack_depth = 0;
+ size_t inlined_frames_count = 0;
for (const ManagedStack* current_fragment = thread_->GetManagedStack();
current_fragment != nullptr; current_fragment = current_fragment->GetLink()) {
@@ -922,6 +923,7 @@ void StackVisitor::WalkStack(bool include_transitions) {
return;
}
cur_depth_++;
+ inlined_frames_count++;
}
}
}
@@ -952,16 +954,19 @@ void StackVisitor::WalkStack(bool include_transitions) {
ArtMethod* callee = Runtime::Current()->GetCalleeSaveMethod(Runtime::kRefsAndArgs);
CHECK_EQ(GetMethod(), callee) << "Expected: " << PrettyMethod(callee) << " Found: "
<< PrettyMethod(GetMethod());
- } else if (instrumentation_frame.method_ != GetMethod()) {
- LOG(FATAL) << "Expected: " << PrettyMethod(instrumentation_frame.method_)
- << " Found: " << PrettyMethod(GetMethod());
+ } else {
+ CHECK_EQ(instrumentation_frame.method_, GetMethod())
+ << "Expected: " << PrettyMethod(instrumentation_frame.method_)
+ << " Found: " << PrettyMethod(GetMethod());
}
if (num_frames_ != 0) {
// Check agreement of frame Ids only if num_frames_ is computed to avoid infinite
// recursion.
- CHECK(instrumentation_frame.frame_id_ == GetFrameId())
- << "Expected: " << instrumentation_frame.frame_id_
- << " Found: " << GetFrameId();
+ size_t frame_id = instrumentation::Instrumentation::ComputeFrameId(
+ thread_,
+ cur_depth_,
+ inlined_frames_count);
+ CHECK_EQ(instrumentation_frame.frame_id_, frame_id);
}
return_pc = instrumentation_frame.return_pc_;
}