diff options
Diffstat (limited to 'runtime/stack.cc')
-rw-r--r-- | runtime/stack.cc | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/runtime/stack.cc b/runtime/stack.cc index b8b10d2..0cdc984 100644 --- a/runtime/stack.cc +++ b/runtime/stack.cc @@ -18,6 +18,7 @@ #include "arch/context.h" #include "base/hex_dump.h" +#include "entrypoints/runtime_asm_entrypoints.h" #include "mirror/art_method-inl.h" #include "mirror/class-inl.h" #include "mirror/object.h" @@ -119,7 +120,7 @@ mirror::Object* StackVisitor::GetThisObject() const { } else if (m->IsNative()) { if (cur_quick_frame_ != nullptr) { HandleScope* hs = reinterpret_cast<HandleScope*>( - reinterpret_cast<char*>(cur_quick_frame_) + m->GetHandleScopeOffsetInBytes()); + reinterpret_cast<char*>(cur_quick_frame_) + m->GetHandleScopeOffset().SizeValue()); return hs->GetReference(0); } else { return cur_shadow_frame_->GetVRegReference(0); @@ -143,7 +144,7 @@ mirror::Object* StackVisitor::GetThisObject() const { size_t StackVisitor::GetNativePcOffset() const { DCHECK(!IsShadowFrame()); - return GetMethod()->NativePcOffset(cur_quick_frame_pc_); + return GetMethod()->NativeQuickPcOffset(cur_quick_frame_pc_); } bool StackVisitor::GetVReg(mirror::ArtMethod* m, uint16_t vreg, VRegKind kind, @@ -392,16 +393,16 @@ bool StackVisitor::SetFPR(uint32_t reg, uintptr_t value) { } uintptr_t StackVisitor::GetReturnPc() const { - byte* sp = reinterpret_cast<byte*>(GetCurrentQuickFrame()); + uint8_t* sp = reinterpret_cast<uint8_t*>(GetCurrentQuickFrame()); DCHECK(sp != NULL); - byte* pc_addr = sp + GetMethod()->GetReturnPcOffsetInBytes(); + uint8_t* pc_addr = sp + GetMethod()->GetReturnPcOffset().SizeValue(); return *reinterpret_cast<uintptr_t*>(pc_addr); } void StackVisitor::SetReturnPc(uintptr_t new_ret_pc) { - byte* sp = reinterpret_cast<byte*>(GetCurrentQuickFrame()); + uint8_t* sp = reinterpret_cast<uint8_t*>(GetCurrentQuickFrame()); CHECK(sp != NULL); - byte* pc_addr = sp + GetMethod()->GetReturnPcOffsetInBytes(); + uint8_t* pc_addr = sp + GetMethod()->GetReturnPcOffset().SizeValue(); *reinterpret_cast<uintptr_t*>(pc_addr) = new_ret_pc; } @@ -509,7 +510,7 @@ void StackVisitor::SanityCheckFrame() const { // const size_t kMaxExpectedFrameSize = (256 + 2 + 3 + 3) * sizeof(word); const size_t kMaxExpectedFrameSize = 2 * KB; CHECK_LE(frame_size, kMaxExpectedFrameSize); - size_t return_pc_offset = method->GetReturnPcOffsetInBytes(); + size_t return_pc_offset = method->GetReturnPcOffset().SizeValue(); CHECK_LT(return_pc_offset, frame_size); } } @@ -525,7 +526,7 @@ void StackVisitor::WalkStack(bool include_transitions) { current_fragment = current_fragment->GetLink()) { cur_shadow_frame_ = current_fragment->GetTopShadowFrame(); cur_quick_frame_ = current_fragment->GetTopQuickFrame(); - cur_quick_frame_pc_ = current_fragment->GetTopQuickFramePc(); + cur_quick_frame_pc_ = 0; if (cur_quick_frame_ != NULL) { // Handle quick stack frames. // Can't be both a shadow and a quick fragment. @@ -543,13 +544,13 @@ void StackVisitor::WalkStack(bool include_transitions) { } size_t frame_size = method->GetFrameSizeInBytes(); // Compute PC for next stack frame from return PC. - size_t return_pc_offset = method->GetReturnPcOffsetInBytes(frame_size); - byte* return_pc_addr = reinterpret_cast<byte*>(cur_quick_frame_) + return_pc_offset; + size_t return_pc_offset = method->GetReturnPcOffset(frame_size).SizeValue(); + uint8_t* return_pc_addr = reinterpret_cast<uint8_t*>(cur_quick_frame_) + return_pc_offset; uintptr_t return_pc = *reinterpret_cast<uintptr_t*>(return_pc_addr); if (UNLIKELY(exit_stubs_installed)) { // 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 (GetQuickInstrumentationExitPc() == return_pc) { + if (reinterpret_cast<uintptr_t>(GetQuickInstrumentationExitPc()) == return_pc) { const instrumentation::InstrumentationStackFrame& instrumentation_frame = GetInstrumentationStackFrame(thread_, instrumentation_stack_depth); instrumentation_stack_depth++; @@ -574,7 +575,7 @@ void StackVisitor::WalkStack(bool include_transitions) { } } cur_quick_frame_pc_ = return_pc; - byte* next_frame = reinterpret_cast<byte*>(cur_quick_frame_) + frame_size; + uint8_t* next_frame = reinterpret_cast<uint8_t*>(cur_quick_frame_) + frame_size; cur_quick_frame_ = reinterpret_cast<StackReference<mirror::ArtMethod>*>(next_frame); cur_depth_++; method = cur_quick_frame_->AsMirrorPtr(); |