summaryrefslogtreecommitdiffstats
path: root/runtime/stack.h
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2015-03-12 15:05:13 +0000
committerNicolas Geoffray <ngeoffray@google.com>2015-03-13 10:26:47 +0000
commit15b9d5274399736ac09705f0507df24fac4f00c1 (patch)
tree04564a9265f5dccefdd32ea7bdd25adc0267f80b /runtime/stack.h
parent8bc616d09f93523f4bc982cc60c377b00161522a (diff)
downloadart-15b9d5274399736ac09705f0507df24fac4f00c1.zip
art-15b9d5274399736ac09705f0507df24fac4f00c1.tar.gz
art-15b9d5274399736ac09705f0507df24fac4f00c1.tar.bz2
API change in StackVisitor::GetVReg*.
- Remove GetVReg() and SetVReg() that were expecting to always succeed. - Change Quick-only methods to take a FromQuickCode suffix. - Change deopt to use dead values when GetVReg does not succeed: the optimizing compiler will not have a location for uninitialized Dex registers and potentially dead registers. Change-Id: Ida05773a97aff8aa69e0caf42ea961f80f854b77
Diffstat (limited to 'runtime/stack.h')
-rw-r--r--runtime/stack.h36
1 files changed, 9 insertions, 27 deletions
diff --git a/runtime/stack.h b/runtime/stack.h
index 13bd47f..aab54ba 100644
--- a/runtime/stack.h
+++ b/runtime/stack.h
@@ -486,29 +486,10 @@ class StackVisitor {
bool GetVReg(mirror::ArtMethod* m, uint16_t vreg, VRegKind kind, uint32_t* val) const
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- 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 v" << vreg << " of kind " << kind << " in method "
- << PrettyMethod(m);
- return val;
- }
-
bool GetVRegPair(mirror::ArtMethod* m, uint16_t vreg, VRegKind kind_lo, VRegKind kind_hi,
uint64_t* val) const
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- uint64_t GetVRegPair(mirror::ArtMethod* m, uint16_t vreg, VRegKind kind_lo,
- VRegKind kind_hi) const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
- uint64_t val;
- bool success = GetVRegPair(m, vreg, kind_lo, kind_hi, &val);
- CHECK(success) << "Failed to read vreg pair " << vreg
- << " of kind [" << kind_lo << "," << kind_hi << "] in method "
- << PrettyMethod(m);
- return val;
- }
-
bool SetVReg(mirror::ArtMethod* m, uint16_t vreg, uint32_t new_value, VRegKind kind)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
@@ -519,11 +500,12 @@ class StackVisitor {
uintptr_t* GetGPRAddress(uint32_t reg) const;
// This is a fast-path for getting/setting values in a quick frame.
- uint32_t* GetVRegAddr(StackReference<mirror::ArtMethod>* cur_quick_frame,
- const DexFile::CodeItem* code_item,
- uint32_t core_spills, uint32_t fp_spills, size_t frame_size,
- uint16_t vreg) const {
- int offset = GetVRegOffset(code_item, core_spills, fp_spills, frame_size, vreg, kRuntimeISA);
+ uint32_t* GetVRegAddrFromQuickCode(StackReference<mirror::ArtMethod>* cur_quick_frame,
+ const DexFile::CodeItem* code_item,
+ uint32_t core_spills, uint32_t fp_spills, size_t frame_size,
+ uint16_t vreg) const {
+ int offset = GetVRegOffsetFromQuickCode(
+ code_item, core_spills, fp_spills, frame_size, vreg, kRuntimeISA);
DCHECK_EQ(cur_quick_frame, GetCurrentQuickFrame());
uint8_t* vreg_addr = reinterpret_cast<uint8_t*>(cur_quick_frame) + offset;
return reinterpret_cast<uint32_t*>(vreg_addr);
@@ -582,9 +564,9 @@ class StackVisitor {
* | StackReference<ArtMethod> | ... (reg == num_total_code_regs == special_temp_value) <<== sp, 16-byte aligned
* +===============================+
*/
- static int GetVRegOffset(const DexFile::CodeItem* code_item,
- uint32_t core_spills, uint32_t fp_spills,
- size_t frame_size, int reg, InstructionSet isa) {
+ static int GetVRegOffsetFromQuickCode(const DexFile::CodeItem* code_item,
+ uint32_t core_spills, uint32_t fp_spills,
+ size_t frame_size, int reg, InstructionSet isa) {
DCHECK_EQ(frame_size & (kStackAlignment - 1), 0U);
DCHECK_NE(reg, -1);
int spill_size = POPCOUNT(core_spills) * GetBytesPerGprSpillLocation(isa)