blob: 48d6c805f4d1ad7a0cf63ebea33c2aec7995e894 [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
Ian Rogers848871b2013-08-05 10:56:33 -070032void InitEntryPoints(InterpreterEntryPoints* ipoints, JniEntryPoints* jpoints,
33 PortableEntryPoints* ppoints, QuickEntryPoints* qpoints) {
34 // Interpreter
35 ipoints->pInterpreterToInterpreterBridge = artInterpreterToInterpreterBridge;
Dragos Sbirlea08bf1962013-08-12 08:53:04 -070036 ipoints->pInterpreterToCompiledCodeBridge = artInterpreterToCompiledCodeBridge;
Ian Rogers848871b2013-08-05 10:56:33 -070037
38 // JNI
39 jpoints->pDlsymLookup = art_jni_dlsym_lookup_stub;
40
41 // Portable
42 ppoints->pPortableResolutionTrampoline = art_portable_resolution_trampoline;
43 ppoints->pPortableToInterpreterBridge = art_portable_to_interpreter_bridge;
44
Ian Rogers7655f292013-07-29 11:07:13 -070045 // Alloc
Hiroshi Yamauchi3b4c1892013-09-12 21:33:12 -070046 ResetQuickAllocEntryPoints(qpoints);
Ian Rogers7655f292013-07-29 11:07:13 -070047
48 // Cast
Ian Rogers848871b2013-08-05 10:56:33 -070049 qpoints->pInstanceofNonTrivial = art_quick_is_assignable;
Ian Rogers848871b2013-08-05 10:56:33 -070050 qpoints->pCheckCast = art_quick_check_cast;
Ian Rogers7655f292013-07-29 11:07:13 -070051
52 // DexCache
Ian Rogers848871b2013-08-05 10:56:33 -070053 qpoints->pInitializeStaticStorage = art_quick_initialize_static_storage;
54 qpoints->pInitializeTypeAndVerifyAccess = art_quick_initialize_type_and_verify_access;
55 qpoints->pInitializeType = art_quick_initialize_type;
56 qpoints->pResolveString = art_quick_resolve_string;
Ian Rogers7655f292013-07-29 11:07:13 -070057
58 // Field
Fred Shih37f05ef2014-07-16 18:38:08 -070059 qpoints->pSet8Instance = art_quick_set8_instance;
60 qpoints->pSet8Static = art_quick_set8_static;
61 qpoints->pSet16Instance = art_quick_set16_instance;
62 qpoints->pSet16Static = art_quick_set16_static;
Ian Rogers848871b2013-08-05 10:56:33 -070063 qpoints->pSet32Instance = art_quick_set32_instance;
64 qpoints->pSet32Static = art_quick_set32_static;
65 qpoints->pSet64Instance = art_quick_set64_instance;
66 qpoints->pSet64Static = art_quick_set64_static;
67 qpoints->pSetObjInstance = art_quick_set_obj_instance;
68 qpoints->pSetObjStatic = art_quick_set_obj_static;
Fred Shih37f05ef2014-07-16 18:38:08 -070069 qpoints->pGetByteInstance = art_quick_get_byte_instance;
70 qpoints->pGetBooleanInstance = art_quick_get_boolean_instance;
71 qpoints->pGetShortInstance = art_quick_get_short_instance;
72 qpoints->pGetCharInstance = art_quick_get_char_instance;
Ian Rogers848871b2013-08-05 10:56:33 -070073 qpoints->pGet32Instance = art_quick_get32_instance;
74 qpoints->pGet64Instance = art_quick_get64_instance;
75 qpoints->pGetObjInstance = art_quick_get_obj_instance;
Fred Shih37f05ef2014-07-16 18:38:08 -070076 qpoints->pGetByteStatic = art_quick_get_byte_static;
77 qpoints->pGetBooleanStatic = art_quick_get_boolean_static;
78 qpoints->pGetShortStatic = art_quick_get_short_static;
79 qpoints->pGetCharStatic = art_quick_get_char_static;
Ian Rogers848871b2013-08-05 10:56:33 -070080 qpoints->pGet32Static = art_quick_get32_static;
81 qpoints->pGet64Static = art_quick_get64_static;
82 qpoints->pGetObjStatic = art_quick_get_obj_static;
Ian Rogers7655f292013-07-29 11:07:13 -070083
Ian Rogersa9a82542013-10-04 11:17:26 -070084 // Array
85 qpoints->pAputObjectWithNullAndBoundCheck = art_quick_aput_obj_with_null_and_bound_check;
86 qpoints->pAputObjectWithBoundCheck = art_quick_aput_obj_with_bound_check;
87 qpoints->pAputObject = art_quick_aput_obj;
Ian Rogers848871b2013-08-05 10:56:33 -070088 qpoints->pHandleFillArrayData = art_quick_handle_fill_data;
Ian Rogers7655f292013-07-29 11:07:13 -070089
90 // JNI
91 qpoints->pJniMethodStart = JniMethodStart;
92 qpoints->pJniMethodStartSynchronized = JniMethodStartSynchronized;
93 qpoints->pJniMethodEnd = JniMethodEnd;
94 qpoints->pJniMethodEndSynchronized = JniMethodEndSynchronized;
95 qpoints->pJniMethodEndWithReference = JniMethodEndWithReference;
96 qpoints->pJniMethodEndWithReferenceSynchronized = JniMethodEndWithReferenceSynchronized;
Andreas Gampe2da88232014-02-27 12:26:20 -080097 qpoints->pQuickGenericJniTrampoline = art_quick_generic_jni_trampoline;
Ian Rogers7655f292013-07-29 11:07:13 -070098
99 // Locks
Ian Rogers848871b2013-08-05 10:56:33 -0700100 qpoints->pLockObject = art_quick_lock_object;
101 qpoints->pUnlockObject = art_quick_unlock_object;
Ian Rogers7655f292013-07-29 11:07:13 -0700102
103 // Math
104 // points->pCmpgDouble = NULL; // Not needed on x86.
105 // points->pCmpgFloat = NULL; // Not needed on x86.
106 // points->pCmplDouble = NULL; // Not needed on x86.
107 // points->pCmplFloat = NULL; // Not needed on x86.
Alexei Zavjalovbd3682e2014-06-12 03:08:01 +0700108 // qpoints->pFmod = NULL; // Not needed on x86.
Alexei Zavjalov1d4d7bd2014-05-23 17:51:59 +0700109 // qpoints->pL2d = NULL; // Not needed on x86.
Alexei Zavjalovbd3682e2014-06-12 03:08:01 +0700110 // qpoints->pFmodf = NULL; // Not needed on x86.
Alexei Zavjalov1d4d7bd2014-05-23 17:51:59 +0700111 // qpoints->pL2f = NULL; // Not needed on x86.
Ian Rogers7655f292013-07-29 11:07:13 -0700112 // points->pD2iz = NULL; // Not needed on x86.
113 // points->pF2iz = NULL; // Not needed on x86.
Alexei Zavjalov1d4d7bd2014-05-23 17:51:59 +0700114 // qpoints->pIdivmod = NULL; // Not needed on x86.
Ian Rogers848871b2013-08-05 10:56:33 -0700115 qpoints->pD2l = art_quick_d2l;
116 qpoints->pF2l = art_quick_f2l;
117 qpoints->pLdiv = art_quick_ldiv;
Ian Rogersa9a82542013-10-04 11:17:26 -0700118 qpoints->pLmod = art_quick_lmod;
Ian Rogers848871b2013-08-05 10:56:33 -0700119 qpoints->pLmul = art_quick_lmul;
120 qpoints->pShlLong = art_quick_lshl;
121 qpoints->pShrLong = art_quick_lshr;
122 qpoints->pUshrLong = art_quick_lushr;
Ian Rogers7655f292013-07-29 11:07:13 -0700123
124 // Intrinsics
Mark Mendell4028a6c2014-02-19 20:06:20 -0800125 // qpoints->pIndexOf = nullptr; // Not needed on x86
Ian Rogers7655f292013-07-29 11:07:13 -0700126 qpoints->pStringCompareTo = art_quick_string_compareto;
127 qpoints->pMemcpy = art_quick_memcpy;
128
129 // Invocation
Jeff Hao88474b42013-10-23 16:24:40 -0700130 qpoints->pQuickImtConflictTrampoline = art_quick_imt_conflict_trampoline;
Ian Rogers848871b2013-08-05 10:56:33 -0700131 qpoints->pQuickResolutionTrampoline = art_quick_resolution_trampoline;
132 qpoints->pQuickToInterpreterBridge = art_quick_to_interpreter_bridge;
Ian Rogers7655f292013-07-29 11:07:13 -0700133 qpoints->pInvokeDirectTrampolineWithAccessCheck = art_quick_invoke_direct_trampoline_with_access_check;
Ian Rogers7655f292013-07-29 11:07:13 -0700134 qpoints->pInvokeInterfaceTrampolineWithAccessCheck = art_quick_invoke_interface_trampoline_with_access_check;
135 qpoints->pInvokeStaticTrampolineWithAccessCheck = art_quick_invoke_static_trampoline_with_access_check;
136 qpoints->pInvokeSuperTrampolineWithAccessCheck = art_quick_invoke_super_trampoline_with_access_check;
137 qpoints->pInvokeVirtualTrampolineWithAccessCheck = art_quick_invoke_virtual_trampoline_with_access_check;
138
139 // Thread
Ian Rogers848871b2013-08-05 10:56:33 -0700140 qpoints->pTestSuspend = art_quick_test_suspend;
Ian Rogers7655f292013-07-29 11:07:13 -0700141
142 // Throws
Ian Rogers848871b2013-08-05 10:56:33 -0700143 qpoints->pDeliverException = art_quick_deliver_exception;
144 qpoints->pThrowArrayBounds = art_quick_throw_array_bounds;
145 qpoints->pThrowDivZero = art_quick_throw_div_zero;
146 qpoints->pThrowNoSuchMethod = art_quick_throw_no_such_method;
147 qpoints->pThrowNullPointer = art_quick_throw_null_pointer_exception;
148 qpoints->pThrowStackOverflow = art_quick_throw_stack_overflow;
Ian Rogers7655f292013-07-29 11:07:13 -0700149};
150
151} // namespace art