diff options
author | 2024-01-30 14:07:27 +0000 | |
---|---|---|
committer | 2024-04-11 12:38:25 +0000 | |
commit | 53ca944020bb86199f6f80d8594d5deb1b1d46dd (patch) | |
tree | 2898b11cbcd41c3e907de9c08b4031047a8d5187 /compiler/optimizing/code_generation_data.h | |
parent | a7bc7cbf3182cb5c66f7cf36611c0389e7b7cc0f (diff) |
x86_64: Add JIT support for LoadMethodType.
In aosp/2876518 JIT code made runtime calls.
Bug: 297147201
Test: ./art/test/testrunner/testrunner.py --host --64 --jit -b
Test: ./art/test/testrunner/testrunner.py --host --64 -b
Test: ./art/test.py --host -b
Change-Id: Ifdfd3ace9419b34f8079c9ec4b1b2de31cb50ef7
Diffstat (limited to 'compiler/optimizing/code_generation_data.h')
-rw-r--r-- | compiler/optimizing/code_generation_data.h | 30 |
1 files changed, 28 insertions, 2 deletions
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<kArenaAllocCodeGenerator> return jit_class_roots_.size(); } + void ReserveJitMethodTypeRoot(ProtoReference proto_reference, + Handle<mirror::MethodType> method_type) { + jit_method_type_roots_.Overwrite(proto_reference, + reinterpret_cast64<uint64_t>(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<Handle<mirror::Object>>* roots) @@ -97,7 +115,9 @@ class CodeGenerationData : public DeletableArenaObject<kArenaAllocCodeGenerator> 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<kArenaAllocCodeGenerator> // Entries are initially added with a pointer in the handle zone, and `EmitJitRoots` // will compute all the indices. ScopedArenaSafeMap<TypeReference, uint64_t, TypeReferenceValueComparator> 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<ProtoReference, uint64_t, ProtoReferenceValueComparator> + jit_method_type_roots_; }; } // namespace art |