ART: Tentative fix for stack count issue in test 913
Use kCountTransition == kNo to also skip runtime methods in the
cur_depth_ count of a StackVisitor.
Currently this is only used in the VisitRoots function of Thread.
If the additional load is too expensive, we can make this dependent
on the requested precision (and thus revert "regular" visits to
the old scheme of also counting transitions between managed stack
frames and shadow frames, which is only an increment of a field).
Bug: 31385354
Bug: 32072923
Test: m test-art-host
Change-Id: Ief951585407dd6e03f8050774fe612e7b204247e
diff --git a/runtime/stack.cc b/runtime/stack.cc
index 333128b..5c6eead 100644
--- a/runtime/stack.cc
+++ b/runtime/stack.cc
@@ -913,7 +913,9 @@
<< " next=" << *cur_quick_frame_;
}
- cur_depth_++;
+ if (kCount == CountTransitions::kYes || !method->IsRuntimeMethod()) {
+ cur_depth_++;
+ }
method = *cur_quick_frame_;
}
} else if (cur_shadow_frame_ != nullptr) {