| Andreas Gampe | c7ed09b | 2016-04-25 20:08:55 -0700 | [diff] [blame] | 1 | /* |
| 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 Gampe | 5794381 | 2017-12-06 21:39:13 -0800 | [diff] [blame] | 20 | #include "base/logging.h" // FOR VLOG_IS_ON. |
| Andreas Gampe | c7ed09b | 2016-04-25 20:08:55 -0700 | [diff] [blame] | 21 | #include "entrypoints/jni/jni_entrypoints.h" |
| 22 | #include "entrypoints/runtime_asm_entrypoints.h" |
| Nicolas Geoffray | c3db254 | 2021-04-20 15:50:04 +0000 | [diff] [blame] | 23 | #include "palette/palette.h" |
| Andreas Gampe | c7ed09b | 2016-04-25 20:08:55 -0700 | [diff] [blame] | 24 | #include "quick_alloc_entrypoints.h" |
| 25 | #include "quick_default_externs.h" |
| 26 | #include "quick_entrypoints.h" |
| 27 | |
| 28 | namespace art { |
| 29 | |
| Andreas Gampe | 8ea4eec | 2017-05-30 13:53:03 -0700 | [diff] [blame] | 30 | static void DefaultInitEntryPoints(JniEntryPoints* jpoints, QuickEntryPoints* qpoints) { |
| Andreas Gampe | c7ed09b | 2016-04-25 20:08:55 -0700 | [diff] [blame] | 31 | // JNI |
| 32 | jpoints->pDlsymLookup = art_jni_dlsym_lookup_stub; |
| Vladimir Marko | fa458ac | 2020-02-12 14:08:07 +0000 | [diff] [blame] | 33 | jpoints->pDlsymLookupCritical = art_jni_dlsym_lookup_critical_stub; |
| Andreas Gampe | c7ed09b | 2016-04-25 20:08:55 -0700 | [diff] [blame] | 34 | |
| 35 | // Alloc |
| Lokesh Gidra | 7e678d3 | 2020-04-28 16:17:49 -0700 | [diff] [blame] | 36 | ResetQuickAllocEntryPoints(qpoints); |
| Andreas Gampe | c7ed09b | 2016-04-25 20:08:55 -0700 | [diff] [blame] | 37 | |
| Vladimir Marko | a9f303c | 2018-07-20 16:43:56 +0100 | [diff] [blame] | 38 | // Resolution and initialization |
| Andreas Gampe | c7ed09b | 2016-04-25 20:08:55 -0700 | [diff] [blame] | 39 | qpoints->pInitializeStaticStorage = art_quick_initialize_static_storage; |
| Vladimir Marko | 9d47925 | 2018-07-24 11:35:20 +0100 | [diff] [blame] | 40 | qpoints->pResolveTypeAndVerifyAccess = art_quick_resolve_type_and_verify_access; |
| 41 | qpoints->pResolveType = art_quick_resolve_type; |
| Orion Hodson | dbaa5c7 | 2018-05-10 08:22:46 +0100 | [diff] [blame] | 42 | qpoints->pResolveMethodHandle = art_quick_resolve_method_handle; |
| Orion Hodson | 18259d7 | 2018-04-12 11:18:23 +0100 | [diff] [blame] | 43 | qpoints->pResolveMethodType = art_quick_resolve_method_type; |
| Andreas Gampe | c7ed09b | 2016-04-25 20:08:55 -0700 | [diff] [blame] | 44 | qpoints->pResolveString = art_quick_resolve_string; |
| 45 | |
| 46 | // Field |
| 47 | qpoints->pSet8Instance = art_quick_set8_instance; |
| 48 | qpoints->pSet8Static = art_quick_set8_static; |
| 49 | qpoints->pSet16Instance = art_quick_set16_instance; |
| 50 | qpoints->pSet16Static = art_quick_set16_static; |
| 51 | qpoints->pSet32Instance = art_quick_set32_instance; |
| 52 | qpoints->pSet32Static = art_quick_set32_static; |
| 53 | qpoints->pSet64Instance = art_quick_set64_instance; |
| 54 | qpoints->pSet64Static = art_quick_set64_static; |
| 55 | qpoints->pSetObjInstance = art_quick_set_obj_instance; |
| 56 | qpoints->pSetObjStatic = art_quick_set_obj_static; |
| 57 | qpoints->pGetByteInstance = art_quick_get_byte_instance; |
| 58 | qpoints->pGetBooleanInstance = art_quick_get_boolean_instance; |
| 59 | qpoints->pGetShortInstance = art_quick_get_short_instance; |
| 60 | qpoints->pGetCharInstance = art_quick_get_char_instance; |
| 61 | qpoints->pGet32Instance = art_quick_get32_instance; |
| 62 | qpoints->pGet64Instance = art_quick_get64_instance; |
| 63 | qpoints->pGetObjInstance = art_quick_get_obj_instance; |
| 64 | qpoints->pGetByteStatic = art_quick_get_byte_static; |
| 65 | qpoints->pGetBooleanStatic = art_quick_get_boolean_static; |
| 66 | qpoints->pGetShortStatic = art_quick_get_short_static; |
| 67 | qpoints->pGetCharStatic = art_quick_get_char_static; |
| 68 | qpoints->pGet32Static = art_quick_get32_static; |
| 69 | qpoints->pGet64Static = art_quick_get64_static; |
| 70 | qpoints->pGetObjStatic = art_quick_get_obj_static; |
| 71 | |
| 72 | // Array |
| Andreas Gampe | c7ed09b | 2016-04-25 20:08:55 -0700 | [diff] [blame] | 73 | qpoints->pAputObject = art_quick_aput_obj; |
| Andreas Gampe | c7ed09b | 2016-04-25 20:08:55 -0700 | [diff] [blame] | 74 | |
| 75 | // JNI |
| 76 | qpoints->pJniMethodStart = JniMethodStart; |
| Igor Murashkin | 9d4b6da | 2016-07-29 09:51:58 -0700 | [diff] [blame] | 77 | qpoints->pJniMethodFastStart = JniMethodFastStart; |
| Andreas Gampe | c7ed09b | 2016-04-25 20:08:55 -0700 | [diff] [blame] | 78 | qpoints->pJniMethodStartSynchronized = JniMethodStartSynchronized; |
| 79 | qpoints->pJniMethodEnd = JniMethodEnd; |
| 80 | qpoints->pJniMethodEndSynchronized = JniMethodEndSynchronized; |
| 81 | qpoints->pJniMethodEndWithReference = JniMethodEndWithReference; |
| Igor Murashkin | af1e299 | 2016-10-12 17:44:50 -0700 | [diff] [blame] | 82 | qpoints->pJniMethodFastEndWithReference = JniMethodFastEndWithReference; |
| Andreas Gampe | c7ed09b | 2016-04-25 20:08:55 -0700 | [diff] [blame] | 83 | qpoints->pJniMethodEndWithReferenceSynchronized = JniMethodEndWithReferenceSynchronized; |
| Igor Murashkin | 9d4b6da | 2016-07-29 09:51:58 -0700 | [diff] [blame] | 84 | qpoints->pJniMethodFastEnd = JniMethodFastEnd; |
| Andreas Gampe | c7ed09b | 2016-04-25 20:08:55 -0700 | [diff] [blame] | 85 | qpoints->pQuickGenericJniTrampoline = art_quick_generic_jni_trampoline; |
| 86 | |
| 87 | // Locks |
| 88 | if (UNLIKELY(VLOG_IS_ON(systrace_lock_logging))) { |
| 89 | qpoints->pLockObject = art_quick_lock_object_no_inline; |
| 90 | qpoints->pUnlockObject = art_quick_unlock_object_no_inline; |
| 91 | } else { |
| 92 | qpoints->pLockObject = art_quick_lock_object; |
| 93 | qpoints->pUnlockObject = art_quick_unlock_object; |
| 94 | } |
| 95 | |
| 96 | // Invocation |
| 97 | qpoints->pQuickImtConflictTrampoline = art_quick_imt_conflict_trampoline; |
| 98 | qpoints->pQuickResolutionTrampoline = art_quick_resolution_trampoline; |
| 99 | qpoints->pQuickToInterpreterBridge = art_quick_to_interpreter_bridge; |
| 100 | qpoints->pInvokeDirectTrampolineWithAccessCheck = |
| 101 | art_quick_invoke_direct_trampoline_with_access_check; |
| 102 | qpoints->pInvokeInterfaceTrampolineWithAccessCheck = |
| 103 | art_quick_invoke_interface_trampoline_with_access_check; |
| 104 | qpoints->pInvokeStaticTrampolineWithAccessCheck = |
| 105 | art_quick_invoke_static_trampoline_with_access_check; |
| 106 | qpoints->pInvokeSuperTrampolineWithAccessCheck = |
| 107 | art_quick_invoke_super_trampoline_with_access_check; |
| 108 | qpoints->pInvokeVirtualTrampolineWithAccessCheck = |
| 109 | art_quick_invoke_virtual_trampoline_with_access_check; |
| Orion Hodson | ac14139 | 2017-01-13 11:53:47 +0000 | [diff] [blame] | 110 | qpoints->pInvokePolymorphic = art_quick_invoke_polymorphic; |
| Orion Hodson | 4c8e12e | 2018-05-18 08:33:20 +0100 | [diff] [blame] | 111 | qpoints->pInvokeCustom = art_quick_invoke_custom; |
| Andreas Gampe | c7ed09b | 2016-04-25 20:08:55 -0700 | [diff] [blame] | 112 | |
| 113 | // Thread |
| 114 | qpoints->pTestSuspend = art_quick_test_suspend; |
| 115 | |
| 116 | // Throws |
| 117 | qpoints->pDeliverException = art_quick_deliver_exception; |
| 118 | qpoints->pThrowArrayBounds = art_quick_throw_array_bounds; |
| 119 | qpoints->pThrowDivZero = art_quick_throw_div_zero; |
| Andreas Gampe | c7ed09b | 2016-04-25 20:08:55 -0700 | [diff] [blame] | 120 | qpoints->pThrowNullPointer = art_quick_throw_null_pointer_exception; |
| 121 | qpoints->pThrowStackOverflow = art_quick_throw_stack_overflow; |
| Vladimir Marko | 87f3fcb | 2016-04-28 15:52:11 +0100 | [diff] [blame] | 122 | qpoints->pThrowStringBounds = art_quick_throw_string_bounds; |
| Andreas Gampe | c7ed09b | 2016-04-25 20:08:55 -0700 | [diff] [blame] | 123 | |
| 124 | // Deoptimize |
| 125 | qpoints->pDeoptimize = art_quick_deoptimize_from_compiled_code; |
| Vladimir Marko | 552a134 | 2017-10-31 10:56:47 +0000 | [diff] [blame] | 126 | |
| 127 | // StringBuilder append |
| 128 | qpoints->pStringBuilderAppend = art_quick_string_builder_append; |
| Nicolas Geoffray | e2a3aa9 | 2019-11-25 17:52:58 +0000 | [diff] [blame] | 129 | |
| Nicolas Geoffray | a59af8a | 2019-11-27 17:42:32 +0000 | [diff] [blame] | 130 | // Tiered JIT support |
| Nicolas Geoffray | e2a3aa9 | 2019-11-25 17:52:58 +0000 | [diff] [blame] | 131 | qpoints->pUpdateInlineCache = art_quick_update_inline_cache; |
| Nicolas Geoffray | a59af8a | 2019-11-27 17:42:32 +0000 | [diff] [blame] | 132 | qpoints->pCompileOptimized = art_quick_compile_optimized; |
| Nicolas Geoffray | c3db254 | 2021-04-20 15:50:04 +0000 | [diff] [blame] | 133 | |
| Nicolas Geoffray | 4f6bb44 | 2021-06-02 18:05:51 +0100 | [diff] [blame] | 134 | bool should_report = false; |
| 135 | PaletteShouldReportJniInvocations(&should_report); |
| 136 | if (should_report) { |
| Nicolas Geoffray | c3db254 | 2021-04-20 15:50:04 +0000 | [diff] [blame] | 137 | qpoints->pJniMethodStart = JniMonitoredMethodStart; |
| 138 | qpoints->pJniMethodStartSynchronized = JniMonitoredMethodStartSynchronized; |
| 139 | qpoints->pJniMethodEnd = JniMonitoredMethodEnd; |
| 140 | qpoints->pJniMethodEndSynchronized = JniMonitoredMethodEndSynchronized; |
| 141 | qpoints->pJniMethodEndWithReference = JniMonitoredMethodEndWithReference; |
| 142 | qpoints->pJniMethodEndWithReferenceSynchronized = |
| 143 | JniMonitoredMethodEndWithReferenceSynchronized; |
| 144 | } |
| Igor Murashkin | 2ffb703 | 2017-11-08 13:35:21 -0800 | [diff] [blame] | 145 | } |
| Andreas Gampe | c7ed09b | 2016-04-25 20:08:55 -0700 | [diff] [blame] | 146 | |
| 147 | } // namespace art |
| 148 | |
| 149 | #endif // ART_RUNTIME_ENTRYPOINTS_QUICK_QUICK_DEFAULT_INIT_ENTRYPOINTS_H_ |