diff options
| author | 2016-12-02 14:52:29 -0800 | |
|---|---|---|
| committer | 2016-12-12 11:47:02 -0800 | |
| commit | 585da955bc8e5040705dcfd941b2131025ebcef8 (patch) | |
| tree | d22555ab3b33b446271fcbbd1676177d21d7221f /runtime/stack.cc | |
| parent | ce29d1813914ee9a9e9b04b034968f09694dd557 (diff) | |
ART: Add precise root visiting
Add VisitRootFlags::kVisitRootFlagPrecise to signal a
request for precise RootInfo objects.
Move VisitRootFlags to gc_root.h. Refactor VisitRoot
functions to pass flags. Add code in Thread visiting
to decode vregs in compiled code.
Bug: 31385354
Test: m test-art-host
Change-Id: I8e7280f0ab682871f729f2a1c6b18670cf2dbf82
Diffstat (limited to 'runtime/stack.cc')
| -rw-r--r-- | runtime/stack.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/runtime/stack.cc b/runtime/stack.cc index f20aa201aa..792da88a63 100644 --- a/runtime/stack.cc +++ b/runtime/stack.cc @@ -614,12 +614,6 @@ std::string StackVisitor::DescribeLocation() const { return result; } -static instrumentation::InstrumentationStackFrame& GetInstrumentationStackFrame(Thread* thread, - uint32_t depth) { - CHECK_LT(depth, thread->GetInstrumentationStack()->size()); - return thread->GetInstrumentationStack()->at(depth); -} - static void AssertPcIsWithinQuickCode(ArtMethod* method, uintptr_t pc) REQUIRES_SHARED(Locks::mutator_lock_) { if (method->IsNative() || method->IsRuntimeMethod() || method->IsProxyMethod()) { @@ -777,6 +771,7 @@ QuickMethodFrameInfo StackVisitor::GetCurrentQuickFrameInfo() const { return QuickMethodFrameInfo(frame_size, callee_info.CoreSpillMask(), callee_info.FpSpillMask()); } +template <StackVisitor::CountTransitions kCount> void StackVisitor::WalkStack(bool include_transitions) { DCHECK(thread_ == Thread::Current() || thread_->IsSuspended()); CHECK_EQ(cur_depth_, 0U); @@ -842,8 +837,9 @@ void StackVisitor::WalkStack(bool include_transitions) { // While profiling, the return pc is restored from the side stack, except when walking // the stack for an exception where the side stack will be unwound in VisitFrame. if (reinterpret_cast<uintptr_t>(GetQuickInstrumentationExitPc()) == return_pc) { + CHECK_LT(instrumentation_stack_depth, thread_->GetInstrumentationStack()->size()); const instrumentation::InstrumentationStackFrame& instrumentation_frame = - GetInstrumentationStackFrame(thread_, instrumentation_stack_depth); + thread_->GetInstrumentationStack()->at(instrumentation_stack_depth); instrumentation_stack_depth++; if (GetMethod() == Runtime::Current()->GetCalleeSaveMethod(Runtime::kSaveAllCalleeSaves)) { @@ -907,13 +903,18 @@ void StackVisitor::WalkStack(bool include_transitions) { return; } } - cur_depth_++; + if (kCount == CountTransitions::kYes) { + cur_depth_++; + } } if (num_frames_ != 0) { CHECK_EQ(cur_depth_, num_frames_); } } +template void StackVisitor::WalkStack<StackVisitor::CountTransitions::kYes>(bool); +template void StackVisitor::WalkStack<StackVisitor::CountTransitions::kNo>(bool); + void JavaFrameRootInfo::Describe(std::ostream& os) const { const StackVisitor* visitor = stack_visitor_; CHECK(visitor != nullptr); |