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 #include "entrypoints/interpreter/interpreter_entrypoints.h" 18 #include "entrypoints/jni/jni_entrypoints.h" 19 #include "entrypoints/quick/quick_alloc_entrypoints.h" 20 #include "entrypoints/quick/quick_default_externs.h" 21 #include "entrypoints/quick/quick_entrypoints.h" 22 #include "entrypoints/math_entrypoints.h" 23 #include "entrypoints/runtime_asm_entrypoints.h" 24 #include "interpreter/interpreter.h" 25 26 namespace art { 27 28 // Cast entrypoints. 29 extern "C" uint32_t art_quick_assignable_from_code(const mirror::Class* klass, 30 const mirror::Class* ref_class); 31 32 void InitEntryPoints(InterpreterEntryPoints* ipoints, JniEntryPoints* jpoints, 33 QuickEntryPoints* qpoints) { 34 #if defined(__APPLE__) 35 UNUSED(ipoints, jpoints, qpoints); 36 UNIMPLEMENTED(FATAL); 37 #else 38 // Interpreter 39 ipoints->pInterpreterToInterpreterBridge = artInterpreterToInterpreterBridge; 40 ipoints->pInterpreterToCompiledCodeBridge = artInterpreterToCompiledCodeBridge; 41 42 // JNI 43 jpoints->pDlsymLookup = art_jni_dlsym_lookup_stub; 44 45 // Alloc 46 ResetQuickAllocEntryPoints(qpoints); 47 48 // Cast 49 qpoints->pInstanceofNonTrivial = art_quick_assignable_from_code; 50 qpoints->pCheckCast = art_quick_check_cast; 51 52 // DexCache 53 qpoints->pInitializeStaticStorage = art_quick_initialize_static_storage; 54 qpoints->pInitializeTypeAndVerifyAccess = art_quick_initialize_type_and_verify_access; 55 qpoints->pInitializeType = art_quick_initialize_type; 56 qpoints->pResolveString = art_quick_resolve_string; 57 58 // Field 59 qpoints->pSet8Instance = art_quick_set8_instance; 60 qpoints->pSet8Static = art_quick_set8_static; 61 qpoints->pSet16Instance = art_quick_set16_instance; 62 qpoints->pSet16Static = art_quick_set16_static; 63 qpoints->pSet32Instance = art_quick_set32_instance; 64 qpoints->pSet32Static = art_quick_set32_static; 65 qpoints->pSet64Instance = art_quick_set64_instance; 66 qpoints->pSet64Static = art_quick_set64_static; 67 qpoints->pSetObjInstance = art_quick_set_obj_instance; 68 qpoints->pSetObjStatic = art_quick_set_obj_static; 69 qpoints->pGetByteInstance = art_quick_get_byte_instance; 70 qpoints->pGetBooleanInstance = art_quick_get_boolean_instance; 71 qpoints->pGetShortInstance = art_quick_get_short_instance; 72 qpoints->pGetCharInstance = art_quick_get_char_instance; 73 qpoints->pGet32Instance = art_quick_get32_instance; 74 qpoints->pGet64Instance = art_quick_get64_instance; 75 qpoints->pGetObjInstance = art_quick_get_obj_instance; 76 qpoints->pGetByteStatic = art_quick_get_byte_static; 77 qpoints->pGetBooleanStatic = art_quick_get_boolean_static; 78 qpoints->pGetShortStatic = art_quick_get_short_static; 79 qpoints->pGetCharStatic = art_quick_get_char_static; 80 qpoints->pGet32Static = art_quick_get32_static; 81 qpoints->pGet64Static = art_quick_get64_static; 82 qpoints->pGetObjStatic = art_quick_get_obj_static; 83 84 // Array 85 qpoints->pAputObjectWithNullAndBoundCheck = art_quick_aput_obj_with_null_and_bound_check; 86 qpoints->pAputObjectWithBoundCheck = art_quick_aput_obj_with_bound_check; 87 qpoints->pAputObject = art_quick_aput_obj; 88 qpoints->pHandleFillArrayData = art_quick_handle_fill_data; 89 90 // JNI 91 qpoints->pJniMethodStart = JniMethodStart; 92 qpoints->pJniMethodStartSynchronized = JniMethodStartSynchronized; 93 qpoints->pJniMethodEnd = JniMethodEnd; 94 qpoints->pJniMethodEndSynchronized = JniMethodEndSynchronized; 95 qpoints->pJniMethodEndWithReference = JniMethodEndWithReference; 96 qpoints->pJniMethodEndWithReferenceSynchronized = JniMethodEndWithReferenceSynchronized; 97 qpoints->pQuickGenericJniTrampoline = art_quick_generic_jni_trampoline; 98 99 // Locks 100 qpoints->pLockObject = art_quick_lock_object; 101 qpoints->pUnlockObject = art_quick_unlock_object; 102 103 // Math 104 qpoints->pD2l = art_d2l; 105 qpoints->pF2l = art_f2l; 106 qpoints->pLdiv = art_quick_ldiv; 107 qpoints->pLmod = art_quick_lmod; 108 qpoints->pLmul = art_quick_lmul; 109 qpoints->pShlLong = art_quick_lshl; 110 qpoints->pShrLong = art_quick_lshr; 111 qpoints->pUshrLong = art_quick_lushr; 112 113 // Intrinsics 114 qpoints->pStringCompareTo = art_quick_string_compareto; 115 qpoints->pMemcpy = art_quick_memcpy; 116 117 // Invocation 118 qpoints->pQuickImtConflictTrampoline = art_quick_imt_conflict_trampoline; 119 qpoints->pQuickResolutionTrampoline = art_quick_resolution_trampoline; 120 qpoints->pQuickToInterpreterBridge = art_quick_to_interpreter_bridge; 121 qpoints->pInvokeDirectTrampolineWithAccessCheck = 122 art_quick_invoke_direct_trampoline_with_access_check; 123 qpoints->pInvokeInterfaceTrampolineWithAccessCheck = 124 art_quick_invoke_interface_trampoline_with_access_check; 125 qpoints->pInvokeStaticTrampolineWithAccessCheck = 126 art_quick_invoke_static_trampoline_with_access_check; 127 qpoints->pInvokeSuperTrampolineWithAccessCheck = 128 art_quick_invoke_super_trampoline_with_access_check; 129 qpoints->pInvokeVirtualTrampolineWithAccessCheck = 130 art_quick_invoke_virtual_trampoline_with_access_check; 131 132 // Thread 133 qpoints->pTestSuspend = art_quick_test_suspend; 134 135 // Throws 136 qpoints->pDeliverException = art_quick_deliver_exception; 137 qpoints->pThrowArrayBounds = art_quick_throw_array_bounds; 138 qpoints->pThrowDivZero = art_quick_throw_div_zero; 139 qpoints->pThrowNoSuchMethod = art_quick_throw_no_such_method; 140 qpoints->pThrowNullPointer = art_quick_throw_null_pointer_exception; 141 qpoints->pThrowStackOverflow = art_quick_throw_stack_overflow; 142 143 // Deoptimize 144 qpoints->pDeoptimize = art_quick_deoptimize_from_compiled_slow_path; 145 146 // Read barrier 147 qpoints->pReadBarrierJni = ReadBarrierJni; 148 #endif // __APPLE__ 149 }; 150 151 } // namespace art 152