blob: 0cddec41022206edfef55dc13f90fd5d8b3b7288 [file] [log] [blame]
Ian Rogersef7d42f2014-01-06 12:55:46 -08001/*
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"
Mathieu Chartierd8891782014-03-02 13:28:37 -080019#include "entrypoints/quick/quick_alloc_entrypoints.h"
Andreas Gampee1794562014-11-04 22:26:32 -080020#include "entrypoints/quick/quick_default_externs.h"
Ian Rogersef7d42f2014-01-06 12:55:46 -080021#include "entrypoints/quick/quick_entrypoints.h"
Alexei Zavjalov1d4d7bd2014-05-23 17:51:59 +070022#include "entrypoints/math_entrypoints.h"
Ian Rogers6f3dbba2014-10-14 17:41:57 -070023#include "entrypoints/runtime_asm_entrypoints.h"
24#include "interpreter/interpreter.h"
Ian Rogersef7d42f2014-01-06 12:55:46 -080025
26namespace art {
27
Ian Rogersef7d42f2014-01-06 12:55:46 -080028// Cast entrypoints.
Serguei Katkovc3801912014-07-08 17:21:53 +070029extern "C" uint32_t art_quick_assignable_from_code(const mirror::Class* klass,
Andreas Gampee1794562014-11-04 22:26:32 -080030 const mirror::Class* ref_class);
Ian Rogersef7d42f2014-01-06 12:55:46 -080031
32void InitEntryPoints(InterpreterEntryPoints* ipoints, JniEntryPoints* jpoints,
Elliott Hughes956af0f2014-12-11 14:34:28 -080033 QuickEntryPoints* qpoints) {
Ian Rogersc3ccc102014-06-25 11:52:14 -070034#if defined(__APPLE__)
Elliott Hughes956af0f2014-12-11 14:34:28 -080035 UNUSED(ipoints, jpoints, qpoints);
Ian Rogersc3ccc102014-06-25 11:52:14 -070036 UNIMPLEMENTED(FATAL);
37#else
Ian Rogersef7d42f2014-01-06 12:55:46 -080038 // Interpreter
39 ipoints->pInterpreterToInterpreterBridge = artInterpreterToInterpreterBridge;
40 ipoints->pInterpreterToCompiledCodeBridge = artInterpreterToCompiledCodeBridge;
41
42 // JNI
43 jpoints->pDlsymLookup = art_jni_dlsym_lookup_stub;
44
Ian Rogersef7d42f2014-01-06 12:55:46 -080045 // Alloc
46 ResetQuickAllocEntryPoints(qpoints);
47
48 // Cast
Serguei Katkovc3801912014-07-08 17:21:53 +070049 qpoints->pInstanceofNonTrivial = art_quick_assignable_from_code;
Ian Rogersef7d42f2014-01-06 12:55:46 -080050 qpoints->pCheckCast = art_quick_check_cast;
51
52 // DexCache
53 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;
57
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 Rogersef7d42f2014-01-06 12:55:46 -080063 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 Rogersef7d42f2014-01-06 12:55:46 -080073 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 Rogersef7d42f2014-01-06 12:55:46 -080080 qpoints->pGet32Static = art_quick_get32_static;
81 qpoints->pGet64Static = art_quick_get64_static;
82 qpoints->pGetObjStatic = art_quick_get_obj_static;
83
84 // 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;
88 qpoints->pHandleFillArrayData = art_quick_handle_fill_data;
89
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 Rogersef7d42f2014-01-06 12:55:46 -080098
99 // Locks
100 qpoints->pLockObject = art_quick_lock_object;
101 qpoints->pUnlockObject = art_quick_unlock_object;
102
103 // Math
Alexei Zavjalov1d4d7bd2014-05-23 17:51:59 +0700104 qpoints->pD2l = art_d2l;
105 qpoints->pF2l = art_f2l;
Ian Rogersef7d42f2014-01-06 12:55:46 -0800106 qpoints->pLdiv = art_quick_ldiv;
107 qpoints->pLmod = art_quick_lmod;
108 qpoints->pLmul = art_quick_lmul;
109 qpoints->pShlLong = art_quick_lshl;
110 qpoints->pShrLong = art_quick_lshr;
111 qpoints->pUshrLong = art_quick_lushr;
112
113 // Intrinsics
Ian Rogersef7d42f2014-01-06 12:55:46 -0800114 qpoints->pStringCompareTo = art_quick_string_compareto;
115 qpoints->pMemcpy = art_quick_memcpy;
116
117 // Invocation
118 qpoints->pQuickImtConflictTrampoline = art_quick_imt_conflict_trampoline;
119 qpoints->pQuickResolutionTrampoline = art_quick_resolution_trampoline;
120 qpoints->pQuickToInterpreterBridge = art_quick_to_interpreter_bridge;
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700121 qpoints->pInvokeDirectTrampolineWithAccessCheck =
122 art_quick_invoke_direct_trampoline_with_access_check;
123 qpoints->pInvokeInterfaceTrampolineWithAccessCheck =
124 art_quick_invoke_interface_trampoline_with_access_check;
125 qpoints->pInvokeStaticTrampolineWithAccessCheck =
126 art_quick_invoke_static_trampoline_with_access_check;
127 qpoints->pInvokeSuperTrampolineWithAccessCheck =
128 art_quick_invoke_super_trampoline_with_access_check;
129 qpoints->pInvokeVirtualTrampolineWithAccessCheck =
130 art_quick_invoke_virtual_trampoline_with_access_check;
Ian Rogersef7d42f2014-01-06 12:55:46 -0800131
132 // Thread
Ian Rogersef7d42f2014-01-06 12:55:46 -0800133 qpoints->pTestSuspend = art_quick_test_suspend;
134
135 // Throws
136 qpoints->pDeliverException = art_quick_deliver_exception;
137 qpoints->pThrowArrayBounds = art_quick_throw_array_bounds;
138 qpoints->pThrowDivZero = art_quick_throw_div_zero;
139 qpoints->pThrowNoSuchMethod = art_quick_throw_no_such_method;
140 qpoints->pThrowNullPointer = art_quick_throw_null_pointer_exception;
141 qpoints->pThrowStackOverflow = art_quick_throw_stack_overflow;
Mingyao Yangd43b3ac2015-04-01 14:03:04 -0700142
143 // Deoptimize
144 qpoints->pDeoptimize = art_quick_deoptimize_from_compiled_slow_path;
Ian Rogersc3ccc102014-06-25 11:52:14 -0700145#endif // __APPLE__
Ian Rogersef7d42f2014-01-06 12:55:46 -0800146};
147
148} // namespace art