blob: 5c8ff8f300f2829a54e6b2aecba70510e555e2e2 [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
Mingyao Yang98d1cc82014-05-15 17:02:16 -070017#include "entrypoints/jni/jni_entrypoints.h"
Andreas Gampee1794562014-11-04 22:26:32 -080018#include "entrypoints/quick/quick_alloc_entrypoints.h"
19#include "entrypoints/quick/quick_default_externs.h"
Stuart Monteithb95a5342014-03-12 13:32:32 +000020#include "entrypoints/quick/quick_entrypoints.h"
21#include "entrypoints/entrypoint_utils.h"
22#include "entrypoints/math_entrypoints.h"
Ian Rogers6f3dbba2014-10-14 17:41:57 -070023#include "entrypoints/runtime_asm_entrypoints.h"
24#include "interpreter/interpreter.h"
Stuart Monteithb95a5342014-03-12 13:32:32 +000025
26namespace art {
27
Stuart Monteithb95a5342014-03-12 13:32:32 +000028// Cast entrypoints.
Serban Constantinescu9bd88b02015-04-22 16:24:46 +010029extern "C" uint32_t artIsAssignableFromCode(const mirror::Class* klass,
Stuart Monteithb95a5342014-03-12 13:32:32 +000030 const mirror::Class* ref_class);
Stuart Monteithb95a5342014-03-12 13:32:32 +000031
Andreas Gampe3cfa4d02015-10-06 17:04:01 -070032void InitEntryPoints(JniEntryPoints* jpoints, QuickEntryPoints* qpoints) {
Stuart Monteithb95a5342014-03-12 13:32:32 +000033 // JNI
34 jpoints->pDlsymLookup = art_jni_dlsym_lookup_stub;
35
Stuart Monteithb95a5342014-03-12 13:32:32 +000036 // Alloc
37 ResetQuickAllocEntryPoints(qpoints);
38
39 // Cast
Serban Constantinescu9bd88b02015-04-22 16:24:46 +010040 qpoints->pInstanceofNonTrivial = artIsAssignableFromCode;
Stuart Monteithb95a5342014-03-12 13:32:32 +000041 qpoints->pCheckCast = art_quick_check_cast;
42
43 // DexCache
44 qpoints->pInitializeStaticStorage = art_quick_initialize_static_storage;
45 qpoints->pInitializeTypeAndVerifyAccess = art_quick_initialize_type_and_verify_access;
46 qpoints->pInitializeType = art_quick_initialize_type;
47 qpoints->pResolveString = art_quick_resolve_string;
48
49 // Field
Fred Shih37f05ef2014-07-16 18:38:08 -070050 qpoints->pSet8Instance = art_quick_set8_instance;
51 qpoints->pSet8Static = art_quick_set8_static;
52 qpoints->pSet16Instance = art_quick_set16_instance;
53 qpoints->pSet16Static = art_quick_set16_static;
Stuart Monteithb95a5342014-03-12 13:32:32 +000054 qpoints->pSet32Instance = art_quick_set32_instance;
55 qpoints->pSet32Static = art_quick_set32_static;
56 qpoints->pSet64Instance = art_quick_set64_instance;
57 qpoints->pSet64Static = art_quick_set64_static;
58 qpoints->pSetObjInstance = art_quick_set_obj_instance;
59 qpoints->pSetObjStatic = art_quick_set_obj_static;
Fred Shih37f05ef2014-07-16 18:38:08 -070060 qpoints->pGetBooleanInstance = art_quick_get_boolean_instance;
61 qpoints->pGetByteInstance = art_quick_get_byte_instance;
62 qpoints->pGetCharInstance = art_quick_get_char_instance;
63 qpoints->pGetShortInstance = art_quick_get_short_instance;
Stuart Monteithb95a5342014-03-12 13:32:32 +000064 qpoints->pGet32Instance = art_quick_get32_instance;
65 qpoints->pGet64Instance = art_quick_get64_instance;
66 qpoints->pGetObjInstance = art_quick_get_obj_instance;
Fred Shih37f05ef2014-07-16 18:38:08 -070067 qpoints->pGetBooleanStatic = art_quick_get_boolean_static;
68 qpoints->pGetByteStatic = art_quick_get_byte_static;
69 qpoints->pGetCharStatic = art_quick_get_char_static;
70 qpoints->pGetShortStatic = art_quick_get_short_static;
Stuart Monteithb95a5342014-03-12 13:32:32 +000071 qpoints->pGet32Static = art_quick_get32_static;
72 qpoints->pGet64Static = art_quick_get64_static;
73 qpoints->pGetObjStatic = art_quick_get_obj_static;
74
75 // Array
76 qpoints->pAputObjectWithNullAndBoundCheck = art_quick_aput_obj_with_null_and_bound_check;
77 qpoints->pAputObjectWithBoundCheck = art_quick_aput_obj_with_bound_check;
78 qpoints->pAputObject = art_quick_aput_obj;
79 qpoints->pHandleFillArrayData = art_quick_handle_fill_data;
80
81 // JNI
82 qpoints->pJniMethodStart = JniMethodStart;
83 qpoints->pJniMethodStartSynchronized = JniMethodStartSynchronized;
84 qpoints->pJniMethodEnd = JniMethodEnd;
85 qpoints->pJniMethodEndSynchronized = JniMethodEndSynchronized;
86 qpoints->pJniMethodEndWithReference = JniMethodEndWithReference;
87 qpoints->pJniMethodEndWithReferenceSynchronized = JniMethodEndWithReferenceSynchronized;
88 qpoints->pQuickGenericJniTrampoline = art_quick_generic_jni_trampoline;
89
90 // Locks
91 qpoints->pLockObject = art_quick_lock_object;
92 qpoints->pUnlockObject = art_quick_unlock_object;
93
94 // Math
Mathieu Chartier2cebb242015-04-21 16:50:40 -070095 // TODO null entrypoints not needed for ARM64 - generate inline.
Zheng Xu0210d112014-06-17 12:25:48 +080096 qpoints->pCmpgDouble = nullptr;
97 qpoints->pCmpgFloat = nullptr;
98 qpoints->pCmplDouble = nullptr;
99 qpoints->pCmplFloat = nullptr;
Serban Constantinescu9bd88b02015-04-22 16:24:46 +0100100 qpoints->pFmod = fmod;
Zheng Xu0210d112014-06-17 12:25:48 +0800101 qpoints->pL2d = nullptr;
Serban Constantinescu9bd88b02015-04-22 16:24:46 +0100102 qpoints->pFmodf = fmodf;
Zheng Xu0210d112014-06-17 12:25:48 +0800103 qpoints->pL2f = nullptr;
104 qpoints->pD2iz = nullptr;
105 qpoints->pF2iz = nullptr;
106 qpoints->pIdivmod = nullptr;
107 qpoints->pD2l = nullptr;
108 qpoints->pF2l = nullptr;
109 qpoints->pLdiv = nullptr;
110 qpoints->pLmod = nullptr;
111 qpoints->pLmul = nullptr;
112 qpoints->pShlLong = nullptr;
113 qpoints->pShrLong = nullptr;
114 qpoints->pUshrLong = nullptr;
Stuart Monteithb95a5342014-03-12 13:32:32 +0000115
116 // Intrinsics
117 qpoints->pIndexOf = art_quick_indexof;
Stuart Monteithb95a5342014-03-12 13:32:32 +0000118 qpoints->pStringCompareTo = art_quick_string_compareto;
Serban Constantinescu9bd88b02015-04-22 16:24:46 +0100119 qpoints->pMemcpy = memcpy;
Stuart Monteithb95a5342014-03-12 13:32:32 +0000120
121 // Invocation
122 qpoints->pQuickImtConflictTrampoline = art_quick_imt_conflict_trampoline;
123 qpoints->pQuickResolutionTrampoline = art_quick_resolution_trampoline;
124 qpoints->pQuickToInterpreterBridge = art_quick_to_interpreter_bridge;
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700125 qpoints->pInvokeDirectTrampolineWithAccessCheck =
126 art_quick_invoke_direct_trampoline_with_access_check;
127 qpoints->pInvokeInterfaceTrampolineWithAccessCheck =
128 art_quick_invoke_interface_trampoline_with_access_check;
129 qpoints->pInvokeStaticTrampolineWithAccessCheck =
130 art_quick_invoke_static_trampoline_with_access_check;
131 qpoints->pInvokeSuperTrampolineWithAccessCheck =
132 art_quick_invoke_super_trampoline_with_access_check;
133 qpoints->pInvokeVirtualTrampolineWithAccessCheck =
134 art_quick_invoke_virtual_trampoline_with_access_check;
Stuart Monteithb95a5342014-03-12 13:32:32 +0000135
136 // Thread
Stuart Monteithb95a5342014-03-12 13:32:32 +0000137 qpoints->pTestSuspend = art_quick_test_suspend;
138
139 // Throws
140 qpoints->pDeliverException = art_quick_deliver_exception;
141 qpoints->pThrowArrayBounds = art_quick_throw_array_bounds;
142 qpoints->pThrowDivZero = art_quick_throw_div_zero;
143 qpoints->pThrowNoSuchMethod = art_quick_throw_no_such_method;
144 qpoints->pThrowNullPointer = art_quick_throw_null_pointer_exception;
145 qpoints->pThrowStackOverflow = art_quick_throw_stack_overflow;
Mingyao Yangd43b3ac2015-04-01 14:03:04 -0700146
Sebastien Hertz07474662015-08-25 15:12:33 +0000147 // Deoptimization from compiled code.
148 qpoints->pDeoptimize = art_quick_deoptimize_from_compiled_code;
Hiroshi Yamauchi1cc71eb2015-05-07 10:47:27 -0700149
Roland Levillain0d5a2812015-11-13 10:07:31 +0000150 // Read barrier.
Hiroshi Yamauchi1cc71eb2015-05-07 10:47:27 -0700151 qpoints->pReadBarrierJni = ReadBarrierJni;
Roland Levillain7c1559a2015-12-15 10:55:36 +0000152 qpoints->pReadBarrierMark = artReadBarrierMark;
Man Cao1aee9002015-07-14 22:31:42 -0700153 qpoints->pReadBarrierSlow = artReadBarrierSlow;
Roland Levillain0d5a2812015-11-13 10:07:31 +0000154 qpoints->pReadBarrierForRootSlow = artReadBarrierForRootSlow;
Stuart Monteithb95a5342014-03-12 13:32:32 +0000155};
156
157} // namespace art