Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 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 | |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame] | 17 | #include "entrypoints/jni/jni_entrypoints.h" |
Andreas Gampe | e179456 | 2014-11-04 22:26:32 -0800 | [diff] [blame] | 18 | #include "entrypoints/quick/quick_alloc_entrypoints.h" |
| 19 | #include "entrypoints/quick/quick_default_externs.h" |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 20 | #include "entrypoints/quick/quick_entrypoints.h" |
| 21 | #include "entrypoints/entrypoint_utils.h" |
| 22 | #include "entrypoints/math_entrypoints.h" |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 23 | #include "entrypoints/runtime_asm_entrypoints.h" |
| 24 | #include "interpreter/interpreter.h" |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 25 | |
| 26 | namespace art { |
| 27 | |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 28 | // Cast entrypoints. |
Serban Constantinescu | 9bd88b0 | 2015-04-22 16:24:46 +0100 | [diff] [blame] | 29 | extern "C" uint32_t artIsAssignableFromCode(const mirror::Class* klass, |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 30 | const mirror::Class* ref_class); |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 31 | |
Andreas Gampe | 3cfa4d0 | 2015-10-06 17:04:01 -0700 | [diff] [blame] | 32 | void InitEntryPoints(JniEntryPoints* jpoints, QuickEntryPoints* qpoints) { |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 33 | // JNI |
| 34 | jpoints->pDlsymLookup = art_jni_dlsym_lookup_stub; |
| 35 | |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 36 | // Alloc |
| 37 | ResetQuickAllocEntryPoints(qpoints); |
| 38 | |
| 39 | // Cast |
Serban Constantinescu | 9bd88b0 | 2015-04-22 16:24:46 +0100 | [diff] [blame] | 40 | qpoints->pInstanceofNonTrivial = artIsAssignableFromCode; |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 41 | qpoints->pCheckCast = art_quick_check_cast; |
| 42 | |
| 43 | // DexCache |
| 44 | qpoints->pInitializeStaticStorage = art_quick_initialize_static_storage; |
| 45 | qpoints->pInitializeTypeAndVerifyAccess = art_quick_initialize_type_and_verify_access; |
| 46 | qpoints->pInitializeType = art_quick_initialize_type; |
| 47 | qpoints->pResolveString = art_quick_resolve_string; |
| 48 | |
| 49 | // Field |
Fred Shih | 37f05ef | 2014-07-16 18:38:08 -0700 | [diff] [blame] | 50 | qpoints->pSet8Instance = art_quick_set8_instance; |
| 51 | qpoints->pSet8Static = art_quick_set8_static; |
| 52 | qpoints->pSet16Instance = art_quick_set16_instance; |
| 53 | qpoints->pSet16Static = art_quick_set16_static; |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 54 | qpoints->pSet32Instance = art_quick_set32_instance; |
| 55 | qpoints->pSet32Static = art_quick_set32_static; |
| 56 | qpoints->pSet64Instance = art_quick_set64_instance; |
| 57 | qpoints->pSet64Static = art_quick_set64_static; |
| 58 | qpoints->pSetObjInstance = art_quick_set_obj_instance; |
| 59 | qpoints->pSetObjStatic = art_quick_set_obj_static; |
Fred Shih | 37f05ef | 2014-07-16 18:38:08 -0700 | [diff] [blame] | 60 | qpoints->pGetBooleanInstance = art_quick_get_boolean_instance; |
| 61 | qpoints->pGetByteInstance = art_quick_get_byte_instance; |
| 62 | qpoints->pGetCharInstance = art_quick_get_char_instance; |
| 63 | qpoints->pGetShortInstance = art_quick_get_short_instance; |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 64 | qpoints->pGet32Instance = art_quick_get32_instance; |
| 65 | qpoints->pGet64Instance = art_quick_get64_instance; |
| 66 | qpoints->pGetObjInstance = art_quick_get_obj_instance; |
Fred Shih | 37f05ef | 2014-07-16 18:38:08 -0700 | [diff] [blame] | 67 | qpoints->pGetBooleanStatic = art_quick_get_boolean_static; |
| 68 | qpoints->pGetByteStatic = art_quick_get_byte_static; |
| 69 | qpoints->pGetCharStatic = art_quick_get_char_static; |
| 70 | qpoints->pGetShortStatic = art_quick_get_short_static; |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 71 | qpoints->pGet32Static = art_quick_get32_static; |
| 72 | qpoints->pGet64Static = art_quick_get64_static; |
| 73 | qpoints->pGetObjStatic = art_quick_get_obj_static; |
| 74 | |
| 75 | // Array |
| 76 | qpoints->pAputObjectWithNullAndBoundCheck = art_quick_aput_obj_with_null_and_bound_check; |
| 77 | qpoints->pAputObjectWithBoundCheck = art_quick_aput_obj_with_bound_check; |
| 78 | qpoints->pAputObject = art_quick_aput_obj; |
| 79 | qpoints->pHandleFillArrayData = art_quick_handle_fill_data; |
| 80 | |
| 81 | // JNI |
| 82 | qpoints->pJniMethodStart = JniMethodStart; |
| 83 | qpoints->pJniMethodStartSynchronized = JniMethodStartSynchronized; |
| 84 | qpoints->pJniMethodEnd = JniMethodEnd; |
| 85 | qpoints->pJniMethodEndSynchronized = JniMethodEndSynchronized; |
| 86 | qpoints->pJniMethodEndWithReference = JniMethodEndWithReference; |
| 87 | qpoints->pJniMethodEndWithReferenceSynchronized = JniMethodEndWithReferenceSynchronized; |
| 88 | qpoints->pQuickGenericJniTrampoline = art_quick_generic_jni_trampoline; |
| 89 | |
| 90 | // Locks |
| 91 | qpoints->pLockObject = art_quick_lock_object; |
| 92 | qpoints->pUnlockObject = art_quick_unlock_object; |
| 93 | |
| 94 | // Math |
Mathieu Chartier | 2cebb24 | 2015-04-21 16:50:40 -0700 | [diff] [blame] | 95 | // TODO null entrypoints not needed for ARM64 - generate inline. |
Zheng Xu | 0210d11 | 2014-06-17 12:25:48 +0800 | [diff] [blame] | 96 | qpoints->pCmpgDouble = nullptr; |
| 97 | qpoints->pCmpgFloat = nullptr; |
| 98 | qpoints->pCmplDouble = nullptr; |
| 99 | qpoints->pCmplFloat = nullptr; |
Serban Constantinescu | 9bd88b0 | 2015-04-22 16:24:46 +0100 | [diff] [blame] | 100 | qpoints->pFmod = fmod; |
Zheng Xu | 0210d11 | 2014-06-17 12:25:48 +0800 | [diff] [blame] | 101 | qpoints->pL2d = nullptr; |
Serban Constantinescu | 9bd88b0 | 2015-04-22 16:24:46 +0100 | [diff] [blame] | 102 | qpoints->pFmodf = fmodf; |
Zheng Xu | 0210d11 | 2014-06-17 12:25:48 +0800 | [diff] [blame] | 103 | qpoints->pL2f = nullptr; |
| 104 | qpoints->pD2iz = nullptr; |
| 105 | qpoints->pF2iz = nullptr; |
| 106 | qpoints->pIdivmod = nullptr; |
| 107 | qpoints->pD2l = nullptr; |
| 108 | qpoints->pF2l = nullptr; |
| 109 | qpoints->pLdiv = nullptr; |
| 110 | qpoints->pLmod = nullptr; |
| 111 | qpoints->pLmul = nullptr; |
| 112 | qpoints->pShlLong = nullptr; |
| 113 | qpoints->pShrLong = nullptr; |
| 114 | qpoints->pUshrLong = nullptr; |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 115 | |
| 116 | // Intrinsics |
| 117 | qpoints->pIndexOf = art_quick_indexof; |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 118 | qpoints->pStringCompareTo = art_quick_string_compareto; |
Serban Constantinescu | 9bd88b0 | 2015-04-22 16:24:46 +0100 | [diff] [blame] | 119 | qpoints->pMemcpy = memcpy; |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 120 | |
| 121 | // Invocation |
| 122 | qpoints->pQuickImtConflictTrampoline = art_quick_imt_conflict_trampoline; |
| 123 | qpoints->pQuickResolutionTrampoline = art_quick_resolution_trampoline; |
| 124 | qpoints->pQuickToInterpreterBridge = art_quick_to_interpreter_bridge; |
Mathieu Chartier | 2cebb24 | 2015-04-21 16:50:40 -0700 | [diff] [blame] | 125 | qpoints->pInvokeDirectTrampolineWithAccessCheck = |
| 126 | art_quick_invoke_direct_trampoline_with_access_check; |
| 127 | qpoints->pInvokeInterfaceTrampolineWithAccessCheck = |
| 128 | art_quick_invoke_interface_trampoline_with_access_check; |
| 129 | qpoints->pInvokeStaticTrampolineWithAccessCheck = |
| 130 | art_quick_invoke_static_trampoline_with_access_check; |
| 131 | qpoints->pInvokeSuperTrampolineWithAccessCheck = |
| 132 | art_quick_invoke_super_trampoline_with_access_check; |
| 133 | qpoints->pInvokeVirtualTrampolineWithAccessCheck = |
| 134 | art_quick_invoke_virtual_trampoline_with_access_check; |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 135 | |
| 136 | // Thread |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 137 | qpoints->pTestSuspend = art_quick_test_suspend; |
| 138 | |
| 139 | // Throws |
| 140 | qpoints->pDeliverException = art_quick_deliver_exception; |
| 141 | qpoints->pThrowArrayBounds = art_quick_throw_array_bounds; |
| 142 | qpoints->pThrowDivZero = art_quick_throw_div_zero; |
| 143 | qpoints->pThrowNoSuchMethod = art_quick_throw_no_such_method; |
| 144 | qpoints->pThrowNullPointer = art_quick_throw_null_pointer_exception; |
| 145 | qpoints->pThrowStackOverflow = art_quick_throw_stack_overflow; |
Mingyao Yang | d43b3ac | 2015-04-01 14:03:04 -0700 | [diff] [blame] | 146 | |
Sebastien Hertz | 0747466 | 2015-08-25 15:12:33 +0000 | [diff] [blame] | 147 | // Deoptimization from compiled code. |
| 148 | qpoints->pDeoptimize = art_quick_deoptimize_from_compiled_code; |
Hiroshi Yamauchi | 1cc71eb | 2015-05-07 10:47:27 -0700 | [diff] [blame] | 149 | |
Roland Levillain | 0d5a281 | 2015-11-13 10:07:31 +0000 | [diff] [blame] | 150 | // Read barrier. |
Hiroshi Yamauchi | 1cc71eb | 2015-05-07 10:47:27 -0700 | [diff] [blame] | 151 | qpoints->pReadBarrierJni = ReadBarrierJni; |
Roland Levillain | 7c1559a | 2015-12-15 10:55:36 +0000 | [diff] [blame] | 152 | qpoints->pReadBarrierMark = artReadBarrierMark; |
Man Cao | 1aee900 | 2015-07-14 22:31:42 -0700 | [diff] [blame] | 153 | qpoints->pReadBarrierSlow = artReadBarrierSlow; |
Roland Levillain | 0d5a281 | 2015-11-13 10:07:31 +0000 | [diff] [blame] | 154 | qpoints->pReadBarrierForRootSlow = artReadBarrierForRootSlow; |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 155 | }; |
| 156 | |
| 157 | } // namespace art |