Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 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 | |
Mingyao Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame] | 17 | #include "entrypoints/interpreter/interpreter_entrypoints.h" |
| 18 | #include "entrypoints/jni/jni_entrypoints.h" |
Mathieu Chartier | d889178 | 2014-03-02 13:28:37 -0800 | [diff] [blame] | 19 | #include "entrypoints/quick/quick_alloc_entrypoints.h" |
Andreas Gampe | e179456 | 2014-11-04 22:26:32 -0800 | [diff] [blame] | 20 | #include "entrypoints/quick/quick_default_externs.h" |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 21 | #include "entrypoints/quick/quick_entrypoints.h" |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 22 | #include "entrypoints/runtime_asm_entrypoints.h" |
| 23 | #include "interpreter/interpreter.h" |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 24 | |
| 25 | namespace art { |
| 26 | |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 27 | // Cast entrypoints. |
| 28 | extern "C" uint32_t art_quick_is_assignable(const mirror::Class* klass, |
Andreas Gampe | e179456 | 2014-11-04 22:26:32 -0800 | [diff] [blame] | 29 | const mirror::Class* ref_class); |
Hiroshi Yamauchi | 3b4c189 | 2013-09-12 21:33:12 -0700 | [diff] [blame] | 30 | |
Man Cao | 1aee900 | 2015-07-14 22:31:42 -0700 | [diff] [blame] | 31 | // Read barrier entrypoints. |
| 32 | extern "C" mirror::Object* art_quick_read_barrier_slow(mirror::Object*, mirror::Object*, uint32_t); |
| 33 | |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 34 | void InitEntryPoints(InterpreterEntryPoints* ipoints, JniEntryPoints* jpoints, |
Elliott Hughes | 956af0f | 2014-12-11 14:34:28 -0800 | [diff] [blame] | 35 | QuickEntryPoints* qpoints) { |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 36 | // Interpreter |
| 37 | ipoints->pInterpreterToInterpreterBridge = artInterpreterToInterpreterBridge; |
Dragos Sbirlea | 08bf196 | 2013-08-12 08:53:04 -0700 | [diff] [blame] | 38 | ipoints->pInterpreterToCompiledCodeBridge = artInterpreterToCompiledCodeBridge; |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 39 | |
| 40 | // JNI |
| 41 | jpoints->pDlsymLookup = art_jni_dlsym_lookup_stub; |
| 42 | |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 43 | // Alloc |
Hiroshi Yamauchi | 3b4c189 | 2013-09-12 21:33:12 -0700 | [diff] [blame] | 44 | ResetQuickAllocEntryPoints(qpoints); |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 45 | |
| 46 | // Cast |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 47 | qpoints->pInstanceofNonTrivial = art_quick_is_assignable; |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 48 | qpoints->pCheckCast = art_quick_check_cast; |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 49 | |
| 50 | // DexCache |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 51 | qpoints->pInitializeStaticStorage = art_quick_initialize_static_storage; |
| 52 | qpoints->pInitializeTypeAndVerifyAccess = art_quick_initialize_type_and_verify_access; |
| 53 | qpoints->pInitializeType = art_quick_initialize_type; |
| 54 | qpoints->pResolveString = art_quick_resolve_string; |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 55 | |
| 56 | // Field |
Fred Shih | 37f05ef | 2014-07-16 18:38:08 -0700 | [diff] [blame] | 57 | qpoints->pSet8Instance = art_quick_set8_instance; |
| 58 | qpoints->pSet8Static = art_quick_set8_static; |
| 59 | qpoints->pSet16Instance = art_quick_set16_instance; |
| 60 | qpoints->pSet16Static = art_quick_set16_static; |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 61 | qpoints->pSet32Instance = art_quick_set32_instance; |
| 62 | qpoints->pSet32Static = art_quick_set32_static; |
| 63 | qpoints->pSet64Instance = art_quick_set64_instance; |
| 64 | qpoints->pSet64Static = art_quick_set64_static; |
| 65 | qpoints->pSetObjInstance = art_quick_set_obj_instance; |
| 66 | qpoints->pSetObjStatic = art_quick_set_obj_static; |
Fred Shih | 37f05ef | 2014-07-16 18:38:08 -0700 | [diff] [blame] | 67 | qpoints->pGetByteInstance = art_quick_get_byte_instance; |
| 68 | qpoints->pGetBooleanInstance = art_quick_get_boolean_instance; |
| 69 | qpoints->pGetShortInstance = art_quick_get_short_instance; |
| 70 | qpoints->pGetCharInstance = art_quick_get_char_instance; |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 71 | qpoints->pGet32Instance = art_quick_get32_instance; |
| 72 | qpoints->pGet64Instance = art_quick_get64_instance; |
| 73 | qpoints->pGetObjInstance = art_quick_get_obj_instance; |
Fred Shih | 37f05ef | 2014-07-16 18:38:08 -0700 | [diff] [blame] | 74 | qpoints->pGetByteStatic = art_quick_get_byte_static; |
| 75 | qpoints->pGetBooleanStatic = art_quick_get_boolean_static; |
| 76 | qpoints->pGetShortStatic = art_quick_get_short_static; |
| 77 | qpoints->pGetCharStatic = art_quick_get_char_static; |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 78 | qpoints->pGet32Static = art_quick_get32_static; |
| 79 | qpoints->pGet64Static = art_quick_get64_static; |
| 80 | qpoints->pGetObjStatic = art_quick_get_obj_static; |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 81 | |
Ian Rogers | a9a8254 | 2013-10-04 11:17:26 -0700 | [diff] [blame] | 82 | // Array |
| 83 | qpoints->pAputObjectWithNullAndBoundCheck = art_quick_aput_obj_with_null_and_bound_check; |
| 84 | qpoints->pAputObjectWithBoundCheck = art_quick_aput_obj_with_bound_check; |
| 85 | qpoints->pAputObject = art_quick_aput_obj; |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 86 | qpoints->pHandleFillArrayData = art_quick_handle_fill_data; |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 87 | |
| 88 | // JNI |
| 89 | qpoints->pJniMethodStart = JniMethodStart; |
| 90 | qpoints->pJniMethodStartSynchronized = JniMethodStartSynchronized; |
| 91 | qpoints->pJniMethodEnd = JniMethodEnd; |
| 92 | qpoints->pJniMethodEndSynchronized = JniMethodEndSynchronized; |
| 93 | qpoints->pJniMethodEndWithReference = JniMethodEndWithReference; |
| 94 | qpoints->pJniMethodEndWithReferenceSynchronized = JniMethodEndWithReferenceSynchronized; |
Andreas Gampe | 2da8823 | 2014-02-27 12:26:20 -0800 | [diff] [blame] | 95 | qpoints->pQuickGenericJniTrampoline = art_quick_generic_jni_trampoline; |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 96 | |
| 97 | // Locks |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 98 | qpoints->pLockObject = art_quick_lock_object; |
| 99 | qpoints->pUnlockObject = art_quick_unlock_object; |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 100 | |
| 101 | // Math |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 102 | qpoints->pD2l = art_quick_d2l; |
| 103 | qpoints->pF2l = art_quick_f2l; |
| 104 | qpoints->pLdiv = art_quick_ldiv; |
Ian Rogers | a9a8254 | 2013-10-04 11:17:26 -0700 | [diff] [blame] | 105 | qpoints->pLmod = art_quick_lmod; |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 106 | qpoints->pLmul = art_quick_lmul; |
| 107 | qpoints->pShlLong = art_quick_lshl; |
| 108 | qpoints->pShrLong = art_quick_lshr; |
| 109 | qpoints->pUshrLong = art_quick_lushr; |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 110 | |
| 111 | // Intrinsics |
Mark Mendell | 4028a6c | 2014-02-19 20:06:20 -0800 | [diff] [blame] | 112 | // qpoints->pIndexOf = nullptr; // Not needed on x86 |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 113 | qpoints->pStringCompareTo = art_quick_string_compareto; |
| 114 | qpoints->pMemcpy = art_quick_memcpy; |
| 115 | |
| 116 | // Invocation |
Jeff Hao | 88474b4 | 2013-10-23 16:24:40 -0700 | [diff] [blame] | 117 | qpoints->pQuickImtConflictTrampoline = art_quick_imt_conflict_trampoline; |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 118 | qpoints->pQuickResolutionTrampoline = art_quick_resolution_trampoline; |
| 119 | qpoints->pQuickToInterpreterBridge = art_quick_to_interpreter_bridge; |
Mathieu Chartier | 2cebb24 | 2015-04-21 16:50:40 -0700 | [diff] [blame] | 120 | qpoints->pInvokeDirectTrampolineWithAccessCheck = |
| 121 | art_quick_invoke_direct_trampoline_with_access_check; |
| 122 | qpoints->pInvokeInterfaceTrampolineWithAccessCheck = |
| 123 | art_quick_invoke_interface_trampoline_with_access_check; |
| 124 | qpoints->pInvokeStaticTrampolineWithAccessCheck = |
| 125 | art_quick_invoke_static_trampoline_with_access_check; |
| 126 | qpoints->pInvokeSuperTrampolineWithAccessCheck = |
| 127 | art_quick_invoke_super_trampoline_with_access_check; |
| 128 | qpoints->pInvokeVirtualTrampolineWithAccessCheck = |
| 129 | art_quick_invoke_virtual_trampoline_with_access_check; |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 130 | |
| 131 | // Thread |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 132 | qpoints->pTestSuspend = art_quick_test_suspend; |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 133 | |
| 134 | // Throws |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 135 | qpoints->pDeliverException = art_quick_deliver_exception; |
| 136 | qpoints->pThrowArrayBounds = art_quick_throw_array_bounds; |
| 137 | qpoints->pThrowDivZero = art_quick_throw_div_zero; |
| 138 | qpoints->pThrowNoSuchMethod = art_quick_throw_no_such_method; |
| 139 | qpoints->pThrowNullPointer = art_quick_throw_null_pointer_exception; |
| 140 | qpoints->pThrowStackOverflow = art_quick_throw_stack_overflow; |
Mingyao Yang | d43b3ac | 2015-04-01 14:03:04 -0700 | [diff] [blame] | 141 | |
| 142 | // Deoptimize |
| 143 | qpoints->pDeoptimize = art_quick_deoptimize_from_compiled_slow_path; |
Hiroshi Yamauchi | 1cc71eb | 2015-05-07 10:47:27 -0700 | [diff] [blame] | 144 | |
| 145 | // Read barrier |
| 146 | qpoints->pReadBarrierJni = ReadBarrierJni; |
Man Cao | 1aee900 | 2015-07-14 22:31:42 -0700 | [diff] [blame] | 147 | qpoints->pReadBarrierSlow = art_quick_read_barrier_slow; |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 148 | }; |
| 149 | |
| 150 | } // namespace art |