diff options
| author | 2018-05-30 06:35:05 +0100 | |
|---|---|---|
| committer | 2018-05-30 17:59:24 +0100 | |
| commit | 21d45b4f4ef3661ac33d622aaac5dd6d2ce7deb8 (patch) | |
| tree | 121e046a949025bca4d766fdfdc5ea58e4ea4a10 /runtime/quick_exception_handler.cc | |
| parent | d02b23f7ee9664213216a82bfdcb0ee83824de04 (diff) | |
Simplify DexRegisterMap API.
Store some of the needed decoding state explicitly to avoid passing it
around all the time. The DexRegisterMap class is rewritten in next CL.
Test: test-art-host-gtest-stack_map_test
Change-Id: Ie268dff2a1c1da2e08f0e6799ae51c30e11f350b
Diffstat (limited to 'runtime/quick_exception_handler.cc')
| -rw-r--r-- | runtime/quick_exception_handler.cc | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/runtime/quick_exception_handler.cc b/runtime/quick_exception_handler.cc index 26489209b8..63a09f25a4 100644 --- a/runtime/quick_exception_handler.cc +++ b/runtime/quick_exception_handler.cc @@ -246,8 +246,7 @@ void QuickExceptionHandler::SetCatchEnvironmentForOptimizedHandler(StackVisitor* // Copy values between them. for (uint16_t vreg = 0; vreg < number_of_vregs; ++vreg) { - DexRegisterLocation::Kind catch_location = - catch_vreg_map.GetLocationKind(vreg, number_of_vregs, code_info); + DexRegisterLocation::Kind catch_location = catch_vreg_map.GetLocationKind(vreg); if (catch_location == DexRegisterLocation::Kind::kNone) { continue; } @@ -255,9 +254,7 @@ void QuickExceptionHandler::SetCatchEnvironmentForOptimizedHandler(StackVisitor* // Get vreg value from its current location. uint32_t vreg_value; - VRegKind vreg_kind = ToVRegKind(throw_vreg_map.GetLocationKind(vreg, - number_of_vregs, - code_info)); + VRegKind vreg_kind = ToVRegKind(throw_vreg_map.GetLocationKind(vreg)); bool get_vreg_success = stack_visitor->GetVReg(stack_visitor->GetMethod(), vreg, vreg_kind, @@ -268,9 +265,7 @@ void QuickExceptionHandler::SetCatchEnvironmentForOptimizedHandler(StackVisitor* << "native_pc_offset=" << stack_visitor->GetNativePcOffset() << ")"; // Copy value to the catch phi's stack slot. - int32_t slot_offset = catch_vreg_map.GetStackOffsetInBytes(vreg, - number_of_vregs, - code_info); + int32_t slot_offset = catch_vreg_map.GetStackOffsetInBytes(vreg); ArtMethod** frame_top = stack_visitor->GetCurrentQuickFrame(); uint8_t* slot_address = reinterpret_cast<uint8_t*>(frame_top) + slot_offset; uint32_t* slot_ptr = reinterpret_cast<uint32_t*>(slot_address); @@ -425,17 +420,14 @@ class DeoptimizeStackVisitor FINAL : public StackVisitor { continue; } - DexRegisterLocation::Kind location = - vreg_map.GetLocationKind(vreg, number_of_vregs, code_info); + DexRegisterLocation::Kind location = vreg_map.GetLocationKind(vreg); static constexpr uint32_t kDeadValue = 0xEBADDE09; uint32_t value = kDeadValue; bool is_reference = false; switch (location) { case DexRegisterLocation::Kind::kInStack: { - const int32_t offset = vreg_map.GetStackOffsetInBytes(vreg, - number_of_vregs, - code_info); + const int32_t offset = vreg_map.GetStackOffsetInBytes(vreg); const uint8_t* addr = reinterpret_cast<const uint8_t*>(GetCurrentQuickFrame()) + offset; value = *reinterpret_cast<const uint32_t*>(addr); uint32_t bit = (offset >> 2); @@ -448,7 +440,7 @@ class DeoptimizeStackVisitor FINAL : public StackVisitor { case DexRegisterLocation::Kind::kInRegisterHigh: case DexRegisterLocation::Kind::kInFpuRegister: case DexRegisterLocation::Kind::kInFpuRegisterHigh: { - uint32_t reg = vreg_map.GetMachineRegister(vreg, number_of_vregs, code_info); + uint32_t reg = vreg_map.GetMachineRegister(vreg); bool result = GetRegisterIfAccessible(reg, ToVRegKind(location), &value); CHECK(result); if (location == DexRegisterLocation::Kind::kInRegister) { @@ -459,7 +451,7 @@ class DeoptimizeStackVisitor FINAL : public StackVisitor { break; } case DexRegisterLocation::Kind::kConstant: { - value = vreg_map.GetConstant(vreg, number_of_vregs, code_info); + value = vreg_map.GetConstant(vreg); if (value == 0) { // Make it a reference for extra safety. is_reference = true; @@ -472,9 +464,7 @@ class DeoptimizeStackVisitor FINAL : public StackVisitor { default: { LOG(FATAL) << "Unexpected location kind " - << vreg_map.GetLocationInternalKind(vreg, - number_of_vregs, - code_info); + << vreg_map.GetLocationInternalKind(vreg); UNREACHABLE(); } } |