Elliott Hughes | 68e7652 | 2011-10-05 13:22:16 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include "stack.h" |
| 18 | |
| 19 | #include "compiler.h" |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 20 | #include "oat/runtime/context.h" |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame^] | 21 | #include "mirror/abstract_method-inl.h" |
| 22 | #include "mirror/object.h" |
| 23 | #include "mirror/object-inl.h" |
| 24 | #include "mirror/object_array-inl.h" |
Ian Rogers | 6d4d9fc | 2011-11-30 16:24:48 -0800 | [diff] [blame] | 25 | #include "object_utils.h" |
Elliott Hughes | bfe487b | 2011-10-26 15:48:55 -0700 | [diff] [blame] | 26 | #include "thread_list.h" |
Elliott Hughes | 68e7652 | 2011-10-05 13:22:16 -0700 | [diff] [blame] | 27 | |
Elliott Hughes | 11d1b0c | 2012-01-23 16:57:47 -0800 | [diff] [blame] | 28 | namespace art { |
| 29 | |
TDYa127 | ce4cc0d | 2012-11-18 16:59:53 -0800 | [diff] [blame] | 30 | size_t ManagedStack::NumJniShadowFrameReferences() const { |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 31 | size_t count = 0; |
| 32 | for (const ManagedStack* current_fragment = this; current_fragment != NULL; |
| 33 | current_fragment = current_fragment->GetLink()) { |
| 34 | for (ShadowFrame* current_frame = current_fragment->top_shadow_frame_; current_frame != NULL; |
| 35 | current_frame = current_frame->GetLink()) { |
TDYa127 | ce4cc0d | 2012-11-18 16:59:53 -0800 | [diff] [blame] | 36 | if (current_frame->GetMethod()->IsNative()) { |
| 37 | // The JNI ShadowFrame only contains references. (For indirect reference.) |
| 38 | count += current_frame->NumberOfVRegs(); |
| 39 | } |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 40 | } |
| 41 | } |
| 42 | return count; |
| 43 | } |
| 44 | |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame^] | 45 | bool ManagedStack::ShadowFramesContain(mirror::Object** shadow_frame_entry) const { |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 46 | for (const ManagedStack* current_fragment = this; current_fragment != NULL; |
| 47 | current_fragment = current_fragment->GetLink()) { |
| 48 | for (ShadowFrame* current_frame = current_fragment->top_shadow_frame_; current_frame != NULL; |
| 49 | current_frame = current_frame->GetLink()) { |
| 50 | if (current_frame->Contains(shadow_frame_entry)) { |
| 51 | return true; |
| 52 | } |
| 53 | } |
| 54 | } |
| 55 | return false; |
| 56 | } |
| 57 | |
Ian Rogers | 7a22fa6 | 2013-01-23 12:16:16 -0800 | [diff] [blame] | 58 | StackVisitor::StackVisitor(Thread* thread, Context* context) |
| 59 | : thread_(thread), cur_shadow_frame_(NULL), |
| 60 | cur_quick_frame_(NULL), cur_quick_frame_pc_(0), num_frames_(0), cur_depth_(0), |
| 61 | context_(context) { |
| 62 | DCHECK(thread == Thread::Current() || thread->IsSuspended()); |
| 63 | } |
| 64 | |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 65 | uint32_t StackVisitor::GetDexPc() const { |
| 66 | if (cur_shadow_frame_ != NULL) { |
| 67 | return cur_shadow_frame_->GetDexPC(); |
| 68 | } else if (cur_quick_frame_ != NULL) { |
Ian Rogers | 0c7abda | 2012-09-19 13:33:42 -0700 | [diff] [blame] | 69 | return GetMethod()->ToDexPc(cur_quick_frame_pc_); |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 70 | } else { |
| 71 | return 0; |
| 72 | } |
| 73 | } |
| 74 | |
Ian Rogers | 0c7abda | 2012-09-19 13:33:42 -0700 | [diff] [blame] | 75 | size_t StackVisitor::GetNativePcOffset() const { |
| 76 | DCHECK(!IsShadowFrame()); |
| 77 | return GetMethod()->NativePcOffset(cur_quick_frame_pc_); |
| 78 | } |
| 79 | |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame^] | 80 | uint32_t StackVisitor::GetVReg(mirror::AbstractMethod* m, uint16_t vreg, VRegKind kind) const { |
Ian Rogers | 0ec569a | 2012-07-01 16:43:46 -0700 | [diff] [blame] | 81 | if (cur_quick_frame_ != NULL) { |
| 82 | DCHECK(context_ != NULL); // You can't reliably read registers without a context. |
Ian Rogers | 2bcb4a4 | 2012-11-08 10:39:18 -0800 | [diff] [blame] | 83 | DCHECK(m == GetMethod()); |
Ian Rogers | 0ec569a | 2012-07-01 16:43:46 -0700 | [diff] [blame] | 84 | const VmapTable vmap_table(m->GetVmapTableRaw()); |
| 85 | uint32_t vmap_offset; |
| 86 | // TODO: IsInContext stops before spotting floating point registers. |
Ian Rogers | 2bcb4a4 | 2012-11-08 10:39:18 -0800 | [diff] [blame] | 87 | if (vmap_table.IsInContext(vreg, vmap_offset, kind)) { |
| 88 | bool is_float = (kind == kFloatVReg) || (kind == kDoubleLoVReg) || (kind == kDoubleHiVReg); |
| 89 | uint32_t spill_mask = is_float ? m->GetFpSpillMask() |
| 90 | : m->GetCoreSpillMask(); |
| 91 | return GetGPR(vmap_table.ComputeRegister(spill_mask, vmap_offset, kind)); |
Ian Rogers | 0ec569a | 2012-07-01 16:43:46 -0700 | [diff] [blame] | 92 | } else { |
| 93 | const DexFile::CodeItem* code_item = MethodHelper(m).GetCodeItem(); |
| 94 | DCHECK(code_item != NULL) << PrettyMethod(m); // Can't be NULL or how would we compile its instructions? |
Ian Rogers | 0ec569a | 2012-07-01 16:43:46 -0700 | [diff] [blame] | 95 | size_t frame_size = m->GetFrameSizeInBytes(); |
Ian Rogers | 2bcb4a4 | 2012-11-08 10:39:18 -0800 | [diff] [blame] | 96 | return GetVReg(cur_quick_frame_, code_item, m->GetCoreSpillMask(), m->GetFpSpillMask(), |
| 97 | frame_size, vreg); |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 98 | } |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 99 | } else { |
TDYa127 | 8e950c1 | 2012-11-02 09:58:19 -0700 | [diff] [blame] | 100 | return cur_shadow_frame_->GetVReg(vreg); |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 101 | } |
| 102 | } |
| 103 | |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame^] | 104 | void StackVisitor::SetVReg(mirror::AbstractMethod* m, uint16_t vreg, uint32_t new_value, |
| 105 | VRegKind kind) { |
Ian Rogers | 0ec569a | 2012-07-01 16:43:46 -0700 | [diff] [blame] | 106 | if (cur_quick_frame_ != NULL) { |
| 107 | DCHECK(context_ != NULL); // You can't reliably write registers without a context. |
| 108 | DCHECK(m == GetMethod()); |
| 109 | const VmapTable vmap_table(m->GetVmapTableRaw()); |
| 110 | uint32_t vmap_offset; |
| 111 | // TODO: IsInContext stops before spotting floating point registers. |
Ian Rogers | 2bcb4a4 | 2012-11-08 10:39:18 -0800 | [diff] [blame] | 112 | if (vmap_table.IsInContext(vreg, vmap_offset, kind)) { |
Mathieu Chartier | 6702243 | 2012-11-29 18:04:50 -0800 | [diff] [blame] | 113 | bool is_float = (kind == kFloatVReg) || (kind == kDoubleLoVReg) || (kind == kDoubleHiVReg); |
| 114 | uint32_t spill_mask = is_float ? m->GetFpSpillMask() : m->GetCoreSpillMask(); |
| 115 | const uint32_t reg = vmap_table.ComputeRegister(spill_mask, vmap_offset, kReferenceVReg); |
| 116 | SetGPR(reg, new_value); |
| 117 | } else { |
| 118 | const DexFile::CodeItem* code_item = MethodHelper(m).GetCodeItem(); |
| 119 | DCHECK(code_item != NULL) << PrettyMethod(m); // Can't be NULL or how would we compile its instructions? |
| 120 | uint32_t core_spills = m->GetCoreSpillMask(); |
| 121 | uint32_t fp_spills = m->GetFpSpillMask(); |
| 122 | size_t frame_size = m->GetFrameSizeInBytes(); |
| 123 | int offset = GetVRegOffset(code_item, core_spills, fp_spills, frame_size, vreg); |
| 124 | byte* vreg_addr = reinterpret_cast<byte*>(GetCurrentQuickFrame()) + offset; |
| 125 | *reinterpret_cast<uint32_t*>(vreg_addr) = new_value; |
Ian Rogers | 0ec569a | 2012-07-01 16:43:46 -0700 | [diff] [blame] | 126 | } |
Ian Rogers | 0ec569a | 2012-07-01 16:43:46 -0700 | [diff] [blame] | 127 | } else { |
Ian Rogers | 2bcb4a4 | 2012-11-08 10:39:18 -0800 | [diff] [blame] | 128 | return cur_shadow_frame_->SetVReg(vreg, new_value); |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 129 | } |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 130 | } |
| 131 | |
| 132 | uintptr_t StackVisitor::GetGPR(uint32_t reg) const { |
Ian Rogers | 0ec569a | 2012-07-01 16:43:46 -0700 | [diff] [blame] | 133 | DCHECK (cur_quick_frame_ != NULL) << "This is a quick frame routine"; |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 134 | return context_->GetGPR(reg); |
| 135 | } |
| 136 | |
Mathieu Chartier | 6702243 | 2012-11-29 18:04:50 -0800 | [diff] [blame] | 137 | void StackVisitor::SetGPR(uint32_t reg, uintptr_t value) { |
| 138 | DCHECK (cur_quick_frame_ != NULL) << "This is a quick frame routine"; |
| 139 | context_->SetGPR(reg, value); |
| 140 | } |
| 141 | |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 142 | uintptr_t StackVisitor::GetReturnPc() const { |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame^] | 143 | mirror::AbstractMethod** sp = GetCurrentQuickFrame(); |
Ian Rogers | 2bcb4a4 | 2012-11-08 10:39:18 -0800 | [diff] [blame] | 144 | DCHECK(sp != NULL); |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 145 | byte* pc_addr = reinterpret_cast<byte*>(sp) + GetMethod()->GetReturnPcOffsetInBytes(); |
| 146 | return *reinterpret_cast<uintptr_t*>(pc_addr); |
| 147 | } |
| 148 | |
| 149 | void StackVisitor::SetReturnPc(uintptr_t new_ret_pc) { |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame^] | 150 | mirror::AbstractMethod** sp = GetCurrentQuickFrame(); |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 151 | CHECK(sp != NULL); |
| 152 | byte* pc_addr = reinterpret_cast<byte*>(sp) + GetMethod()->GetReturnPcOffsetInBytes(); |
| 153 | *reinterpret_cast<uintptr_t*>(pc_addr) = new_ret_pc; |
| 154 | } |
| 155 | |
Ian Rogers | 7a22fa6 | 2013-01-23 12:16:16 -0800 | [diff] [blame] | 156 | size_t StackVisitor::ComputeNumFrames(Thread* thread) { |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 157 | struct NumFramesVisitor : public StackVisitor { |
Ian Rogers | 7a22fa6 | 2013-01-23 12:16:16 -0800 | [diff] [blame] | 158 | explicit NumFramesVisitor(Thread* thread) |
| 159 | : StackVisitor(thread, NULL), frames(0) {} |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 160 | |
| 161 | virtual bool VisitFrame() { |
| 162 | frames++; |
| 163 | return true; |
| 164 | } |
Elliott Hughes | 08fc03a | 2012-06-26 17:34:00 -0700 | [diff] [blame] | 165 | |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 166 | size_t frames; |
| 167 | }; |
Ian Rogers | 7a22fa6 | 2013-01-23 12:16:16 -0800 | [diff] [blame] | 168 | NumFramesVisitor visitor(thread); |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 169 | visitor.WalkStack(true); |
| 170 | return visitor.frames; |
| 171 | } |
| 172 | |
Ian Rogers | 7a22fa6 | 2013-01-23 12:16:16 -0800 | [diff] [blame] | 173 | void StackVisitor::DescribeStack(Thread* thread) { |
Ian Rogers | 306057f | 2012-11-26 12:45:53 -0800 | [diff] [blame] | 174 | struct DescribeStackVisitor : public StackVisitor { |
Ian Rogers | 7a22fa6 | 2013-01-23 12:16:16 -0800 | [diff] [blame] | 175 | explicit DescribeStackVisitor(Thread* thread) |
| 176 | : StackVisitor(thread, NULL) {} |
Ian Rogers | 306057f | 2012-11-26 12:45:53 -0800 | [diff] [blame] | 177 | |
| 178 | virtual bool VisitFrame() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { |
| 179 | LOG(INFO) << "Frame Id=" << GetFrameId() << " " << DescribeLocation(); |
| 180 | return true; |
| 181 | } |
| 182 | }; |
Ian Rogers | 7a22fa6 | 2013-01-23 12:16:16 -0800 | [diff] [blame] | 183 | DescribeStackVisitor visitor(thread); |
Ian Rogers | 306057f | 2012-11-26 12:45:53 -0800 | [diff] [blame] | 184 | visitor.WalkStack(true); |
| 185 | } |
| 186 | |
Ian Rogers | 40e3bac | 2012-11-20 00:09:14 -0800 | [diff] [blame] | 187 | std::string StackVisitor::DescribeLocation() const { |
| 188 | std::string result("Visiting method '"); |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame^] | 189 | mirror::AbstractMethod* m = GetMethod(); |
Ian Rogers | 306057f | 2012-11-26 12:45:53 -0800 | [diff] [blame] | 190 | if (m == NULL) { |
| 191 | return "upcall"; |
| 192 | } |
| 193 | result += PrettyMethod(m); |
Ian Rogers | 40e3bac | 2012-11-20 00:09:14 -0800 | [diff] [blame] | 194 | result += StringPrintf("' at dex PC 0x%04zx", GetDexPc()); |
| 195 | if (!IsShadowFrame()) { |
| 196 | result += StringPrintf(" (native PC %p)", reinterpret_cast<void*>(GetCurrentQuickFramePc())); |
| 197 | } |
| 198 | return result; |
| 199 | } |
| 200 | |
Ian Rogers | 7a22fa6 | 2013-01-23 12:16:16 -0800 | [diff] [blame] | 201 | InstrumentationStackFrame StackVisitor::GetInstrumentationStackFrame(uint32_t depth) const { |
| 202 | return thread_->GetInstrumentationStack()->at(depth); |
| 203 | } |
| 204 | |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 205 | void StackVisitor::SanityCheckFrame() const { |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 206 | #ifndef NDEBUG |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame^] | 207 | mirror::AbstractMethod* method = GetMethod(); |
| 208 | CHECK(method->GetClass() == mirror::AbstractMethod::GetMethodClass() || |
| 209 | method->GetClass() == mirror::AbstractMethod::GetConstructorClass()); |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 210 | if (cur_quick_frame_ != NULL) { |
buzbee | 8320f38 | 2012-09-11 16:29:42 -0700 | [diff] [blame] | 211 | method->AssertPcIsWithinCode(cur_quick_frame_pc_); |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 212 | // Frame sanity. |
| 213 | size_t frame_size = method->GetFrameSizeInBytes(); |
| 214 | CHECK_NE(frame_size, 0u); |
| 215 | CHECK_LT(frame_size, 1024u); |
| 216 | size_t return_pc_offset = method->GetReturnPcOffsetInBytes(); |
| 217 | CHECK_LT(return_pc_offset, frame_size); |
| 218 | } |
| 219 | #endif |
| 220 | } |
| 221 | |
| 222 | void StackVisitor::WalkStack(bool include_transitions) { |
Ian Rogers | 7a22fa6 | 2013-01-23 12:16:16 -0800 | [diff] [blame] | 223 | DCHECK(thread_ == Thread::Current() || thread_->IsSuspended()); |
| 224 | const std::deque<InstrumentationStackFrame>* instrumentation_stack = |
| 225 | thread_->GetInstrumentationStack(); |
| 226 | bool method_tracing_active = instrumentation_stack != NULL; |
jeffhao | 725a957 | 2012-11-13 18:20:12 -0800 | [diff] [blame] | 227 | uint32_t instrumentation_stack_depth = 0; |
Ian Rogers | 7a22fa6 | 2013-01-23 12:16:16 -0800 | [diff] [blame] | 228 | for (const ManagedStack* current_fragment = thread_->GetManagedStack(); current_fragment != NULL; |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 229 | current_fragment = current_fragment->GetLink()) { |
| 230 | cur_shadow_frame_ = current_fragment->GetTopShadowFrame(); |
| 231 | cur_quick_frame_ = current_fragment->GetTopQuickFrame(); |
| 232 | cur_quick_frame_pc_ = current_fragment->GetTopQuickFramePc(); |
| 233 | if (cur_quick_frame_ != NULL) { // Handle quick stack frames. |
| 234 | // Can't be both a shadow and a quick fragment. |
| 235 | DCHECK(current_fragment->GetTopShadowFrame() == NULL); |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame^] | 236 | mirror::AbstractMethod* method = *cur_quick_frame_; |
jeffhao | 6641ea1 | 2013-01-02 18:13:42 -0800 | [diff] [blame] | 237 | while (method != NULL) { |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 238 | SanityCheckFrame(); |
| 239 | bool should_continue = VisitFrame(); |
| 240 | if (UNLIKELY(!should_continue)) { |
| 241 | return; |
| 242 | } |
| 243 | if (context_ != NULL) { |
| 244 | context_->FillCalleeSaves(*this); |
| 245 | } |
| 246 | size_t frame_size = method->GetFrameSizeInBytes(); |
| 247 | // Compute PC for next stack frame from return PC. |
| 248 | size_t return_pc_offset = method->GetReturnPcOffsetInBytes(); |
| 249 | byte* return_pc_addr = reinterpret_cast<byte*>(cur_quick_frame_) + return_pc_offset; |
| 250 | uintptr_t return_pc = *reinterpret_cast<uintptr_t*>(return_pc_addr); |
| 251 | if (UNLIKELY(method_tracing_active)) { |
| 252 | // While profiling, the return pc is restored from the side stack, except when walking |
| 253 | // the stack for an exception where the side stack will be unwound in VisitFrame. |
| 254 | // TODO: stop using include_transitions as a proxy for is this the catch block visitor. |
Ian Rogers | 306057f | 2012-11-26 12:45:53 -0800 | [diff] [blame] | 255 | if (GetInstrumentationExitPc() == return_pc && !include_transitions) { |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 256 | // TODO: unify trace and managed stack. |
jeffhao | 725a957 | 2012-11-13 18:20:12 -0800 | [diff] [blame] | 257 | InstrumentationStackFrame instrumentation_frame = GetInstrumentationStackFrame(instrumentation_stack_depth); |
| 258 | instrumentation_stack_depth++; |
| 259 | CHECK(instrumentation_frame.method_ == GetMethod()) << "Excepted: " << PrettyMethod(method) |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 260 | << " Found: " << PrettyMethod(GetMethod()); |
jeffhao | 725a957 | 2012-11-13 18:20:12 -0800 | [diff] [blame] | 261 | return_pc = instrumentation_frame.return_pc_; |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 262 | } |
| 263 | } |
| 264 | cur_quick_frame_pc_ = return_pc; |
| 265 | byte* next_frame = reinterpret_cast<byte*>(cur_quick_frame_) + frame_size; |
Ian Rogers | 2dd0e2c | 2013-01-24 12:42:14 -0800 | [diff] [blame^] | 266 | cur_quick_frame_ = reinterpret_cast<mirror::AbstractMethod**>(next_frame); |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 267 | cur_depth_++; |
| 268 | method = *cur_quick_frame_; |
jeffhao | 6641ea1 | 2013-01-02 18:13:42 -0800 | [diff] [blame] | 269 | } |
Ian Rogers | 0399dde | 2012-06-06 17:09:28 -0700 | [diff] [blame] | 270 | } else if (cur_shadow_frame_ != NULL) { |
| 271 | do { |
| 272 | SanityCheckFrame(); |
| 273 | bool should_continue = VisitFrame(); |
| 274 | if (UNLIKELY(!should_continue)) { |
| 275 | return; |
| 276 | } |
| 277 | cur_depth_++; |
| 278 | cur_shadow_frame_ = cur_shadow_frame_->GetLink(); |
| 279 | } while(cur_shadow_frame_ != NULL); |
| 280 | } |
| 281 | cur_depth_++; |
| 282 | if (include_transitions) { |
| 283 | bool should_continue = VisitFrame(); |
| 284 | if (!should_continue) { |
| 285 | return; |
| 286 | } |
| 287 | } |
| 288 | } |
| 289 | } |
| 290 | |
Elliott Hughes | 68e7652 | 2011-10-05 13:22:16 -0700 | [diff] [blame] | 291 | } // namespace art |