diff options
author | 2018-06-13 18:20:45 +0100 | |
---|---|---|
committer | 2018-06-14 12:31:44 +0100 | |
commit | e1402125e8363b49e176c6072893d1c110a05d2f (patch) | |
tree | 44ec055be78cdcb8086a598cbf791f8c4627e157 /runtime/stack.cc | |
parent | 86decb6a3e3ebba8c3c67bfd25c12d9a85794f65 (diff) |
Move some helper methods to DexRegisterLocation.
Test: test-art-host-gtest-stack_map_test
Change-Id: I0abab008159db023d531df69214cd3bb8c0639bd
Diffstat (limited to 'runtime/stack.cc')
-rw-r--r-- | runtime/stack.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/runtime/stack.cc b/runtime/stack.cc index 56e47b9c77..2188cdc301 100644 --- a/runtime/stack.cc +++ b/runtime/stack.cc @@ -242,10 +242,10 @@ bool StackVisitor::GetVRegFromOptimizedCode(ArtMethod* m, uint16_t vreg, VRegKin return false; } DCHECK_EQ(dex_register_map.size(), number_of_dex_registers); - DexRegisterLocation::Kind location_kind = dex_register_map.GetLocationKind(vreg); + DexRegisterLocation::Kind location_kind = dex_register_map[vreg].GetKind(); switch (location_kind) { case DexRegisterLocation::Kind::kInStack: { - const int32_t offset = dex_register_map.GetStackOffsetInBytes(vreg); + const int32_t offset = dex_register_map[vreg].GetStackOffsetInBytes(); const uint8_t* addr = reinterpret_cast<const uint8_t*>(cur_quick_frame_) + offset; *val = *reinterpret_cast<const uint32_t*>(addr); return true; @@ -254,18 +254,16 @@ bool StackVisitor::GetVRegFromOptimizedCode(ArtMethod* m, uint16_t vreg, VRegKin case DexRegisterLocation::Kind::kInRegisterHigh: case DexRegisterLocation::Kind::kInFpuRegister: case DexRegisterLocation::Kind::kInFpuRegisterHigh: { - uint32_t reg = dex_register_map.GetMachineRegister(vreg); + uint32_t reg = dex_register_map[vreg].GetMachineRegister(); return GetRegisterIfAccessible(reg, kind, val); } case DexRegisterLocation::Kind::kConstant: - *val = dex_register_map.GetConstant(vreg); + *val = dex_register_map[vreg].GetConstant(); return true; case DexRegisterLocation::Kind::kNone: return false; default: - LOG(FATAL) - << "Unexpected location kind " - << dex_register_map.GetLocationInternalKind(vreg); + LOG(FATAL) << "Unexpected location kind " << dex_register_map[vreg].GetKind(); UNREACHABLE(); } } |