xref: /aosp_15_r20/art/runtime/entrypoints/quick/quick_entrypoints.h (revision 795d594fd825385562da6b089ea9b2033f3abf5a)
1 /*
2  * Copyright (C) 2012 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef ART_RUNTIME_ENTRYPOINTS_QUICK_QUICK_ENTRYPOINTS_H_
18 #define ART_RUNTIME_ENTRYPOINTS_QUICK_QUICK_ENTRYPOINTS_H_
19 
20 #include <jni.h>
21 
22 #include "base/locks.h"
23 #include "base/macros.h"
24 #include "deoptimization_kind.h"
25 #include "offsets.h"
26 
27 #define QUICK_ENTRYPOINT_OFFSET(ptr_size, x) \
28     Thread::QuickEntryPointOffset<ptr_size>(OFFSETOF_MEMBER(QuickEntryPoints, x))
29 
30 namespace art HIDDEN {
31 
32 namespace mirror {
33 class Array;
34 class Class;
35 template<class MirrorType> class CompressedReference;
36 class Object;
37 class String;
38 }  // namespace mirror
39 
40 class ArtMethod;
41 template<class MirrorType> class GcRoot;
42 template<class MirrorType> class StackReference;
43 class Thread;
44 
45 // Pointers to functions that are called by quick compiler generated code via thread-local storage.
46 struct QuickEntryPoints {
47 #define ENTRYPOINT_ENUM(name, rettype, ...) \
48   void* p##name;                            \
49   void Set##name(rettype (*fn)(__VA_ARGS__)) { p##name = reinterpret_cast<void*>(fn); }
50 #include "quick_entrypoints_list.h"
51   QUICK_ENTRYPOINT_LIST(ENTRYPOINT_ENUM)
52 #undef QUICK_ENTRYPOINT_LIST
53 #undef ENTRYPOINT_ENUM
54 };
55 
56 // JNI entrypoints.
57 extern mirror::Object* JniDecodeReferenceResult(jobject result, Thread* self)
58     REQUIRES_SHARED(Locks::mutator_lock_) HOT_ATTR;
59 
60 }  // namespace art
61 
62 #endif  // ART_RUNTIME_ENTRYPOINTS_QUICK_QUICK_ENTRYPOINTS_H_
63