blob: e68d41df5aca7637aaad17d294d139f37ca0e412 [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 Constantinescu86797a72014-06-19 16:17:56 +010030extern "C" uint32_t art_quick_assignable_from_code(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 +000033// Single-precision FP arithmetics.
Zheng Xu0210d112014-06-17 12:25:48 +080034extern "C" float art_quick_fmodf(float a, float b); // REM_FLOAT[_2ADDR]
Stuart Monteithb95a5342014-03-12 13:32:32 +000035
36// Double-precision FP arithmetics.
Andreas Gampee1794562014-11-04 22:26:32 -080037extern "C" double art_quick_fmod(double a, double b); // REM_DOUBLE[_2ADDR]
Zheng Xu0210d112014-06-17 12:25:48 +080038
Stuart Monteithb95a5342014-03-12 13:32:32 +000039
40void InitEntryPoints(InterpreterEntryPoints* ipoints, JniEntryPoints* jpoints,
Elliott Hughes956af0f2014-12-11 14:34:28 -080041 QuickEntryPoints* qpoints) {
Stuart Monteithb95a5342014-03-12 13:32:32 +000042 // Interpreter
43 ipoints->pInterpreterToInterpreterBridge = artInterpreterToInterpreterBridge;
44 ipoints->pInterpreterToCompiledCodeBridge = artInterpreterToCompiledCodeBridge;
45
46 // JNI
47 jpoints->pDlsymLookup = art_jni_dlsym_lookup_stub;
48
Stuart Monteithb95a5342014-03-12 13:32:32 +000049 // Alloc
50 ResetQuickAllocEntryPoints(qpoints);
51
52 // Cast
Serban Constantinescu86797a72014-06-19 16:17:56 +010053 qpoints->pInstanceofNonTrivial = art_quick_assignable_from_code;
Stuart Monteithb95a5342014-03-12 13:32:32 +000054 qpoints->pCheckCast = art_quick_check_cast;
55
56 // DexCache
57 qpoints->pInitializeStaticStorage = art_quick_initialize_static_storage;
58 qpoints->pInitializeTypeAndVerifyAccess = art_quick_initialize_type_and_verify_access;
59 qpoints->pInitializeType = art_quick_initialize_type;
60 qpoints->pResolveString = art_quick_resolve_string;
61
62 // Field
Fred Shih37f05ef2014-07-16 18:38:08 -070063 qpoints->pSet8Instance = art_quick_set8_instance;
64 qpoints->pSet8Static = art_quick_set8_static;
65 qpoints->pSet16Instance = art_quick_set16_instance;
66 qpoints->pSet16Static = art_quick_set16_static;
Stuart Monteithb95a5342014-03-12 13:32:32 +000067 qpoints->pSet32Instance = art_quick_set32_instance;
68 qpoints->pSet32Static = art_quick_set32_static;
69 qpoints->pSet64Instance = art_quick_set64_instance;
70 qpoints->pSet64Static = art_quick_set64_static;
71 qpoints->pSetObjInstance = art_quick_set_obj_instance;
72 qpoints->pSetObjStatic = art_quick_set_obj_static;
Fred Shih37f05ef2014-07-16 18:38:08 -070073 qpoints->pGetBooleanInstance = art_quick_get_boolean_instance;
74 qpoints->pGetByteInstance = art_quick_get_byte_instance;
75 qpoints->pGetCharInstance = art_quick_get_char_instance;
76 qpoints->pGetShortInstance = art_quick_get_short_instance;
Stuart Monteithb95a5342014-03-12 13:32:32 +000077 qpoints->pGet32Instance = art_quick_get32_instance;
78 qpoints->pGet64Instance = art_quick_get64_instance;
79 qpoints->pGetObjInstance = art_quick_get_obj_instance;
Fred Shih37f05ef2014-07-16 18:38:08 -070080 qpoints->pGetBooleanStatic = art_quick_get_boolean_static;
81 qpoints->pGetByteStatic = art_quick_get_byte_static;
82 qpoints->pGetCharStatic = art_quick_get_char_static;
83 qpoints->pGetShortStatic = art_quick_get_short_static;
Stuart Monteithb95a5342014-03-12 13:32:32 +000084 qpoints->pGet32Static = art_quick_get32_static;
85 qpoints->pGet64Static = art_quick_get64_static;
86 qpoints->pGetObjStatic = art_quick_get_obj_static;
87
88 // Array
89 qpoints->pAputObjectWithNullAndBoundCheck = art_quick_aput_obj_with_null_and_bound_check;
90 qpoints->pAputObjectWithBoundCheck = art_quick_aput_obj_with_bound_check;
91 qpoints->pAputObject = art_quick_aput_obj;
92 qpoints->pHandleFillArrayData = art_quick_handle_fill_data;
93
94 // JNI
95 qpoints->pJniMethodStart = JniMethodStart;
96 qpoints->pJniMethodStartSynchronized = JniMethodStartSynchronized;
97 qpoints->pJniMethodEnd = JniMethodEnd;
98 qpoints->pJniMethodEndSynchronized = JniMethodEndSynchronized;
99 qpoints->pJniMethodEndWithReference = JniMethodEndWithReference;
100 qpoints->pJniMethodEndWithReferenceSynchronized = JniMethodEndWithReferenceSynchronized;
101 qpoints->pQuickGenericJniTrampoline = art_quick_generic_jni_trampoline;
102
103 // Locks
104 qpoints->pLockObject = art_quick_lock_object;
105 qpoints->pUnlockObject = art_quick_unlock_object;
106
107 // Math
Zheng Xu0210d112014-06-17 12:25:48 +0800108 // TODO nullptr entrypoints not needed for ARM64 - generate inline.
109 qpoints->pCmpgDouble = nullptr;
110 qpoints->pCmpgFloat = nullptr;
111 qpoints->pCmplDouble = nullptr;
112 qpoints->pCmplFloat = nullptr;
113 qpoints->pFmod = art_quick_fmod;
114 qpoints->pL2d = nullptr;
115 qpoints->pFmodf = art_quick_fmodf;
116 qpoints->pL2f = nullptr;
117 qpoints->pD2iz = nullptr;
118 qpoints->pF2iz = nullptr;
119 qpoints->pIdivmod = nullptr;
120 qpoints->pD2l = nullptr;
121 qpoints->pF2l = nullptr;
122 qpoints->pLdiv = nullptr;
123 qpoints->pLmod = nullptr;
124 qpoints->pLmul = nullptr;
125 qpoints->pShlLong = nullptr;
126 qpoints->pShrLong = nullptr;
127 qpoints->pUshrLong = nullptr;
Stuart Monteithb95a5342014-03-12 13:32:32 +0000128
129 // Intrinsics
130 qpoints->pIndexOf = art_quick_indexof;
Stuart Monteithb95a5342014-03-12 13:32:32 +0000131 qpoints->pStringCompareTo = art_quick_string_compareto;
Zheng Xu0210d112014-06-17 12:25:48 +0800132 qpoints->pMemcpy = art_quick_memcpy;
Stuart Monteithb95a5342014-03-12 13:32:32 +0000133
134 // Invocation
135 qpoints->pQuickImtConflictTrampoline = art_quick_imt_conflict_trampoline;
136 qpoints->pQuickResolutionTrampoline = art_quick_resolution_trampoline;
137 qpoints->pQuickToInterpreterBridge = art_quick_to_interpreter_bridge;
138 qpoints->pInvokeDirectTrampolineWithAccessCheck = art_quick_invoke_direct_trampoline_with_access_check;
139 qpoints->pInvokeInterfaceTrampolineWithAccessCheck = art_quick_invoke_interface_trampoline_with_access_check;
140 qpoints->pInvokeStaticTrampolineWithAccessCheck = art_quick_invoke_static_trampoline_with_access_check;
141 qpoints->pInvokeSuperTrampolineWithAccessCheck = art_quick_invoke_super_trampoline_with_access_check;
142 qpoints->pInvokeVirtualTrampolineWithAccessCheck = art_quick_invoke_virtual_trampoline_with_access_check;
143
144 // Thread
Stuart Monteithb95a5342014-03-12 13:32:32 +0000145 qpoints->pTestSuspend = art_quick_test_suspend;
146
147 // Throws
148 qpoints->pDeliverException = art_quick_deliver_exception;
149 qpoints->pThrowArrayBounds = art_quick_throw_array_bounds;
150 qpoints->pThrowDivZero = art_quick_throw_div_zero;
151 qpoints->pThrowNoSuchMethod = art_quick_throw_no_such_method;
152 qpoints->pThrowNullPointer = art_quick_throw_null_pointer_exception;
153 qpoints->pThrowStackOverflow = art_quick_throw_stack_overflow;
154};
155
156} // namespace art