diff options
| author | 2012-09-18 08:57:04 -0700 | |
|---|---|---|
| committer | 2012-09-21 17:32:56 -0700 | |
| commit | 66f19258f9728d4ffe026074d8fd429d639802fa (patch) | |
| tree | fd94009774c6cbbb1528ea096e606133bd35f104 /src/stack.cc | |
| parent | a5e1e3d153990845d80cb8d013157210f11a473c (diff) | |
Change dex cache to be java object instead of array, add pointer to dex file in dex cache.
Generic clean up to facilitate having GDB macros for Pretty* helper functions.
Improved cleanliness of DexCache since having it as an object array was not the best solution.
Fixed a bug in InOrderWalk caused by ResolveType sometimes allocating classes.
Rename C++ Method to AbstractMethod and add two new classes Constructor, Method which both inherit from AbstractMethod.
Rename done to have the C++ code be closer to the java code.
Change-Id: I4995b4c5e47a3822192b08afa24a639d3b1f4da9
Diffstat (limited to 'src/stack.cc')
| -rw-r--r-- | src/stack.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/stack.cc b/src/stack.cc index c13aaf4d5e..2567c50568 100644 --- a/src/stack.cc +++ b/src/stack.cc @@ -80,7 +80,7 @@ size_t StackVisitor::GetNativePcOffset() const { } -uint32_t StackVisitor::GetVReg(Method* m, int vreg) const { +uint32_t StackVisitor::GetVReg(AbstractMethod* m, int vreg) const { if (cur_quick_frame_ != NULL) { DCHECK(context_ != NULL); // You can't reliably read registers without a context. DCHECK(m == GetMethod()); @@ -115,7 +115,7 @@ uint32_t StackVisitor::GetVReg(Method* m, int vreg) const { } } -void StackVisitor::SetVReg(Method* m, int vreg, uint32_t new_value) { +void StackVisitor::SetVReg(AbstractMethod* m, int vreg, uint32_t new_value) { if (cur_quick_frame_ != NULL) { DCHECK(context_ != NULL); // You can't reliably write registers without a context. DCHECK(m == GetMethod()); @@ -144,14 +144,14 @@ uintptr_t StackVisitor::GetGPR(uint32_t reg) const { } uintptr_t StackVisitor::GetReturnPc() const { - Method** sp = GetCurrentQuickFrame(); + AbstractMethod** sp = GetCurrentQuickFrame(); CHECK(sp != NULL); byte* pc_addr = reinterpret_cast<byte*>(sp) + GetMethod()->GetReturnPcOffsetInBytes(); return *reinterpret_cast<uintptr_t*>(pc_addr); } void StackVisitor::SetReturnPc(uintptr_t new_ret_pc) { - Method** sp = GetCurrentQuickFrame(); + AbstractMethod** sp = GetCurrentQuickFrame(); CHECK(sp != NULL); byte* pc_addr = reinterpret_cast<byte*>(sp) + GetMethod()->GetReturnPcOffsetInBytes(); *reinterpret_cast<uintptr_t*>(pc_addr) = new_ret_pc; @@ -178,9 +178,9 @@ size_t StackVisitor::ComputeNumFrames() const { void StackVisitor::SanityCheckFrame() const { #ifndef NDEBUG - Method* method = GetMethod(); - CHECK(method->GetClass() == Method::GetMethodClass() || - method->GetClass() == Method::GetConstructorClass()); + AbstractMethod* method = GetMethod(); + CHECK(method->GetClass() == AbstractMethod::GetMethodClass() || + method->GetClass() == AbstractMethod::GetConstructorClass()); if (cur_quick_frame_ != NULL) { method->AssertPcIsWithinCode(cur_quick_frame_pc_); // Frame sanity. @@ -204,7 +204,7 @@ void StackVisitor::WalkStack(bool include_transitions) { if (cur_quick_frame_ != NULL) { // Handle quick stack frames. // Can't be both a shadow and a quick fragment. DCHECK(current_fragment->GetTopShadowFrame() == NULL); - Method* method = *cur_quick_frame_; + AbstractMethod* method = *cur_quick_frame_; do { SanityCheckFrame(); bool should_continue = VisitFrame(); @@ -234,7 +234,7 @@ void StackVisitor::WalkStack(bool include_transitions) { } cur_quick_frame_pc_ = return_pc; byte* next_frame = reinterpret_cast<byte*>(cur_quick_frame_) + frame_size; - cur_quick_frame_ = reinterpret_cast<Method**>(next_frame); + cur_quick_frame_ = reinterpret_cast<AbstractMethod**>(next_frame); cur_depth_++; method = *cur_quick_frame_; } while (method != NULL); |