From 55f1fed0c404146429d38c41b9dd1647db238ba5 Mon Sep 17 00:00:00 2001 From: Almaz Mingaleev Date: Fri, 12 Apr 2024 07:15:38 +0000 Subject: Revert^4 "x86_64: Add JIT support for LoadMethodType." This reverts commit b63adc919ba9a53f4fbad476356c702845821149. Bringing back map from ArtMethod to code pointers. Bug: 297147201 Test: CtsPerfettoTestCases Test: ./art/test/testrunner/testrunner.py --host --64 --jit -b Test: ./art/test/testrunner/testrunner.py --host --64 --jit --cms -b Test: ./art/test/testrunner/testrunner.py --host --64 -b Test: ./art/test.py --host -b Change-Id: I6a1c50598ec878393edf8ef895274da79d4ab42d --- compiler/optimizing/code_generation_data.h | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/code_generation_data.h') diff --git a/compiler/optimizing/code_generation_data.h b/compiler/optimizing/code_generation_data.h index e78ba8f574..0d4db66ab4 100644 --- a/compiler/optimizing/code_generation_data.h +++ b/compiler/optimizing/code_generation_data.h @@ -23,10 +23,12 @@ #include "base/scoped_arena_allocator.h" #include "base/scoped_arena_containers.h" #include "code_generator.h" +#include "dex/proto_reference.h" #include "dex/string_reference.h" #include "dex/type_reference.h" #include "handle.h" #include "mirror/class.h" +#include "mirror/method_type.h" #include "mirror/object.h" #include "mirror/string.h" #include "stack_map_stream.h" @@ -82,8 +84,24 @@ class CodeGenerationData : public DeletableArenaObject return jit_class_roots_.size(); } + void ReserveJitMethodTypeRoot(ProtoReference proto_reference, + Handle method_type) { + jit_method_type_roots_.Overwrite(proto_reference, + reinterpret_cast64(method_type.GetReference())); + } + + uint64_t GetJitMethodTypeRootIndex(ProtoReference proto_reference) const { + return jit_method_type_roots_.Get(proto_reference); + } + + size_t GetNumberOfJitMethodTypeRoots() const { + return jit_method_type_roots_.size(); + } + size_t GetNumberOfJitRoots() const { - return GetNumberOfJitStringRoots() + GetNumberOfJitClassRoots(); + return GetNumberOfJitStringRoots() + + GetNumberOfJitClassRoots() + + GetNumberOfJitMethodTypeRoots(); } void EmitJitRoots(/*out*/std::vector>* roots) @@ -97,7 +115,9 @@ class CodeGenerationData : public DeletableArenaObject jit_string_roots_(StringReferenceValueComparator(), allocator_.Adapter(kArenaAllocCodeGenerator)), jit_class_roots_(TypeReferenceValueComparator(), - allocator_.Adapter(kArenaAllocCodeGenerator)) { + allocator_.Adapter(kArenaAllocCodeGenerator)), + jit_method_type_roots_(ProtoReferenceValueComparator(), + allocator_.Adapter(kArenaAllocCodeGenerator)) { slow_paths_.reserve(kDefaultSlowPathsCapacity); } @@ -116,6 +136,12 @@ class CodeGenerationData : public DeletableArenaObject // Entries are initially added with a pointer in the handle zone, and `EmitJitRoots` // will compute all the indices. ScopedArenaSafeMap jit_class_roots_; + + // Maps a ProtoReference (dex_file, proto_index) to the index in the literal table. + // Entries are initially added with a pointer in the handle zone, and `EmitJitRoots` + // will compute all the indices. + ScopedArenaSafeMap + jit_method_type_roots_; }; } // namespace art -- cgit v1.2.3-59-g8ed1b