diff options
| author | 2018-06-03 12:00:22 +0100 | |
|---|---|---|
| committer | 2018-06-07 12:00:18 +0100 | |
| commit | fd89b0739d4000ea70f28bf53dea531027024f5a (patch) | |
| tree | 1c9f3e1b046d60df405fb63f04cf83d3be4ff0f5 /runtime/quick_exception_handler.cc | |
| parent | 6de8833fb64e59301eada4005ed04da995796170 (diff) | |
Remove unused GetDexRegisterMap arguments.
They are no longer needed in the new encoding.
I reuse the local variables in most places to DCHECK the size
of the decoded register map. This has one catch though:
We sometimes omit all dex registers, so the DCHECK should be
done only after checking if the map is empty (if applicable).
Test: test-art-host-gtest-stack_map_test
Change-Id: I94b67029842374bc8eb7c9e5eac76fc93a651f24
Diffstat (limited to 'runtime/quick_exception_handler.cc')
| -rw-r--r-- | runtime/quick_exception_handler.cc | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/runtime/quick_exception_handler.cc b/runtime/quick_exception_handler.cc index 23ccf6ad58..cf1cbe7f7b 100644 --- a/runtime/quick_exception_handler.cc +++ b/runtime/quick_exception_handler.cc @@ -230,19 +230,18 @@ void QuickExceptionHandler::SetCatchEnvironmentForOptimizedHandler(StackVisitor* // Find stack map of the catch block. StackMap catch_stack_map = code_info.GetCatchStackMapForDexPc(GetHandlerDexPc()); DCHECK(catch_stack_map.IsValid()); - DexRegisterMap catch_vreg_map = - code_info.GetDexRegisterMapOf(catch_stack_map, number_of_vregs); - if (!catch_vreg_map.IsValid() || !catch_vreg_map.HasAnyLiveDexRegisters()) { + DexRegisterMap catch_vreg_map = code_info.GetDexRegisterMapOf(catch_stack_map); + if (!catch_vreg_map.HasAnyLiveDexRegisters()) { return; } + DCHECK_EQ(catch_vreg_map.size(), number_of_vregs); // Find stack map of the throwing instruction. StackMap throw_stack_map = code_info.GetStackMapForNativePcOffset(stack_visitor->GetNativePcOffset()); DCHECK(throw_stack_map.IsValid()); - DexRegisterMap throw_vreg_map = - code_info.GetDexRegisterMapOf(throw_stack_map, number_of_vregs); - DCHECK(throw_vreg_map.IsValid()); + DexRegisterMap throw_vreg_map = code_info.GetDexRegisterMapOf(throw_stack_map); + DCHECK_EQ(throw_vreg_map.size(), number_of_vregs); // Copy values between them. for (uint16_t vreg = 0; vreg < number_of_vregs; ++vreg) { @@ -405,14 +404,12 @@ class DeoptimizeStackVisitor FINAL : public StackVisitor { uint32_t register_mask = code_info.GetRegisterMaskOf(stack_map); BitMemoryRegion stack_mask = code_info.GetStackMaskOf(stack_map); DexRegisterMap vreg_map = IsInInlinedFrame() - ? code_info.GetDexRegisterMapAtDepth(GetCurrentInliningDepth() - 1, - stack_map, - number_of_vregs) - : code_info.GetDexRegisterMapOf(stack_map, number_of_vregs); - - if (!vreg_map.IsValid()) { + ? code_info.GetDexRegisterMapAtDepth(GetCurrentInliningDepth() - 1, stack_map) + : code_info.GetDexRegisterMapOf(stack_map); + if (vreg_map.empty()) { return; } + DCHECK_EQ(vreg_map.size(), number_of_vregs); for (uint16_t vreg = 0; vreg < number_of_vregs; ++vreg) { if (updated_vregs != nullptr && updated_vregs[vreg]) { |