blob: 2d26c033e1702e541c66dbfd5a688dc29c84d687 [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"
Stuart Monteithb95a5342014-03-12 13:32:32 +000019#include "entrypoints/portable/portable_entrypoints.h"
Andreas Gampee1794562014-11-04 22:26:32 -080020#include "entrypoints/quick/quick_alloc_entrypoints.h"
21#include "entrypoints/quick/quick_default_externs.h"
Stuart Monteithb95a5342014-03-12 13:32:32 +000022#include "entrypoints/quick/quick_entrypoints.h"
23#include "entrypoints/entrypoint_utils.h"
24#include "entrypoints/math_entrypoints.h"
Ian Rogers6f3dbba2014-10-14 17:41:57 -070025#include "entrypoints/runtime_asm_entrypoints.h"
26#include "interpreter/interpreter.h"
Stuart Monteithb95a5342014-03-12 13:32:32 +000027
28namespace art {
29
Stuart Monteithb95a5342014-03-12 13:32:32 +000030// Cast entrypoints.
Serban Constantinescu86797a72014-06-19 16:17:56 +010031extern "C" uint32_t art_quick_assignable_from_code(const mirror::Class* klass,
Stuart Monteithb95a5342014-03-12 13:32:32 +000032 const mirror::Class* ref_class);
Stuart Monteithb95a5342014-03-12 13:32:32 +000033
Stuart Monteithb95a5342014-03-12 13:32:32 +000034// Single-precision FP arithmetics.
Zheng Xu0210d112014-06-17 12:25:48 +080035extern "C" float art_quick_fmodf(float a, float b); // REM_FLOAT[_2ADDR]
Stuart Monteithb95a5342014-03-12 13:32:32 +000036
37// Double-precision FP arithmetics.
Andreas Gampee1794562014-11-04 22:26:32 -080038extern "C" double art_quick_fmod(double a, double b); // REM_DOUBLE[_2ADDR]
Zheng Xu0210d112014-06-17 12:25:48 +080039
Stuart Monteithb95a5342014-03-12 13:32:32 +000040
41void InitEntryPoints(InterpreterEntryPoints* ipoints, JniEntryPoints* jpoints,
42 PortableEntryPoints* ppoints, QuickEntryPoints* qpoints) {
43 // Interpreter
44 ipoints->pInterpreterToInterpreterBridge = artInterpreterToInterpreterBridge;
45 ipoints->pInterpreterToCompiledCodeBridge = artInterpreterToCompiledCodeBridge;
46
47 // JNI
48 jpoints->pDlsymLookup = art_jni_dlsym_lookup_stub;
49
50 // Portable
51 ppoints->pPortableResolutionTrampoline = art_portable_resolution_trampoline;
52 ppoints->pPortableToInterpreterBridge = art_portable_to_interpreter_bridge;
53
54 // Alloc
55 ResetQuickAllocEntryPoints(qpoints);
56
57 // Cast
Serban Constantinescu86797a72014-06-19 16:17:56 +010058 qpoints->pInstanceofNonTrivial = art_quick_assignable_from_code;
Stuart Monteithb95a5342014-03-12 13:32:32 +000059 qpoints->pCheckCast = art_quick_check_cast;
60
61 // DexCache
62 qpoints->pInitializeStaticStorage = art_quick_initialize_static_storage;
63 qpoints->pInitializeTypeAndVerifyAccess = art_quick_initialize_type_and_verify_access;
64 qpoints->pInitializeType = art_quick_initialize_type;
65 qpoints->pResolveString = art_quick_resolve_string;
66
67 // Field
Fred Shih37f05ef2014-07-16 18:38:08 -070068 qpoints->pSet8Instance = art_quick_set8_instance;
69 qpoints->pSet8Static = art_quick_set8_static;
70 qpoints->pSet16Instance = art_quick_set16_instance;
71 qpoints->pSet16Static = art_quick_set16_static;
Stuart Monteithb95a5342014-03-12 13:32:32 +000072 qpoints->pSet32Instance = art_quick_set32_instance;
73 qpoints->pSet32Static = art_quick_set32_static;
74 qpoints->pSet64Instance = art_quick_set64_instance;
75 qpoints->pSet64Static = art_quick_set64_static;
76 qpoints->pSetObjInstance = art_quick_set_obj_instance;
77 qpoints->pSetObjStatic = art_quick_set_obj_static;
Fred Shih37f05ef2014-07-16 18:38:08 -070078 qpoints->pGetBooleanInstance = art_quick_get_boolean_instance;
79 qpoints->pGetByteInstance = art_quick_get_byte_instance;
80 qpoints->pGetCharInstance = art_quick_get_char_instance;
81 qpoints->pGetShortInstance = art_quick_get_short_instance;
Stuart Monteithb95a5342014-03-12 13:32:32 +000082 qpoints->pGet32Instance = art_quick_get32_instance;
83 qpoints->pGet64Instance = art_quick_get64_instance;
84 qpoints->pGetObjInstance = art_quick_get_obj_instance;
Fred Shih37f05ef2014-07-16 18:38:08 -070085 qpoints->pGetBooleanStatic = art_quick_get_boolean_static;
86 qpoints->pGetByteStatic = art_quick_get_byte_static;
87 qpoints->pGetCharStatic = art_quick_get_char_static;
88 qpoints->pGetShortStatic = art_quick_get_short_static;
Stuart Monteithb95a5342014-03-12 13:32:32 +000089 qpoints->pGet32Static = art_quick_get32_static;
90 qpoints->pGet64Static = art_quick_get64_static;
91 qpoints->pGetObjStatic = art_quick_get_obj_static;
92
93 // Array
94 qpoints->pAputObjectWithNullAndBoundCheck = art_quick_aput_obj_with_null_and_bound_check;
95 qpoints->pAputObjectWithBoundCheck = art_quick_aput_obj_with_bound_check;
96 qpoints->pAputObject = art_quick_aput_obj;
97 qpoints->pHandleFillArrayData = art_quick_handle_fill_data;
98
99 // JNI
100 qpoints->pJniMethodStart = JniMethodStart;
101 qpoints->pJniMethodStartSynchronized = JniMethodStartSynchronized;
102 qpoints->pJniMethodEnd = JniMethodEnd;
103 qpoints->pJniMethodEndSynchronized = JniMethodEndSynchronized;
104 qpoints->pJniMethodEndWithReference = JniMethodEndWithReference;
105 qpoints->pJniMethodEndWithReferenceSynchronized = JniMethodEndWithReferenceSynchronized;
106 qpoints->pQuickGenericJniTrampoline = art_quick_generic_jni_trampoline;
107
108 // Locks
109 qpoints->pLockObject = art_quick_lock_object;
110 qpoints->pUnlockObject = art_quick_unlock_object;
111
112 // Math
Zheng Xu0210d112014-06-17 12:25:48 +0800113 // TODO nullptr entrypoints not needed for ARM64 - generate inline.
114 qpoints->pCmpgDouble = nullptr;
115 qpoints->pCmpgFloat = nullptr;
116 qpoints->pCmplDouble = nullptr;
117 qpoints->pCmplFloat = nullptr;
118 qpoints->pFmod = art_quick_fmod;
119 qpoints->pL2d = nullptr;
120 qpoints->pFmodf = art_quick_fmodf;
121 qpoints->pL2f = nullptr;
122 qpoints->pD2iz = nullptr;
123 qpoints->pF2iz = nullptr;
124 qpoints->pIdivmod = nullptr;
125 qpoints->pD2l = nullptr;
126 qpoints->pF2l = nullptr;
127 qpoints->pLdiv = nullptr;
128 qpoints->pLmod = nullptr;
129 qpoints->pLmul = nullptr;
130 qpoints->pShlLong = nullptr;
131 qpoints->pShrLong = nullptr;
132 qpoints->pUshrLong = nullptr;
Stuart Monteithb95a5342014-03-12 13:32:32 +0000133
134 // Intrinsics
135 qpoints->pIndexOf = art_quick_indexof;
Stuart Monteithb95a5342014-03-12 13:32:32 +0000136 qpoints->pStringCompareTo = art_quick_string_compareto;
Zheng Xu0210d112014-06-17 12:25:48 +0800137 qpoints->pMemcpy = art_quick_memcpy;
Stuart Monteithb95a5342014-03-12 13:32:32 +0000138
139 // Invocation
140 qpoints->pQuickImtConflictTrampoline = art_quick_imt_conflict_trampoline;
141 qpoints->pQuickResolutionTrampoline = art_quick_resolution_trampoline;
142 qpoints->pQuickToInterpreterBridge = art_quick_to_interpreter_bridge;
143 qpoints->pInvokeDirectTrampolineWithAccessCheck = art_quick_invoke_direct_trampoline_with_access_check;
144 qpoints->pInvokeInterfaceTrampolineWithAccessCheck = art_quick_invoke_interface_trampoline_with_access_check;
145 qpoints->pInvokeStaticTrampolineWithAccessCheck = art_quick_invoke_static_trampoline_with_access_check;
146 qpoints->pInvokeSuperTrampolineWithAccessCheck = art_quick_invoke_super_trampoline_with_access_check;
147 qpoints->pInvokeVirtualTrampolineWithAccessCheck = art_quick_invoke_virtual_trampoline_with_access_check;
148
149 // Thread
Stuart Monteithb95a5342014-03-12 13:32:32 +0000150 qpoints->pTestSuspend = art_quick_test_suspend;
151
152 // Throws
153 qpoints->pDeliverException = art_quick_deliver_exception;
154 qpoints->pThrowArrayBounds = art_quick_throw_array_bounds;
155 qpoints->pThrowDivZero = art_quick_throw_div_zero;
156 qpoints->pThrowNoSuchMethod = art_quick_throw_no_such_method;
157 qpoints->pThrowNullPointer = art_quick_throw_null_pointer_exception;
158 qpoints->pThrowStackOverflow = art_quick_throw_stack_overflow;
159};
160
161} // namespace art