Add tests for Thumb2RelativePatcher.
Also make the thumb2/arm64 thunk allocation precise instead
of eagerly allocating thunk space. This allows the calls to
use the maximum positive offset.
Change-Id: Ifa95b0bb00bd73eeab0c2905d21e2f3078f4b0a8
diff --git a/compiler/linker/arm64/relative_patcher_arm64.cc b/compiler/linker/arm64/relative_patcher_arm64.cc
index bac3001..b61b3d8 100644
--- a/compiler/linker/arm64/relative_patcher_arm64.cc
+++ b/compiler/linker/arm64/relative_patcher_arm64.cc
@@ -41,10 +41,11 @@
}
uint32_t Arm64RelativePatcher::ReserveSpace(uint32_t offset,
- const CompiledMethod* compiled_method) {
+ const CompiledMethod* compiled_method,
+ MethodReference method_ref) {
if (!fix_cortex_a53_843419_) {
DCHECK(adrp_thunk_locations_.empty());
- return ReserveSpaceInternal(offset, compiled_method, 0u);
+ return ReserveSpaceInternal(offset, compiled_method, method_ref, 0u);
}
// Add thunks for previous method if any.
@@ -65,7 +66,7 @@
}
}
}
- offset = ReserveSpaceInternal(offset, compiled_method, kAdrpThunkSize * num_adrp);
+ offset = ReserveSpaceInternal(offset, compiled_method, method_ref, kAdrpThunkSize * num_adrp);
if (num_adrp == 0u) {
return offset;
}