summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generation_data.h
diff options
context:
space:
mode:
author Almaz Mingaleev <mingaleev@google.com> 2024-04-12 07:15:38 +0000
committer Almaz Mingaleev <mingaleev@google.com> 2024-07-02 13:36:08 +0000
commit55f1fed0c404146429d38c41b9dd1647db238ba5 (patch)
tree882436a95c9b9932b7717710c8ce778fa30785c9 /compiler/optimizing/code_generation_data.h
parent6a44606e6b27eb04e911cab0adec627014e678ff (diff)
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
Diffstat (limited to 'compiler/optimizing/code_generation_data.h')
-rw-r--r--compiler/optimizing/code_generation_data.h30
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