Clean up AtomicDexRefMap
Make ClassReference, TypeReference, and MethodReference extend
DexFileReference. This enables using all of these types as the key
for AtomicDexRefMap.
Test: test-art-host
Bug: 63851220
Bug: 63756964
Change-Id: Ida3c94cadb53272cb5057e5cebc5971c1ab4d366
diff --git a/compiler/optimizing/code_generator_arm64.cc b/compiler/optimizing/code_generator_arm64.cc
index 19e5d06..c61ef0a 100644
--- a/compiler/optimizing/code_generator_arm64.cc
+++ b/compiler/optimizing/code_generator_arm64.cc
@@ -4641,7 +4641,7 @@
MethodReference target_method,
vixl::aarch64::Label* adrp_label) {
return NewPcRelativePatch(*target_method.dex_file,
- target_method.dex_method_index,
+ target_method.index,
adrp_label,
&pc_relative_method_patches_);
}
@@ -4650,7 +4650,7 @@
MethodReference target_method,
vixl::aarch64::Label* adrp_label) {
return NewPcRelativePatch(*target_method.dex_file,
- target_method.dex_method_index,
+ target_method.index,
adrp_label,
&method_bss_entry_patches_);
}
diff --git a/compiler/optimizing/code_generator_arm_vixl.cc b/compiler/optimizing/code_generator_arm_vixl.cc
index 8b9495d..6147259 100644
--- a/compiler/optimizing/code_generator_arm_vixl.cc
+++ b/compiler/optimizing/code_generator_arm_vixl.cc
@@ -9119,14 +9119,14 @@
CodeGeneratorARMVIXL::PcRelativePatchInfo* CodeGeneratorARMVIXL::NewPcRelativeMethodPatch(
MethodReference target_method) {
return NewPcRelativePatch(*target_method.dex_file,
- target_method.dex_method_index,
+ target_method.index,
&pc_relative_method_patches_);
}
CodeGeneratorARMVIXL::PcRelativePatchInfo* CodeGeneratorARMVIXL::NewMethodBssEntryPatch(
MethodReference target_method) {
return NewPcRelativePatch(*target_method.dex_file,
- target_method.dex_method_index,
+ target_method.index,
&method_bss_entry_patches_);
}
diff --git a/compiler/optimizing/code_generator_mips.cc b/compiler/optimizing/code_generator_mips.cc
index f0ef007..9db2bd3 100644
--- a/compiler/optimizing/code_generator_mips.cc
+++ b/compiler/optimizing/code_generator_mips.cc
@@ -1683,7 +1683,7 @@
MethodReference target_method,
const PcRelativePatchInfo* info_high) {
return NewPcRelativePatch(*target_method.dex_file,
- target_method.dex_method_index,
+ target_method.index,
info_high,
&pc_relative_method_patches_);
}
@@ -1692,7 +1692,7 @@
MethodReference target_method,
const PcRelativePatchInfo* info_high) {
return NewPcRelativePatch(*target_method.dex_file,
- target_method.dex_method_index,
+ target_method.index,
info_high,
&method_bss_entry_patches_);
}
diff --git a/compiler/optimizing/code_generator_mips64.cc b/compiler/optimizing/code_generator_mips64.cc
index 201b1b0..a27cbce 100644
--- a/compiler/optimizing/code_generator_mips64.cc
+++ b/compiler/optimizing/code_generator_mips64.cc
@@ -1592,7 +1592,7 @@
MethodReference target_method,
const PcRelativePatchInfo* info_high) {
return NewPcRelativePatch(*target_method.dex_file,
- target_method.dex_method_index,
+ target_method.index,
info_high,
&pc_relative_method_patches_);
}
@@ -1601,7 +1601,7 @@
MethodReference target_method,
const PcRelativePatchInfo* info_high) {
return NewPcRelativePatch(*target_method.dex_file,
- target_method.dex_method_index,
+ target_method.index,
info_high,
&method_bss_entry_patches_);
}
diff --git a/compiler/optimizing/code_generator_x86.cc b/compiler/optimizing/code_generator_x86.cc
index e45ad0a..c153cf7 100644
--- a/compiler/optimizing/code_generator_x86.cc
+++ b/compiler/optimizing/code_generator_x86.cc
@@ -4623,7 +4623,7 @@
invoke->InputAt(invoke->GetSpecialInputIndex())->AsX86ComputeBaseMethodAddress();
boot_image_method_patches_.emplace_back(address,
*invoke->GetTargetMethod().dex_file,
- invoke->GetTargetMethod().dex_method_index);
+ invoke->GetTargetMethod().index);
__ Bind(&boot_image_method_patches_.back().label);
}
@@ -4633,7 +4633,7 @@
// Add the patch entry and bind its label at the end of the instruction.
method_bss_entry_patches_.emplace_back(method_address,
*target_method.dex_file,
- target_method.dex_method_index);
+ target_method.index);
return &method_bss_entry_patches_.back().label;
}
diff --git a/compiler/optimizing/code_generator_x86_64.cc b/compiler/optimizing/code_generator_x86_64.cc
index 8c4374d..bbf05a7 100644
--- a/compiler/optimizing/code_generator_x86_64.cc
+++ b/compiler/optimizing/code_generator_x86_64.cc
@@ -1068,13 +1068,13 @@
void CodeGeneratorX86_64::RecordBootMethodPatch(HInvokeStaticOrDirect* invoke) {
boot_image_method_patches_.emplace_back(*invoke->GetTargetMethod().dex_file,
- invoke->GetTargetMethod().dex_method_index);
+ invoke->GetTargetMethod().index);
__ Bind(&boot_image_method_patches_.back().label);
}
Label* CodeGeneratorX86_64::NewMethodBssEntryPatch(MethodReference target_method) {
// Add a patch entry and return the label.
- method_bss_entry_patches_.emplace_back(*target_method.dex_file, target_method.dex_method_index);
+ method_bss_entry_patches_.emplace_back(*target_method.dex_file, target_method.index);
return &method_bss_entry_patches_.back().label;
}