From 3f0981b56a1b9a415383c552c063b890c840b13e Mon Sep 17 00:00:00 2001 From: Almaz Mingaleev Date: Fri, 15 Dec 2023 15:47:22 +0000 Subject: Revert^2 "x86_64: Store resolved MethodType-s in .bss." This reverts commit d014fd019e84471665ac02f2de285541009892cd. Reason for revert: fix codegen to do runtime call in JIT for now. Bug: 297147201 Test: ./art/test/testrunner/testrunner.py --host --64 --optimizing -b Test: ./art/test/testrunner/testrunner.py --jvm -b Test: ./art/test.py --host -b Test: ./art/test/testrunner/testrunner.py --host --64 --jit -b Change-Id: I0f01c8391b09659bb6195955ecd8f88159141872 --- compiler/linker/linker_patch.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'compiler/linker/linker_patch.h') diff --git a/compiler/linker/linker_patch.h b/compiler/linker/linker_patch.h index 8ed7fce0ff..133088240b 100644 --- a/compiler/linker/linker_patch.h +++ b/compiler/linker/linker_patch.h @@ -56,6 +56,7 @@ class LinkerPatch { kPackageTypeBssEntry, kStringRelative, kStringBssEntry, + kMethodTypeBssEntry, kCallEntrypoint, kBakerReadBarrierBranch, }; @@ -176,6 +177,16 @@ class LinkerPatch { return patch; } + static LinkerPatch MethodTypeBssEntryPatch(size_t literal_offset, + const DexFile* target_dex_file, + uint32_t pc_insn_offset, + uint32_t target_proto_idx) { + LinkerPatch patch(literal_offset, Type::kMethodTypeBssEntry, target_dex_file); + patch.proto_idx_ = target_proto_idx; + patch.pc_insn_offset_ = pc_insn_offset; + return patch; + } + static LinkerPatch CallEntrypointPatch(size_t literal_offset, uint32_t entrypoint_offset) { LinkerPatch patch(literal_offset, @@ -253,6 +264,16 @@ class LinkerPatch { return dex::StringIndex(string_idx_); } + const DexFile* TargetProtoDexFile() const { + DCHECK(patch_type_ == Type::kMethodTypeBssEntry); + return target_dex_file_; + } + + dex::ProtoIndex TargetProtoIndex() const { + DCHECK(patch_type_ == Type::kMethodTypeBssEntry); + return dex::ProtoIndex(proto_idx_); + } + uint32_t PcInsnOffset() const { DCHECK(patch_type_ == Type::kIntrinsicReference || patch_type_ == Type::kDataBimgRelRo || @@ -305,12 +326,14 @@ class LinkerPatch { uint32_t method_idx_; // Method index for Call/Method patches. uint32_t type_idx_; // Type index for Type patches. uint32_t string_idx_; // String index for String patches. + uint32_t proto_idx_; // Proto index for MethodType patches. uint32_t intrinsic_data_; // Data for IntrinsicObjects. uint32_t entrypoint_offset_; // Entrypoint offset in the Thread object. uint32_t baker_custom_value1_; static_assert(sizeof(method_idx_) == sizeof(cmp1_), "needed by relational operators"); static_assert(sizeof(type_idx_) == sizeof(cmp1_), "needed by relational operators"); static_assert(sizeof(string_idx_) == sizeof(cmp1_), "needed by relational operators"); + static_assert(sizeof(proto_idx_) == sizeof(cmp1_), "needed by relational operators"); static_assert(sizeof(intrinsic_data_) == sizeof(cmp1_), "needed by relational operators"); static_assert(sizeof(baker_custom_value1_) == sizeof(cmp1_), "needed by relational operators"); }; -- cgit v1.2.3-59-g8ed1b