blob: ce12fdee5fbd607db4f6332ec96eef788dabbf8c [file] [log] [blame]
Andreas Gampec7ed09b2016-04-25 20:08:55 -07001/*
2 * Copyright (C) 2016 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_DEFAULT_INIT_ENTRYPOINTS_H_
18#define ART_RUNTIME_ENTRYPOINTS_QUICK_QUICK_DEFAULT_INIT_ENTRYPOINTS_H_
19
Andreas Gampe57943812017-12-06 21:39:13 -080020#include "base/logging.h" // FOR VLOG_IS_ON.
Andreas Gampec7ed09b2016-04-25 20:08:55 -070021#include "entrypoints/jni/jni_entrypoints.h"
22#include "entrypoints/runtime_asm_entrypoints.h"
23#include "quick_alloc_entrypoints.h"
24#include "quick_default_externs.h"
25#include "quick_entrypoints.h"
26
27namespace art {
28
Andreas Gampe8ea4eec2017-05-30 13:53:03 -070029static void DefaultInitEntryPoints(JniEntryPoints* jpoints, QuickEntryPoints* qpoints) {
Andreas Gampec7ed09b2016-04-25 20:08:55 -070030 // JNI
31 jpoints->pDlsymLookup = art_jni_dlsym_lookup_stub;
32
33 // Alloc
Andreas Gampe98ea9d92018-10-19 14:06:15 -070034 ResetQuickAllocEntryPoints(qpoints, /* is_marking= */ true);
Andreas Gampec7ed09b2016-04-25 20:08:55 -070035
Vladimir Markoa9f303c2018-07-20 16:43:56 +010036 // Resolution and initialization
Andreas Gampec7ed09b2016-04-25 20:08:55 -070037 qpoints->pInitializeStaticStorage = art_quick_initialize_static_storage;
Vladimir Marko9d479252018-07-24 11:35:20 +010038 qpoints->pResolveTypeAndVerifyAccess = art_quick_resolve_type_and_verify_access;
39 qpoints->pResolveType = art_quick_resolve_type;
Orion Hodsondbaa5c72018-05-10 08:22:46 +010040 qpoints->pResolveMethodHandle = art_quick_resolve_method_handle;
Orion Hodson18259d72018-04-12 11:18:23 +010041 qpoints->pResolveMethodType = art_quick_resolve_method_type;
Andreas Gampec7ed09b2016-04-25 20:08:55 -070042 qpoints->pResolveString = art_quick_resolve_string;
43
44 // Field
45 qpoints->pSet8Instance = art_quick_set8_instance;
46 qpoints->pSet8Static = art_quick_set8_static;
47 qpoints->pSet16Instance = art_quick_set16_instance;
48 qpoints->pSet16Static = art_quick_set16_static;
49 qpoints->pSet32Instance = art_quick_set32_instance;
50 qpoints->pSet32Static = art_quick_set32_static;
51 qpoints->pSet64Instance = art_quick_set64_instance;
52 qpoints->pSet64Static = art_quick_set64_static;
53 qpoints->pSetObjInstance = art_quick_set_obj_instance;
54 qpoints->pSetObjStatic = art_quick_set_obj_static;
55 qpoints->pGetByteInstance = art_quick_get_byte_instance;
56 qpoints->pGetBooleanInstance = art_quick_get_boolean_instance;
57 qpoints->pGetShortInstance = art_quick_get_short_instance;
58 qpoints->pGetCharInstance = art_quick_get_char_instance;
59 qpoints->pGet32Instance = art_quick_get32_instance;
60 qpoints->pGet64Instance = art_quick_get64_instance;
61 qpoints->pGetObjInstance = art_quick_get_obj_instance;
62 qpoints->pGetByteStatic = art_quick_get_byte_static;
63 qpoints->pGetBooleanStatic = art_quick_get_boolean_static;
64 qpoints->pGetShortStatic = art_quick_get_short_static;
65 qpoints->pGetCharStatic = art_quick_get_char_static;
66 qpoints->pGet32Static = art_quick_get32_static;
67 qpoints->pGet64Static = art_quick_get64_static;
68 qpoints->pGetObjStatic = art_quick_get_obj_static;
69
70 // Array
Andreas Gampec7ed09b2016-04-25 20:08:55 -070071 qpoints->pAputObject = art_quick_aput_obj;
Andreas Gampec7ed09b2016-04-25 20:08:55 -070072
73 // JNI
74 qpoints->pJniMethodStart = JniMethodStart;
Igor Murashkin9d4b6da2016-07-29 09:51:58 -070075 qpoints->pJniMethodFastStart = JniMethodFastStart;
Andreas Gampec7ed09b2016-04-25 20:08:55 -070076 qpoints->pJniMethodStartSynchronized = JniMethodStartSynchronized;
77 qpoints->pJniMethodEnd = JniMethodEnd;
78 qpoints->pJniMethodEndSynchronized = JniMethodEndSynchronized;
79 qpoints->pJniMethodEndWithReference = JniMethodEndWithReference;
Igor Murashkinaf1e2992016-10-12 17:44:50 -070080 qpoints->pJniMethodFastEndWithReference = JniMethodFastEndWithReference;
Andreas Gampec7ed09b2016-04-25 20:08:55 -070081 qpoints->pJniMethodEndWithReferenceSynchronized = JniMethodEndWithReferenceSynchronized;
Igor Murashkin9d4b6da2016-07-29 09:51:58 -070082 qpoints->pJniMethodFastEnd = JniMethodFastEnd;
Andreas Gampec7ed09b2016-04-25 20:08:55 -070083 qpoints->pQuickGenericJniTrampoline = art_quick_generic_jni_trampoline;
84
85 // Locks
86 if (UNLIKELY(VLOG_IS_ON(systrace_lock_logging))) {
87 qpoints->pLockObject = art_quick_lock_object_no_inline;
88 qpoints->pUnlockObject = art_quick_unlock_object_no_inline;
89 } else {
90 qpoints->pLockObject = art_quick_lock_object;
91 qpoints->pUnlockObject = art_quick_unlock_object;
92 }
93
94 // Invocation
95 qpoints->pQuickImtConflictTrampoline = art_quick_imt_conflict_trampoline;
96 qpoints->pQuickResolutionTrampoline = art_quick_resolution_trampoline;
97 qpoints->pQuickToInterpreterBridge = art_quick_to_interpreter_bridge;
98 qpoints->pInvokeDirectTrampolineWithAccessCheck =
99 art_quick_invoke_direct_trampoline_with_access_check;
100 qpoints->pInvokeInterfaceTrampolineWithAccessCheck =
101 art_quick_invoke_interface_trampoline_with_access_check;
102 qpoints->pInvokeStaticTrampolineWithAccessCheck =
103 art_quick_invoke_static_trampoline_with_access_check;
104 qpoints->pInvokeSuperTrampolineWithAccessCheck =
105 art_quick_invoke_super_trampoline_with_access_check;
106 qpoints->pInvokeVirtualTrampolineWithAccessCheck =
107 art_quick_invoke_virtual_trampoline_with_access_check;
Orion Hodsonac141392017-01-13 11:53:47 +0000108 qpoints->pInvokePolymorphic = art_quick_invoke_polymorphic;
Orion Hodson4c8e12e2018-05-18 08:33:20 +0100109 qpoints->pInvokeCustom = art_quick_invoke_custom;
Andreas Gampec7ed09b2016-04-25 20:08:55 -0700110
111 // Thread
112 qpoints->pTestSuspend = art_quick_test_suspend;
113
114 // Throws
115 qpoints->pDeliverException = art_quick_deliver_exception;
116 qpoints->pThrowArrayBounds = art_quick_throw_array_bounds;
117 qpoints->pThrowDivZero = art_quick_throw_div_zero;
Andreas Gampec7ed09b2016-04-25 20:08:55 -0700118 qpoints->pThrowNullPointer = art_quick_throw_null_pointer_exception;
119 qpoints->pThrowStackOverflow = art_quick_throw_stack_overflow;
Vladimir Marko87f3fcb2016-04-28 15:52:11 +0100120 qpoints->pThrowStringBounds = art_quick_throw_string_bounds;
Andreas Gampec7ed09b2016-04-25 20:08:55 -0700121
122 // Deoptimize
123 qpoints->pDeoptimize = art_quick_deoptimize_from_compiled_code;
Igor Murashkin2ffb7032017-11-08 13:35:21 -0800124}
Andreas Gampec7ed09b2016-04-25 20:08:55 -0700125
126} // namespace art
127
128#endif // ART_RUNTIME_ENTRYPOINTS_QUICK_QUICK_DEFAULT_INIT_ENTRYPOINTS_H_