blob: a1215420a4e7eda3b99d01c16b2ab308510b75b6 [file] [log] [blame]
Ian Rogers7655f292013-07-29 11:07:13 -07001/*
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 Yang98d1cc82014-05-15 17:02:16 -070017#include "entrypoints/interpreter/interpreter_entrypoints.h"
18#include "entrypoints/jni/jni_entrypoints.h"
Ian Rogers7655f292013-07-29 11:07:13 -070019#include "entrypoints/portable/portable_entrypoints.h"
Mathieu Chartierd8891782014-03-02 13:28:37 -080020#include "entrypoints/quick/quick_alloc_entrypoints.h"
Andreas Gampee1794562014-11-04 22:26:32 -080021#include "entrypoints/quick/quick_default_externs.h"
Ian Rogers7655f292013-07-29 11:07:13 -070022#include "entrypoints/quick/quick_entrypoints.h"
Ian Rogers6f3dbba2014-10-14 17:41:57 -070023#include "entrypoints/runtime_asm_entrypoints.h"
24#include "interpreter/interpreter.h"
Ian Rogers7655f292013-07-29 11:07:13 -070025
26namespace art {
27
Ian Rogers848871b2013-08-05 10:56:33 -070028// Cast entrypoints.
29extern "C" uint32_t art_quick_is_assignable(const mirror::Class* klass,
Andreas Gampee1794562014-11-04 22:26:32 -080030 const mirror::Class* ref_class);
Hiroshi Yamauchi3b4c1892013-09-12 21:33:12 -070031
Calin Juravled2ec87d2014-12-08 14:24:46 +000032// fmod entrypointes.
33extern "C" double art_quick_fmod(double, double);
34extern "C" float art_quick_fmodf(float, float);
35
Ian Rogers848871b2013-08-05 10:56:33 -070036void InitEntryPoints(InterpreterEntryPoints* ipoints, JniEntryPoints* jpoints,
37 PortableEntryPoints* ppoints, QuickEntryPoints* qpoints) {
38 // Interpreter
39 ipoints->pInterpreterToInterpreterBridge = artInterpreterToInterpreterBridge;
Dragos Sbirlea08bf1962013-08-12 08:53:04 -070040 ipoints->pInterpreterToCompiledCodeBridge = artInterpreterToCompiledCodeBridge;
Ian Rogers848871b2013-08-05 10:56:33 -070041
42 // JNI
43 jpoints->pDlsymLookup = art_jni_dlsym_lookup_stub;
44
45 // Portable
46 ppoints->pPortableResolutionTrampoline = art_portable_resolution_trampoline;
47 ppoints->pPortableToInterpreterBridge = art_portable_to_interpreter_bridge;
48
Ian Rogers7655f292013-07-29 11:07:13 -070049 // Alloc
Hiroshi Yamauchi3b4c1892013-09-12 21:33:12 -070050 ResetQuickAllocEntryPoints(qpoints);
Ian Rogers7655f292013-07-29 11:07:13 -070051
52 // Cast
Ian Rogers848871b2013-08-05 10:56:33 -070053 qpoints->pInstanceofNonTrivial = art_quick_is_assignable;
Ian Rogers848871b2013-08-05 10:56:33 -070054 qpoints->pCheckCast = art_quick_check_cast;
Ian Rogers7655f292013-07-29 11:07:13 -070055
56 // DexCache
Ian Rogers848871b2013-08-05 10:56:33 -070057 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;
Ian Rogers7655f292013-07-29 11:07:13 -070061
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;
Ian Rogers848871b2013-08-05 10:56:33 -070067 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->pGetByteInstance = art_quick_get_byte_instance;
74 qpoints->pGetBooleanInstance = art_quick_get_boolean_instance;
75 qpoints->pGetShortInstance = art_quick_get_short_instance;
76 qpoints->pGetCharInstance = art_quick_get_char_instance;
Ian Rogers848871b2013-08-05 10:56:33 -070077 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->pGetByteStatic = art_quick_get_byte_static;
81 qpoints->pGetBooleanStatic = art_quick_get_boolean_static;
82 qpoints->pGetShortStatic = art_quick_get_short_static;
83 qpoints->pGetCharStatic = art_quick_get_char_static;
Ian Rogers848871b2013-08-05 10:56:33 -070084 qpoints->pGet32Static = art_quick_get32_static;
85 qpoints->pGet64Static = art_quick_get64_static;
86 qpoints->pGetObjStatic = art_quick_get_obj_static;
Ian Rogers7655f292013-07-29 11:07:13 -070087
Ian Rogersa9a82542013-10-04 11:17:26 -070088 // 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;
Ian Rogers848871b2013-08-05 10:56:33 -070092 qpoints->pHandleFillArrayData = art_quick_handle_fill_data;
Ian Rogers7655f292013-07-29 11:07:13 -070093
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;
Andreas Gampe2da88232014-02-27 12:26:20 -0800101 qpoints->pQuickGenericJniTrampoline = art_quick_generic_jni_trampoline;
Ian Rogers7655f292013-07-29 11:07:13 -0700102
103 // Locks
Ian Rogers848871b2013-08-05 10:56:33 -0700104 qpoints->pLockObject = art_quick_lock_object;
105 qpoints->pUnlockObject = art_quick_unlock_object;
Ian Rogers7655f292013-07-29 11:07:13 -0700106
107 // Math
108 // points->pCmpgDouble = NULL; // Not needed on x86.
109 // points->pCmpgFloat = NULL; // Not needed on x86.
110 // points->pCmplDouble = NULL; // Not needed on x86.
111 // points->pCmplFloat = NULL; // Not needed on x86.
Calin Juravled2ec87d2014-12-08 14:24:46 +0000112 qpoints->pFmod = art_quick_fmod;
Alexei Zavjalov1d4d7bd2014-05-23 17:51:59 +0700113 // qpoints->pL2d = NULL; // Not needed on x86.
Calin Juravled2ec87d2014-12-08 14:24:46 +0000114 qpoints->pFmodf = art_quick_fmodf;
Alexei Zavjalov1d4d7bd2014-05-23 17:51:59 +0700115 // qpoints->pL2f = NULL; // Not needed on x86.
Ian Rogers7655f292013-07-29 11:07:13 -0700116 // points->pD2iz = NULL; // Not needed on x86.
117 // points->pF2iz = NULL; // Not needed on x86.
Alexei Zavjalov1d4d7bd2014-05-23 17:51:59 +0700118 // qpoints->pIdivmod = NULL; // Not needed on x86.
Ian Rogers848871b2013-08-05 10:56:33 -0700119 qpoints->pD2l = art_quick_d2l;
120 qpoints->pF2l = art_quick_f2l;
121 qpoints->pLdiv = art_quick_ldiv;
Ian Rogersa9a82542013-10-04 11:17:26 -0700122 qpoints->pLmod = art_quick_lmod;
Ian Rogers848871b2013-08-05 10:56:33 -0700123 qpoints->pLmul = art_quick_lmul;
124 qpoints->pShlLong = art_quick_lshl;
125 qpoints->pShrLong = art_quick_lshr;
126 qpoints->pUshrLong = art_quick_lushr;
Ian Rogers7655f292013-07-29 11:07:13 -0700127
128 // Intrinsics
Mark Mendell4028a6c2014-02-19 20:06:20 -0800129 // qpoints->pIndexOf = nullptr; // Not needed on x86
Ian Rogers7655f292013-07-29 11:07:13 -0700130 qpoints->pStringCompareTo = art_quick_string_compareto;
131 qpoints->pMemcpy = art_quick_memcpy;
132
133 // Invocation
Jeff Hao88474b42013-10-23 16:24:40 -0700134 qpoints->pQuickImtConflictTrampoline = art_quick_imt_conflict_trampoline;
Ian Rogers848871b2013-08-05 10:56:33 -0700135 qpoints->pQuickResolutionTrampoline = art_quick_resolution_trampoline;
136 qpoints->pQuickToInterpreterBridge = art_quick_to_interpreter_bridge;
Ian Rogers7655f292013-07-29 11:07:13 -0700137 qpoints->pInvokeDirectTrampolineWithAccessCheck = art_quick_invoke_direct_trampoline_with_access_check;
Ian Rogers7655f292013-07-29 11:07:13 -0700138 qpoints->pInvokeInterfaceTrampolineWithAccessCheck = art_quick_invoke_interface_trampoline_with_access_check;
139 qpoints->pInvokeStaticTrampolineWithAccessCheck = art_quick_invoke_static_trampoline_with_access_check;
140 qpoints->pInvokeSuperTrampolineWithAccessCheck = art_quick_invoke_super_trampoline_with_access_check;
141 qpoints->pInvokeVirtualTrampolineWithAccessCheck = art_quick_invoke_virtual_trampoline_with_access_check;
142
143 // Thread
Ian Rogers848871b2013-08-05 10:56:33 -0700144 qpoints->pTestSuspend = art_quick_test_suspend;
Ian Rogers7655f292013-07-29 11:07:13 -0700145
146 // Throws
Ian Rogers848871b2013-08-05 10:56:33 -0700147 qpoints->pDeliverException = art_quick_deliver_exception;
148 qpoints->pThrowArrayBounds = art_quick_throw_array_bounds;
149 qpoints->pThrowDivZero = art_quick_throw_div_zero;
150 qpoints->pThrowNoSuchMethod = art_quick_throw_no_such_method;
151 qpoints->pThrowNullPointer = art_quick_throw_null_pointer_exception;
152 qpoints->pThrowStackOverflow = art_quick_throw_stack_overflow;
Ian Rogers7655f292013-07-29 11:07:13 -0700153};
154
155} // namespace art