blob: fb25810aa2b83ff8e89a3e3f5acdb1095253bf56 [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
Vladimir Marko3a21e382016-09-02 12:38:38 +010017#include <string.h>
18
Ian Rogers6f3dbba2014-10-14 17:41:57 -070019#include "atomic.h"
Mingyao Yang98d1cc82014-05-15 17:02:16 -070020#include "entrypoints/jni/jni_entrypoints.h"
Mathieu Chartierd8891782014-03-02 13:28:37 -080021#include "entrypoints/quick/quick_alloc_entrypoints.h"
Andreas Gampee1794562014-11-04 22:26:32 -080022#include "entrypoints/quick/quick_default_externs.h"
Ian Rogers7655f292013-07-29 11:07:13 -070023#include "entrypoints/quick/quick_entrypoints.h"
24#include "entrypoints/entrypoint_utils.h"
25#include "entrypoints/math_entrypoints.h"
Ian Rogers6f3dbba2014-10-14 17:41:57 -070026#include "entrypoints/runtime_asm_entrypoints.h"
Nikola Veljkovic2d873b62015-02-20 17:21:15 +010027#include "entrypoints_direct_mips.h"
Ian Rogers6f3dbba2014-10-14 17:41:57 -070028#include "interpreter/interpreter.h"
Ian Rogers7655f292013-07-29 11:07:13 -070029
30namespace art {
31
Ian Rogers7655f292013-07-29 11:07:13 -070032// Cast entrypoints.
Andreas Gampe67409972016-07-19 22:34:53 -070033extern "C" size_t artIsAssignableFromCode(const mirror::Class* klass,
34 const mirror::Class* ref_class);
Ian Rogers7655f292013-07-29 11:07:13 -070035
36// Math entrypoints.
37extern int32_t CmpgDouble(double a, double b);
38extern int32_t CmplDouble(double a, double b);
39extern int32_t CmpgFloat(float a, float b);
40extern int32_t CmplFloat(float a, float b);
Ian Rogersa9a82542013-10-04 11:17:26 -070041extern "C" int64_t artLmul(int64_t a, int64_t b);
42extern "C" int64_t artLdiv(int64_t a, int64_t b);
43extern "C" int64_t artLmod(int64_t a, int64_t b);
Ian Rogers7655f292013-07-29 11:07:13 -070044
45// Math conversions.
46extern "C" int32_t __fixsfsi(float op1); // FLOAT_TO_INT
47extern "C" int32_t __fixdfsi(double op1); // DOUBLE_TO_INT
48extern "C" float __floatdisf(int64_t op1); // LONG_TO_FLOAT
49extern "C" double __floatdidf(int64_t op1); // LONG_TO_DOUBLE
50extern "C" int64_t __fixsfdi(float op1); // FLOAT_TO_LONG
51extern "C" int64_t __fixdfdi(double op1); // DOUBLE_TO_LONG
52
53// Single-precision FP arithmetics.
54extern "C" float fmodf(float a, float b); // REM_FLOAT[_2ADDR]
55
56// Double-precision FP arithmetics.
57extern "C" double fmod(double a, double b); // REM_DOUBLE[_2ADDR]
58
59// Long long arithmetics - REM_LONG[_2ADDR] and DIV_LONG[_2ADDR]
60extern "C" int64_t __divdi3(int64_t, int64_t);
61extern "C" int64_t __moddi3(int64_t, int64_t);
Hiroshi Yamauchi3b4c1892013-09-12 21:33:12 -070062
Andreas Gampe3cfa4d02015-10-06 17:04:01 -070063void InitEntryPoints(JniEntryPoints* jpoints, QuickEntryPoints* qpoints) {
Andreas Gampec7ed09b2016-04-25 20:08:55 -070064 // Note: MIPS has asserts checking for the type of entrypoint. Don't move it
65 // to InitDefaultEntryPoints().
66
Ian Rogers848871b2013-08-05 10:56:33 -070067 // JNI
68 jpoints->pDlsymLookup = art_jni_dlsym_lookup_stub;
69
Ian Rogers7655f292013-07-29 11:07:13 -070070 // Alloc
Hiroshi Yamauchi3b4c1892013-09-12 21:33:12 -070071 ResetQuickAllocEntryPoints(qpoints);
Ian Rogers7655f292013-07-29 11:07:13 -070072
73 // Cast
Ian Rogers848871b2013-08-05 10:56:33 -070074 qpoints->pInstanceofNonTrivial = artIsAssignableFromCode;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +010075 static_assert(IsDirectEntrypoint(kQuickInstanceofNonTrivial), "Direct C stub not marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -070076 qpoints->pCheckCast = art_quick_check_cast;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +010077 static_assert(!IsDirectEntrypoint(kQuickCheckCast), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -070078
79 // DexCache
Ian Rogers848871b2013-08-05 10:56:33 -070080 qpoints->pInitializeStaticStorage = art_quick_initialize_static_storage;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +010081 static_assert(!IsDirectEntrypoint(kQuickInitializeStaticStorage),
82 "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -070083 qpoints->pInitializeTypeAndVerifyAccess = art_quick_initialize_type_and_verify_access;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +010084 static_assert(!IsDirectEntrypoint(kQuickInitializeTypeAndVerifyAccess),
85 "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -070086 qpoints->pInitializeType = art_quick_initialize_type;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +010087 static_assert(!IsDirectEntrypoint(kQuickInitializeType), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -070088 qpoints->pResolveString = art_quick_resolve_string;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +010089 static_assert(!IsDirectEntrypoint(kQuickResolveString), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -070090
91 // Field
Fred Shih37f05ef2014-07-16 18:38:08 -070092 qpoints->pSet8Instance = art_quick_set8_instance;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +010093 static_assert(!IsDirectEntrypoint(kQuickSet8Instance), "Non-direct C stub marked direct.");
Fred Shih37f05ef2014-07-16 18:38:08 -070094 qpoints->pSet8Static = art_quick_set8_static;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +010095 static_assert(!IsDirectEntrypoint(kQuickSet8Static), "Non-direct C stub marked direct.");
Fred Shih37f05ef2014-07-16 18:38:08 -070096 qpoints->pSet16Instance = art_quick_set16_instance;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +010097 static_assert(!IsDirectEntrypoint(kQuickSet16Instance), "Non-direct C stub marked direct.");
Fred Shih37f05ef2014-07-16 18:38:08 -070098 qpoints->pSet16Static = art_quick_set16_static;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +010099 static_assert(!IsDirectEntrypoint(kQuickSet16Static), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700100 qpoints->pSet32Instance = art_quick_set32_instance;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100101 static_assert(!IsDirectEntrypoint(kQuickSet32Instance), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700102 qpoints->pSet32Static = art_quick_set32_static;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100103 static_assert(!IsDirectEntrypoint(kQuickSet32Static), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700104 qpoints->pSet64Instance = art_quick_set64_instance;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100105 static_assert(!IsDirectEntrypoint(kQuickSet64Instance), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700106 qpoints->pSet64Static = art_quick_set64_static;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100107 static_assert(!IsDirectEntrypoint(kQuickSet64Static), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700108 qpoints->pSetObjInstance = art_quick_set_obj_instance;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100109 static_assert(!IsDirectEntrypoint(kQuickSetObjInstance), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700110 qpoints->pSetObjStatic = art_quick_set_obj_static;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100111 static_assert(!IsDirectEntrypoint(kQuickSetObjStatic), "Non-direct C stub marked direct.");
Fred Shih37f05ef2014-07-16 18:38:08 -0700112 qpoints->pGetBooleanInstance = art_quick_get_boolean_instance;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100113 static_assert(!IsDirectEntrypoint(kQuickGetBooleanInstance), "Non-direct C stub marked direct.");
Fred Shih37f05ef2014-07-16 18:38:08 -0700114 qpoints->pGetByteInstance = art_quick_get_byte_instance;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100115 static_assert(!IsDirectEntrypoint(kQuickGetByteInstance), "Non-direct C stub marked direct.");
Fred Shih37f05ef2014-07-16 18:38:08 -0700116 qpoints->pGetCharInstance = art_quick_get_char_instance;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100117 static_assert(!IsDirectEntrypoint(kQuickGetCharInstance), "Non-direct C stub marked direct.");
Fred Shih37f05ef2014-07-16 18:38:08 -0700118 qpoints->pGetShortInstance = art_quick_get_short_instance;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100119 static_assert(!IsDirectEntrypoint(kQuickGetShortInstance), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700120 qpoints->pGet32Instance = art_quick_get32_instance;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100121 static_assert(!IsDirectEntrypoint(kQuickGet32Instance), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700122 qpoints->pGet64Instance = art_quick_get64_instance;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100123 static_assert(!IsDirectEntrypoint(kQuickGet64Instance), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700124 qpoints->pGetObjInstance = art_quick_get_obj_instance;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100125 static_assert(!IsDirectEntrypoint(kQuickGetObjInstance), "Non-direct C stub marked direct.");
Fred Shih37f05ef2014-07-16 18:38:08 -0700126 qpoints->pGetBooleanStatic = art_quick_get_boolean_static;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100127 static_assert(!IsDirectEntrypoint(kQuickGetBooleanStatic), "Non-direct C stub marked direct.");
Fred Shih37f05ef2014-07-16 18:38:08 -0700128 qpoints->pGetByteStatic = art_quick_get_byte_static;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100129 static_assert(!IsDirectEntrypoint(kQuickGetByteStatic), "Non-direct C stub marked direct.");
Fred Shih37f05ef2014-07-16 18:38:08 -0700130 qpoints->pGetCharStatic = art_quick_get_char_static;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100131 static_assert(!IsDirectEntrypoint(kQuickGetCharStatic), "Non-direct C stub marked direct.");
Fred Shih37f05ef2014-07-16 18:38:08 -0700132 qpoints->pGetShortStatic = art_quick_get_short_static;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100133 static_assert(!IsDirectEntrypoint(kQuickGetShortStatic), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700134 qpoints->pGet32Static = art_quick_get32_static;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100135 static_assert(!IsDirectEntrypoint(kQuickGet32Static), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700136 qpoints->pGet64Static = art_quick_get64_static;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100137 static_assert(!IsDirectEntrypoint(kQuickGet64Static), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700138 qpoints->pGetObjStatic = art_quick_get_obj_static;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100139 static_assert(!IsDirectEntrypoint(kQuickGetObjStatic), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700140
Ian Rogersa9a82542013-10-04 11:17:26 -0700141 // Array
142 qpoints->pAputObjectWithNullAndBoundCheck = art_quick_aput_obj_with_null_and_bound_check;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100143 static_assert(!IsDirectEntrypoint(kQuickAputObjectWithNullAndBoundCheck),
144 "Non-direct C stub marked direct.");
Ian Rogersa9a82542013-10-04 11:17:26 -0700145 qpoints->pAputObjectWithBoundCheck = art_quick_aput_obj_with_bound_check;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100146 static_assert(!IsDirectEntrypoint(kQuickAputObjectWithBoundCheck),
147 "Non-direct C stub marked direct.");
Ian Rogersa9a82542013-10-04 11:17:26 -0700148 qpoints->pAputObject = art_quick_aput_obj;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100149 static_assert(!IsDirectEntrypoint(kQuickAputObject), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700150 qpoints->pHandleFillArrayData = art_quick_handle_fill_data;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100151 static_assert(!IsDirectEntrypoint(kQuickHandleFillArrayData), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700152
153 // JNI
154 qpoints->pJniMethodStart = JniMethodStart;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100155 static_assert(!IsDirectEntrypoint(kQuickJniMethodStart), "Non-direct C stub marked direct.");
Goran Jakovljevic79b6d0c2016-08-18 13:47:31 +0200156 qpoints->pJniMethodFastStart = JniMethodFastStart;
157 static_assert(!IsDirectEntrypoint(kQuickJniMethodFastStart), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700158 qpoints->pJniMethodStartSynchronized = JniMethodStartSynchronized;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100159 static_assert(!IsDirectEntrypoint(kQuickJniMethodStartSynchronized),
160 "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700161 qpoints->pJniMethodEnd = JniMethodEnd;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100162 static_assert(!IsDirectEntrypoint(kQuickJniMethodEnd), "Non-direct C stub marked direct.");
Goran Jakovljevic79b6d0c2016-08-18 13:47:31 +0200163 qpoints->pJniMethodFastEnd = JniMethodFastEnd;
164 static_assert(!IsDirectEntrypoint(kQuickJniMethodFastEnd), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700165 qpoints->pJniMethodEndSynchronized = JniMethodEndSynchronized;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100166 static_assert(!IsDirectEntrypoint(kQuickJniMethodEndSynchronized),
167 "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700168 qpoints->pJniMethodEndWithReference = JniMethodEndWithReference;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100169 static_assert(!IsDirectEntrypoint(kQuickJniMethodEndWithReference),
170 "Non-direct C stub marked direct.");
Goran Jakovljevic79b6d0c2016-08-18 13:47:31 +0200171 qpoints->pJniMethodFastEndWithReference = JniMethodFastEndWithReference;
172 static_assert(!IsDirectEntrypoint(kQuickJniMethodFastEndWithReference),
173 "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700174 qpoints->pJniMethodEndWithReferenceSynchronized = JniMethodEndWithReferenceSynchronized;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100175 static_assert(!IsDirectEntrypoint(kQuickJniMethodEndWithReferenceSynchronized),
176 "Non-direct C stub marked direct.");
Andreas Gampe2da88232014-02-27 12:26:20 -0800177 qpoints->pQuickGenericJniTrampoline = art_quick_generic_jni_trampoline;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100178 static_assert(!IsDirectEntrypoint(kQuickQuickGenericJniTrampoline),
179 "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700180
181 // Locks
Andreas Gampec7ed09b2016-04-25 20:08:55 -0700182 if (UNLIKELY(VLOG_IS_ON(systrace_lock_logging))) {
183 qpoints->pLockObject = art_quick_lock_object_no_inline;
184 qpoints->pUnlockObject = art_quick_unlock_object_no_inline;
185 } else {
186 qpoints->pLockObject = art_quick_lock_object;
187 qpoints->pUnlockObject = art_quick_unlock_object;
188 }
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100189 static_assert(!IsDirectEntrypoint(kQuickLockObject), "Non-direct C stub marked direct.");
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100190 static_assert(!IsDirectEntrypoint(kQuickUnlockObject), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700191
192 // Math
193 qpoints->pCmpgDouble = CmpgDouble;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100194 static_assert(IsDirectEntrypoint(kQuickCmpgDouble), "Direct C stub not marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700195 qpoints->pCmpgFloat = CmpgFloat;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100196 static_assert(IsDirectEntrypoint(kQuickCmpgFloat), "Direct C stub not marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700197 qpoints->pCmplDouble = CmplDouble;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100198 static_assert(IsDirectEntrypoint(kQuickCmplDouble), "Direct C stub not marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700199 qpoints->pCmplFloat = CmplFloat;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100200 static_assert(IsDirectEntrypoint(kQuickCmplFloat), "Direct C stub not marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700201 qpoints->pFmod = fmod;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100202 static_assert(IsDirectEntrypoint(kQuickFmod), "Direct C stub not marked direct.");
Douglas Leungd9cb8ae2014-07-09 14:28:35 -0700203 qpoints->pL2d = art_l2d;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100204 static_assert(IsDirectEntrypoint(kQuickL2d), "Direct C stub not marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700205 qpoints->pFmodf = fmodf;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100206 static_assert(IsDirectEntrypoint(kQuickFmodf), "Direct C stub not marked direct.");
Douglas Leungd9cb8ae2014-07-09 14:28:35 -0700207 qpoints->pL2f = art_l2f;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100208 static_assert(IsDirectEntrypoint(kQuickL2f), "Direct C stub not marked direct.");
Douglas Leungd9cb8ae2014-07-09 14:28:35 -0700209 qpoints->pD2iz = art_d2i;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100210 static_assert(IsDirectEntrypoint(kQuickD2iz), "Direct C stub not marked direct.");
Douglas Leungd9cb8ae2014-07-09 14:28:35 -0700211 qpoints->pF2iz = art_f2i;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100212 static_assert(IsDirectEntrypoint(kQuickF2iz), "Direct C stub not marked direct.");
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700213 qpoints->pIdivmod = nullptr;
Ian Rogers7655f292013-07-29 11:07:13 -0700214 qpoints->pD2l = art_d2l;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100215 static_assert(IsDirectEntrypoint(kQuickD2l), "Direct C stub not marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700216 qpoints->pF2l = art_f2l;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100217 static_assert(IsDirectEntrypoint(kQuickF2l), "Direct C stub not marked direct.");
Ian Rogersa9a82542013-10-04 11:17:26 -0700218 qpoints->pLdiv = artLdiv;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100219 static_assert(IsDirectEntrypoint(kQuickLdiv), "Direct C stub not marked direct.");
Ian Rogersa9a82542013-10-04 11:17:26 -0700220 qpoints->pLmod = artLmod;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100221 static_assert(IsDirectEntrypoint(kQuickLmod), "Direct C stub not marked direct.");
Ian Rogersa9a82542013-10-04 11:17:26 -0700222 qpoints->pLmul = artLmul;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100223 static_assert(IsDirectEntrypoint(kQuickLmul), "Direct C stub not marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700224 qpoints->pShlLong = art_quick_shl_long;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100225 static_assert(!IsDirectEntrypoint(kQuickShlLong), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700226 qpoints->pShrLong = art_quick_shr_long;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100227 static_assert(!IsDirectEntrypoint(kQuickShrLong), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700228 qpoints->pUshrLong = art_quick_ushr_long;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100229 static_assert(!IsDirectEntrypoint(kQuickUshrLong), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700230
Ian Rogers7655f292013-07-29 11:07:13 -0700231 // Intrinsics
232 qpoints->pIndexOf = art_quick_indexof;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100233 static_assert(!IsDirectEntrypoint(kQuickIndexOf), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700234 qpoints->pStringCompareTo = art_quick_string_compareto;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100235 static_assert(!IsDirectEntrypoint(kQuickStringCompareTo), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700236 qpoints->pMemcpy = memcpy;
237
238 // Invocation
Jeff Hao88474b42013-10-23 16:24:40 -0700239 qpoints->pQuickImtConflictTrampoline = art_quick_imt_conflict_trampoline;
Ian Rogers848871b2013-08-05 10:56:33 -0700240 qpoints->pQuickResolutionTrampoline = art_quick_resolution_trampoline;
241 qpoints->pQuickToInterpreterBridge = art_quick_to_interpreter_bridge;
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700242 qpoints->pInvokeDirectTrampolineWithAccessCheck =
243 art_quick_invoke_direct_trampoline_with_access_check;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100244 static_assert(!IsDirectEntrypoint(kQuickInvokeDirectTrampolineWithAccessCheck),
245 "Non-direct C stub marked direct.");
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700246 qpoints->pInvokeInterfaceTrampolineWithAccessCheck =
247 art_quick_invoke_interface_trampoline_with_access_check;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100248 static_assert(!IsDirectEntrypoint(kQuickInvokeInterfaceTrampolineWithAccessCheck),
249 "Non-direct C stub marked direct.");
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700250 qpoints->pInvokeStaticTrampolineWithAccessCheck =
251 art_quick_invoke_static_trampoline_with_access_check;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100252 static_assert(!IsDirectEntrypoint(kQuickInvokeStaticTrampolineWithAccessCheck),
253 "Non-direct C stub marked direct.");
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700254 qpoints->pInvokeSuperTrampolineWithAccessCheck =
255 art_quick_invoke_super_trampoline_with_access_check;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100256 static_assert(!IsDirectEntrypoint(kQuickInvokeSuperTrampolineWithAccessCheck),
257 "Non-direct C stub marked direct.");
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700258 qpoints->pInvokeVirtualTrampolineWithAccessCheck =
259 art_quick_invoke_virtual_trampoline_with_access_check;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100260 static_assert(!IsDirectEntrypoint(kQuickInvokeVirtualTrampolineWithAccessCheck),
261 "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700262
263 // Thread
Ian Rogers848871b2013-08-05 10:56:33 -0700264 qpoints->pTestSuspend = art_quick_test_suspend;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100265 static_assert(!IsDirectEntrypoint(kQuickTestSuspend), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700266
267 // Throws
Ian Rogers848871b2013-08-05 10:56:33 -0700268 qpoints->pDeliverException = art_quick_deliver_exception;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100269 static_assert(!IsDirectEntrypoint(kQuickDeliverException), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700270 qpoints->pThrowArrayBounds = art_quick_throw_array_bounds;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100271 static_assert(!IsDirectEntrypoint(kQuickThrowArrayBounds), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700272 qpoints->pThrowDivZero = art_quick_throw_div_zero;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100273 static_assert(!IsDirectEntrypoint(kQuickThrowDivZero), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700274 qpoints->pThrowNullPointer = art_quick_throw_null_pointer_exception;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100275 static_assert(!IsDirectEntrypoint(kQuickThrowNullPointer), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700276 qpoints->pThrowStackOverflow = art_quick_throw_stack_overflow;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100277 static_assert(!IsDirectEntrypoint(kQuickThrowStackOverflow), "Non-direct C stub marked direct.");
Vladimir Marko87f3fcb2016-04-28 15:52:11 +0100278 qpoints->pThrowStringBounds = art_quick_throw_string_bounds;
279 static_assert(!IsDirectEntrypoint(kQuickThrowStringBounds), "Non-direct C stub marked direct.");
Douglas Leungd9cb8ae2014-07-09 14:28:35 -0700280
Sebastien Hertz07474662015-08-25 15:12:33 +0000281 // Deoptimization from compiled code.
282 qpoints->pDeoptimize = art_quick_deoptimize_from_compiled_code;
Douglas Leung2e8bf552015-07-07 17:27:34 -0700283 static_assert(!IsDirectEntrypoint(kQuickDeoptimize), "Non-direct C stub marked direct.");
284
Douglas Leungd9cb8ae2014-07-09 14:28:35 -0700285 // Atomic 64-bit load/store
286 qpoints->pA64Load = QuasiAtomic::Read64;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100287 static_assert(IsDirectEntrypoint(kQuickA64Load), "Non-direct C stub marked direct.");
Douglas Leungd9cb8ae2014-07-09 14:28:35 -0700288 qpoints->pA64Store = QuasiAtomic::Write64;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100289 static_assert(IsDirectEntrypoint(kQuickA64Store), "Non-direct C stub marked direct.");
Hiroshi Yamauchi1cc71eb2015-05-07 10:47:27 -0700290
Roland Levillain0d5a2812015-11-13 10:07:31 +0000291 // Read barrier.
Hiroshi Yamauchi1cc71eb2015-05-07 10:47:27 -0700292 qpoints->pReadBarrierJni = ReadBarrierJni;
Roland Levillain0e5ff792016-07-06 13:45:52 +0100293 static_assert(IsDirectEntrypoint(kQuickReadBarrierJni), "Direct C stub not marked direct.");
Roland Levillain02b75802016-07-13 11:54:35 +0100294 // Read barriers (and these entry points in particular) are not
295 // supported in the compiler on MIPS32.
296 qpoints->pReadBarrierMarkReg00 = nullptr;
297 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg00),
298 "Non-direct C stub marked direct.");
299 qpoints->pReadBarrierMarkReg01 = nullptr;
300 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg01),
301 "Non-direct C stub marked direct.");
302 qpoints->pReadBarrierMarkReg02 = nullptr;
303 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg02),
304 "Non-direct C stub marked direct.");
305 qpoints->pReadBarrierMarkReg03 = nullptr;
306 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg03),
307 "Non-direct C stub marked direct.");
308 qpoints->pReadBarrierMarkReg04 = nullptr;
309 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg04),
310 "Non-direct C stub marked direct.");
311 qpoints->pReadBarrierMarkReg05 = nullptr;
312 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg05),
313 "Non-direct C stub marked direct.");
314 qpoints->pReadBarrierMarkReg06 = nullptr;
315 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg06),
316 "Non-direct C stub marked direct.");
317 qpoints->pReadBarrierMarkReg07 = nullptr;
318 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg07),
319 "Non-direct C stub marked direct.");
320 qpoints->pReadBarrierMarkReg08 = nullptr;
321 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg08),
322 "Non-direct C stub marked direct.");
323 qpoints->pReadBarrierMarkReg09 = nullptr;
324 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg09),
325 "Non-direct C stub marked direct.");
326 qpoints->pReadBarrierMarkReg10 = nullptr;
327 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg10),
328 "Non-direct C stub marked direct.");
329 qpoints->pReadBarrierMarkReg11 = nullptr;
330 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg11),
331 "Non-direct C stub marked direct.");
332 qpoints->pReadBarrierMarkReg12 = nullptr;
333 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg12),
334 "Non-direct C stub marked direct.");
335 qpoints->pReadBarrierMarkReg13 = nullptr;
336 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg13),
337 "Non-direct C stub marked direct.");
338 qpoints->pReadBarrierMarkReg14 = nullptr;
339 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg14),
340 "Non-direct C stub marked direct.");
341 qpoints->pReadBarrierMarkReg15 = nullptr;
342 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg15),
343 "Non-direct C stub marked direct.");
344 qpoints->pReadBarrierMarkReg16 = nullptr;
345 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg16),
346 "Non-direct C stub marked direct.");
347 qpoints->pReadBarrierMarkReg17 = nullptr;
348 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg17),
349 "Non-direct C stub marked direct.");
350 qpoints->pReadBarrierMarkReg18 = nullptr;
351 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg18),
352 "Non-direct C stub marked direct.");
353 qpoints->pReadBarrierMarkReg19 = nullptr;
354 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg19),
355 "Non-direct C stub marked direct.");
356 qpoints->pReadBarrierMarkReg20 = nullptr;
357 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg20),
358 "Non-direct C stub marked direct.");
359 qpoints->pReadBarrierMarkReg21 = nullptr;
360 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg21),
361 "Non-direct C stub marked direct.");
362 qpoints->pReadBarrierMarkReg22 = nullptr;
363 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg22),
364 "Non-direct C stub marked direct.");
365 qpoints->pReadBarrierMarkReg23 = nullptr;
366 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg23),
367 "Non-direct C stub marked direct.");
368 qpoints->pReadBarrierMarkReg24 = nullptr;
369 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg24),
370 "Non-direct C stub marked direct.");
371 qpoints->pReadBarrierMarkReg25 = nullptr;
372 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg25),
373 "Non-direct C stub marked direct.");
374 qpoints->pReadBarrierMarkReg26 = nullptr;
375 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg26),
376 "Non-direct C stub marked direct.");
377 qpoints->pReadBarrierMarkReg27 = nullptr;
378 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg27),
379 "Non-direct C stub marked direct.");
380 qpoints->pReadBarrierMarkReg28 = nullptr;
381 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg28),
382 "Non-direct C stub marked direct.");
383 qpoints->pReadBarrierMarkReg29 = nullptr;
384 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg29),
385 "Non-direct C stub marked direct.");
Man Cao1aee9002015-07-14 22:31:42 -0700386 qpoints->pReadBarrierSlow = artReadBarrierSlow;
387 static_assert(IsDirectEntrypoint(kQuickReadBarrierSlow), "Direct C stub not marked direct.");
Roland Levillain0d5a2812015-11-13 10:07:31 +0000388 qpoints->pReadBarrierForRootSlow = artReadBarrierForRootSlow;
389 static_assert(IsDirectEntrypoint(kQuickReadBarrierForRootSlow),
390 "Direct C stub not marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700391};
392
393} // namespace art