diff options
author | Sebastien Hertz <shertz@google.com> | 2014-06-17 15:52:45 +0200 |
---|---|---|
committer | Sebastien Hertz <shertz@google.com> | 2014-06-17 16:00:54 +0200 |
commit | 0bcb2902ec21393d71c94e63aa6733cb5311a0cc (patch) | |
tree | 10beb60b5a8d212afdf0e7e58c5dfcbee691be2e /runtime/stack.h | |
parent | 838b38fa3b2fb4a64f8a316459d372020f6e8feb (diff) | |
download | art-0bcb2902ec21393d71c94e63aa6733cb5311a0cc.zip art-0bcb2902ec21393d71c94e63aa6733cb5311a0cc.tar.gz art-0bcb2902ec21393d71c94e63aa6733cb5311a0cc.tar.bz2 |
Revert "Revert "Fix access to FP registers when visiting stack""
This reverts commit 8ebd94ab2e0d9867a7d384f00fa4cab24235216f.
Fixes StackVisitor::GetVReg to read register value in a uintptr_t local and
cast it into uint32_t pointer argument.
Bug: 15433097
Change-Id: I4e13ed5446e823e9ec50fbc378b16be5b17b2294
Diffstat (limited to 'runtime/stack.h')
-rw-r--r-- | runtime/stack.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/runtime/stack.h b/runtime/stack.h index 1991115..9402cdd 100644 --- a/runtime/stack.h +++ b/runtime/stack.h @@ -561,15 +561,21 @@ class StackVisitor { bool GetNextMethodAndDexPc(mirror::ArtMethod** next_method, uint32_t* next_dex_pc) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); - uint32_t GetVReg(mirror::ArtMethod* m, uint16_t vreg, VRegKind kind) const + bool GetVReg(mirror::ArtMethod* m, uint16_t vreg, VRegKind kind, uint32_t* val) const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); - void SetVReg(mirror::ArtMethod* m, uint16_t vreg, uint32_t new_value, VRegKind kind) + uint32_t GetVReg(mirror::ArtMethod* m, uint16_t vreg, VRegKind kind) const + SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { + uint32_t val; + bool success = GetVReg(m, vreg, kind, &val); + CHECK(success) << "Failed to read vreg " << vreg << " of kind " << kind; + return val; + } + + bool SetVReg(mirror::ArtMethod* m, uint16_t vreg, uint32_t new_value, VRegKind kind) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); uintptr_t* GetGPRAddress(uint32_t reg) const; - uintptr_t GetGPR(uint32_t reg) const; - void SetGPR(uint32_t reg, uintptr_t value); // This is a fast-path for getting/setting values in a quick frame. uint32_t* GetVRegAddr(StackReference<mirror::ArtMethod>* cur_quick_frame, @@ -700,6 +706,11 @@ class StackVisitor { StackVisitor(Thread* thread, Context* context, size_t num_frames) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); + bool GetGPR(uint32_t reg, uintptr_t* val) const; + bool SetGPR(uint32_t reg, uintptr_t value); + bool GetFPR(uint32_t reg, uintptr_t* val) const; + bool SetFPR(uint32_t reg, uintptr_t value); + instrumentation::InstrumentationStackFrame& GetInstrumentationStackFrame(uint32_t depth) const; void SanityCheckFrame() const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); |