blob: 2ce2a29bbf330d532daed4ffd27551f9ff8ff5ec [file] [log] [blame]
Stuart Monteithb95a5342014-03-12 13:32:32 +00001/*
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
17#include "entrypoints/interpreter/interpreter_entrypoints.h"
Mingyao Yang98d1cc82014-05-15 17:02:16 -070018#include "entrypoints/jni/jni_entrypoints.h"
Andreas Gampee1794562014-11-04 22:26:32 -080019#include "entrypoints/quick/quick_alloc_entrypoints.h"
20#include "entrypoints/quick/quick_default_externs.h"
Stuart Monteithb95a5342014-03-12 13:32:32 +000021#include "entrypoints/quick/quick_entrypoints.h"
22#include "entrypoints/entrypoint_utils.h"
23#include "entrypoints/math_entrypoints.h"
Ian Rogers6f3dbba2014-10-14 17:41:57 -070024#include "entrypoints/runtime_asm_entrypoints.h"
25#include "interpreter/interpreter.h"
Stuart Monteithb95a5342014-03-12 13:32:32 +000026
27namespace art {
28
Stuart Monteithb95a5342014-03-12 13:32:32 +000029// Cast entrypoints.
Serban Constantinescu9bd88b02015-04-22 16:24:46 +010030extern "C" uint32_t artIsAssignableFromCode(const mirror::Class* klass,
Stuart Monteithb95a5342014-03-12 13:32:32 +000031 const mirror::Class* ref_class);
Stuart Monteithb95a5342014-03-12 13:32:32 +000032
Stuart Monteithb95a5342014-03-12 13:32:32 +000033void InitEntryPoints(InterpreterEntryPoints* ipoints, JniEntryPoints* jpoints,
Elliott Hughes956af0f2014-12-11 14:34:28 -080034 QuickEntryPoints* qpoints) {
Stuart Monteithb95a5342014-03-12 13:32:32 +000035 // Interpreter
36 ipoints->pInterpreterToInterpreterBridge = artInterpreterToInterpreterBridge;
37 ipoints->pInterpreterToCompiledCodeBridge = artInterpreterToCompiledCodeBridge;
38
39 // JNI
40 jpoints->pDlsymLookup = art_jni_dlsym_lookup_stub;
41
Stuart Monteithb95a5342014-03-12 13:32:32 +000042 // Alloc
43 ResetQuickAllocEntryPoints(qpoints);
44
45 // Cast
Serban Constantinescu9bd88b02015-04-22 16:24:46 +010046 qpoints->pInstanceofNonTrivial = artIsAssignableFromCode;
Stuart Monteithb95a5342014-03-12 13:32:32 +000047 qpoints->pCheckCast = art_quick_check_cast;
48
49 // DexCache
50 qpoints->pInitializeStaticStorage = art_quick_initialize_static_storage;
51 qpoints->pInitializeTypeAndVerifyAccess = art_quick_initialize_type_and_verify_access;
52 qpoints->pInitializeType = art_quick_initialize_type;
53 qpoints->pResolveString = art_quick_resolve_string;
54
55 // Field
Fred Shih37f05ef2014-07-16 18:38:08 -070056 qpoints->pSet8Instance = art_quick_set8_instance;
57 qpoints->pSet8Static = art_quick_set8_static;
58 qpoints->pSet16Instance = art_quick_set16_instance;
59 qpoints->pSet16Static = art_quick_set16_static;
Stuart Monteithb95a5342014-03-12 13:32:32 +000060 qpoints->pSet32Instance = art_quick_set32_instance;
61 qpoints->pSet32Static = art_quick_set32_static;
62 qpoints->pSet64Instance = art_quick_set64_instance;
63 qpoints->pSet64Static = art_quick_set64_static;
64 qpoints->pSetObjInstance = art_quick_set_obj_instance;
65 qpoints->pSetObjStatic = art_quick_set_obj_static;
Fred Shih37f05ef2014-07-16 18:38:08 -070066 qpoints->pGetBooleanInstance = art_quick_get_boolean_instance;
67 qpoints->pGetByteInstance = art_quick_get_byte_instance;
68 qpoints->pGetCharInstance = art_quick_get_char_instance;
69 qpoints->pGetShortInstance = art_quick_get_short_instance;
Stuart Monteithb95a5342014-03-12 13:32:32 +000070 qpoints->pGet32Instance = art_quick_get32_instance;
71 qpoints->pGet64Instance = art_quick_get64_instance;
72 qpoints->pGetObjInstance = art_quick_get_obj_instance;
Fred Shih37f05ef2014-07-16 18:38:08 -070073 qpoints->pGetBooleanStatic = art_quick_get_boolean_static;
74 qpoints->pGetByteStatic = art_quick_get_byte_static;
75 qpoints->pGetCharStatic = art_quick_get_char_static;
76 qpoints->pGetShortStatic = art_quick_get_short_static;
Stuart Monteithb95a5342014-03-12 13:32:32 +000077 qpoints->pGet32Static = art_quick_get32_static;
78 qpoints->pGet64Static = art_quick_get64_static;
79 qpoints->pGetObjStatic = art_quick_get_obj_static;
80
81 // Array
82 qpoints->pAputObjectWithNullAndBoundCheck = art_quick_aput_obj_with_null_and_bound_check;
83 qpoints->pAputObjectWithBoundCheck = art_quick_aput_obj_with_bound_check;
84 qpoints->pAputObject = art_quick_aput_obj;
85 qpoints->pHandleFillArrayData = art_quick_handle_fill_data;
86
87 // JNI
88 qpoints->pJniMethodStart = JniMethodStart;
89 qpoints->pJniMethodStartSynchronized = JniMethodStartSynchronized;
90 qpoints->pJniMethodEnd = JniMethodEnd;
91 qpoints->pJniMethodEndSynchronized = JniMethodEndSynchronized;
92 qpoints->pJniMethodEndWithReference = JniMethodEndWithReference;
93 qpoints->pJniMethodEndWithReferenceSynchronized = JniMethodEndWithReferenceSynchronized;
94 qpoints->pQuickGenericJniTrampoline = art_quick_generic_jni_trampoline;
95
96 // Locks
97 qpoints->pLockObject = art_quick_lock_object;
98 qpoints->pUnlockObject = art_quick_unlock_object;
99
100 // Math
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700101 // TODO null entrypoints not needed for ARM64 - generate inline.
Zheng Xu0210d112014-06-17 12:25:48 +0800102 qpoints->pCmpgDouble = nullptr;
103 qpoints->pCmpgFloat = nullptr;
104 qpoints->pCmplDouble = nullptr;
105 qpoints->pCmplFloat = nullptr;
Serban Constantinescu9bd88b02015-04-22 16:24:46 +0100106 qpoints->pFmod = fmod;
Zheng Xu0210d112014-06-17 12:25:48 +0800107 qpoints->pL2d = nullptr;
Serban Constantinescu9bd88b02015-04-22 16:24:46 +0100108 qpoints->pFmodf = fmodf;
Zheng Xu0210d112014-06-17 12:25:48 +0800109 qpoints->pL2f = nullptr;
110 qpoints->pD2iz = nullptr;
111 qpoints->pF2iz = nullptr;
112 qpoints->pIdivmod = nullptr;
113 qpoints->pD2l = nullptr;
114 qpoints->pF2l = nullptr;
115 qpoints->pLdiv = nullptr;
116 qpoints->pLmod = nullptr;
117 qpoints->pLmul = nullptr;
118 qpoints->pShlLong = nullptr;
119 qpoints->pShrLong = nullptr;
120 qpoints->pUshrLong = nullptr;
Stuart Monteithb95a5342014-03-12 13:32:32 +0000121
122 // Intrinsics
123 qpoints->pIndexOf = art_quick_indexof;
Stuart Monteithb95a5342014-03-12 13:32:32 +0000124 qpoints->pStringCompareTo = art_quick_string_compareto;
Serban Constantinescu9bd88b02015-04-22 16:24:46 +0100125 qpoints->pMemcpy = memcpy;
Stuart Monteithb95a5342014-03-12 13:32:32 +0000126
127 // Invocation
128 qpoints->pQuickImtConflictTrampoline = art_quick_imt_conflict_trampoline;
129 qpoints->pQuickResolutionTrampoline = art_quick_resolution_trampoline;
130 qpoints->pQuickToInterpreterBridge = art_quick_to_interpreter_bridge;
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700131 qpoints->pInvokeDirectTrampolineWithAccessCheck =
132 art_quick_invoke_direct_trampoline_with_access_check;
133 qpoints->pInvokeInterfaceTrampolineWithAccessCheck =
134 art_quick_invoke_interface_trampoline_with_access_check;
135 qpoints->pInvokeStaticTrampolineWithAccessCheck =
136 art_quick_invoke_static_trampoline_with_access_check;
137 qpoints->pInvokeSuperTrampolineWithAccessCheck =
138 art_quick_invoke_super_trampoline_with_access_check;
139 qpoints->pInvokeVirtualTrampolineWithAccessCheck =
140 art_quick_invoke_virtual_trampoline_with_access_check;
Stuart Monteithb95a5342014-03-12 13:32:32 +0000141
142 // Thread
Stuart Monteithb95a5342014-03-12 13:32:32 +0000143 qpoints->pTestSuspend = art_quick_test_suspend;
144
145 // Throws
146 qpoints->pDeliverException = art_quick_deliver_exception;
147 qpoints->pThrowArrayBounds = art_quick_throw_array_bounds;
148 qpoints->pThrowDivZero = art_quick_throw_div_zero;
149 qpoints->pThrowNoSuchMethod = art_quick_throw_no_such_method;
150 qpoints->pThrowNullPointer = art_quick_throw_null_pointer_exception;
151 qpoints->pThrowStackOverflow = art_quick_throw_stack_overflow;
Mingyao Yangd43b3ac2015-04-01 14:03:04 -0700152
153 // Deoptimize
154 qpoints->pDeoptimize = art_quick_deoptimize;
Hiroshi Yamauchi1cc71eb2015-05-07 10:47:27 -0700155
156 // Read barrier
157 qpoints->pReadBarrierJni = ReadBarrierJni;
Stuart Monteithb95a5342014-03-12 13:32:32 +0000158};
159
160} // namespace art