diff options
author | 2018-05-30 22:51:34 +0000 | |
---|---|---|
committer | 2018-05-30 22:51:34 +0000 | |
commit | f5fc6bcdd98f50807756347ac19e8565bce3b6b5 (patch) | |
tree | c8e982bf060f98fb16e95949a94042f0f224361a /runtime/quick_exception_handler.cc | |
parent | 3b562b18ba6128b20d0660ab3823f55a5191b04e (diff) | |
parent | 21d45b4f4ef3661ac33d622aaac5dd6d2ce7deb8 (diff) |
Merge "Simplify DexRegisterMap API."
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(); } } |