blob: 36f9ea78e1adaba586e37d59c62c2ec199a8c967 [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.
Mathieu Chartier9fd8c602016-11-14 14:38:53 -080033extern "C" size_t artInstanceOfFromCode(mirror::Object* obj, mirror::Class* ref_class);
Ian Rogers7655f292013-07-29 11:07:13 -070034
35// Math entrypoints.
36extern int32_t CmpgDouble(double a, double b);
37extern int32_t CmplDouble(double a, double b);
38extern int32_t CmpgFloat(float a, float b);
39extern int32_t CmplFloat(float a, float b);
Ian Rogersa9a82542013-10-04 11:17:26 -070040extern "C" int64_t artLmul(int64_t a, int64_t b);
41extern "C" int64_t artLdiv(int64_t a, int64_t b);
42extern "C" int64_t artLmod(int64_t a, int64_t b);
Ian Rogers7655f292013-07-29 11:07:13 -070043
44// Math conversions.
45extern "C" int32_t __fixsfsi(float op1); // FLOAT_TO_INT
46extern "C" int32_t __fixdfsi(double op1); // DOUBLE_TO_INT
47extern "C" float __floatdisf(int64_t op1); // LONG_TO_FLOAT
48extern "C" double __floatdidf(int64_t op1); // LONG_TO_DOUBLE
49extern "C" int64_t __fixsfdi(float op1); // FLOAT_TO_LONG
50extern "C" int64_t __fixdfdi(double op1); // DOUBLE_TO_LONG
51
52// Single-precision FP arithmetics.
53extern "C" float fmodf(float a, float b); // REM_FLOAT[_2ADDR]
54
55// Double-precision FP arithmetics.
56extern "C" double fmod(double a, double b); // REM_DOUBLE[_2ADDR]
57
58// Long long arithmetics - REM_LONG[_2ADDR] and DIV_LONG[_2ADDR]
59extern "C" int64_t __divdi3(int64_t, int64_t);
60extern "C" int64_t __moddi3(int64_t, int64_t);
Hiroshi Yamauchi3b4c1892013-09-12 21:33:12 -070061
Mathieu Chartierfe814e82016-11-09 14:32:49 -080062// No read barrier entrypoints for marking registers.
Mathieu Chartiercff69052016-11-10 17:52:42 -080063void UpdateReadBarrierEntrypoints(QuickEntryPoints* qpoints ATTRIBUTE_UNUSED,
64 bool is_marking ATTRIBUTE_UNUSED) {}
Mathieu Chartierfe814e82016-11-09 14:32:49 -080065
Andreas Gampe3cfa4d02015-10-06 17:04:01 -070066void InitEntryPoints(JniEntryPoints* jpoints, QuickEntryPoints* qpoints) {
Andreas Gampec7ed09b2016-04-25 20:08:55 -070067 // Note: MIPS has asserts checking for the type of entrypoint. Don't move it
68 // to InitDefaultEntryPoints().
69
Ian Rogers848871b2013-08-05 10:56:33 -070070 // JNI
71 jpoints->pDlsymLookup = art_jni_dlsym_lookup_stub;
72
Ian Rogers7655f292013-07-29 11:07:13 -070073 // Alloc
Mathieu Chartier5ace2012016-11-30 10:15:41 -080074 ResetQuickAllocEntryPoints(qpoints, /*is_marking*/ false);
Ian Rogers7655f292013-07-29 11:07:13 -070075
76 // Cast
Mathieu Chartier9fd8c602016-11-14 14:38:53 -080077 qpoints->pInstanceofNonTrivial = artInstanceOfFromCode;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +010078 static_assert(IsDirectEntrypoint(kQuickInstanceofNonTrivial), "Direct C stub not marked direct.");
Mathieu Chartierb99f4d62016-11-07 16:17:26 -080079 qpoints->pCheckInstanceOf = art_quick_check_instance_of;
80 static_assert(!IsDirectEntrypoint(kQuickCheckInstanceOf), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -070081
82 // DexCache
Ian Rogers848871b2013-08-05 10:56:33 -070083 qpoints->pInitializeStaticStorage = art_quick_initialize_static_storage;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +010084 static_assert(!IsDirectEntrypoint(kQuickInitializeStaticStorage),
85 "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -070086 qpoints->pInitializeTypeAndVerifyAccess = art_quick_initialize_type_and_verify_access;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +010087 static_assert(!IsDirectEntrypoint(kQuickInitializeTypeAndVerifyAccess),
88 "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -070089 qpoints->pInitializeType = art_quick_initialize_type;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +010090 static_assert(!IsDirectEntrypoint(kQuickInitializeType), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -070091 qpoints->pResolveString = art_quick_resolve_string;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +010092 static_assert(!IsDirectEntrypoint(kQuickResolveString), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -070093
94 // Field
Fred Shih37f05ef2014-07-16 18:38:08 -070095 qpoints->pSet8Instance = art_quick_set8_instance;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +010096 static_assert(!IsDirectEntrypoint(kQuickSet8Instance), "Non-direct C stub marked direct.");
Fred Shih37f05ef2014-07-16 18:38:08 -070097 qpoints->pSet8Static = art_quick_set8_static;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +010098 static_assert(!IsDirectEntrypoint(kQuickSet8Static), "Non-direct C stub marked direct.");
Fred Shih37f05ef2014-07-16 18:38:08 -070099 qpoints->pSet16Instance = art_quick_set16_instance;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100100 static_assert(!IsDirectEntrypoint(kQuickSet16Instance), "Non-direct C stub marked direct.");
Fred Shih37f05ef2014-07-16 18:38:08 -0700101 qpoints->pSet16Static = art_quick_set16_static;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100102 static_assert(!IsDirectEntrypoint(kQuickSet16Static), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700103 qpoints->pSet32Instance = art_quick_set32_instance;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100104 static_assert(!IsDirectEntrypoint(kQuickSet32Instance), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700105 qpoints->pSet32Static = art_quick_set32_static;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100106 static_assert(!IsDirectEntrypoint(kQuickSet32Static), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700107 qpoints->pSet64Instance = art_quick_set64_instance;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100108 static_assert(!IsDirectEntrypoint(kQuickSet64Instance), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700109 qpoints->pSet64Static = art_quick_set64_static;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100110 static_assert(!IsDirectEntrypoint(kQuickSet64Static), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700111 qpoints->pSetObjInstance = art_quick_set_obj_instance;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100112 static_assert(!IsDirectEntrypoint(kQuickSetObjInstance), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700113 qpoints->pSetObjStatic = art_quick_set_obj_static;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100114 static_assert(!IsDirectEntrypoint(kQuickSetObjStatic), "Non-direct C stub marked direct.");
Fred Shih37f05ef2014-07-16 18:38:08 -0700115 qpoints->pGetBooleanInstance = art_quick_get_boolean_instance;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100116 static_assert(!IsDirectEntrypoint(kQuickGetBooleanInstance), "Non-direct C stub marked direct.");
Fred Shih37f05ef2014-07-16 18:38:08 -0700117 qpoints->pGetByteInstance = art_quick_get_byte_instance;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100118 static_assert(!IsDirectEntrypoint(kQuickGetByteInstance), "Non-direct C stub marked direct.");
Fred Shih37f05ef2014-07-16 18:38:08 -0700119 qpoints->pGetCharInstance = art_quick_get_char_instance;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100120 static_assert(!IsDirectEntrypoint(kQuickGetCharInstance), "Non-direct C stub marked direct.");
Fred Shih37f05ef2014-07-16 18:38:08 -0700121 qpoints->pGetShortInstance = art_quick_get_short_instance;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100122 static_assert(!IsDirectEntrypoint(kQuickGetShortInstance), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700123 qpoints->pGet32Instance = art_quick_get32_instance;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100124 static_assert(!IsDirectEntrypoint(kQuickGet32Instance), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700125 qpoints->pGet64Instance = art_quick_get64_instance;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100126 static_assert(!IsDirectEntrypoint(kQuickGet64Instance), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700127 qpoints->pGetObjInstance = art_quick_get_obj_instance;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100128 static_assert(!IsDirectEntrypoint(kQuickGetObjInstance), "Non-direct C stub marked direct.");
Fred Shih37f05ef2014-07-16 18:38:08 -0700129 qpoints->pGetBooleanStatic = art_quick_get_boolean_static;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100130 static_assert(!IsDirectEntrypoint(kQuickGetBooleanStatic), "Non-direct C stub marked direct.");
Fred Shih37f05ef2014-07-16 18:38:08 -0700131 qpoints->pGetByteStatic = art_quick_get_byte_static;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100132 static_assert(!IsDirectEntrypoint(kQuickGetByteStatic), "Non-direct C stub marked direct.");
Fred Shih37f05ef2014-07-16 18:38:08 -0700133 qpoints->pGetCharStatic = art_quick_get_char_static;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100134 static_assert(!IsDirectEntrypoint(kQuickGetCharStatic), "Non-direct C stub marked direct.");
Fred Shih37f05ef2014-07-16 18:38:08 -0700135 qpoints->pGetShortStatic = art_quick_get_short_static;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100136 static_assert(!IsDirectEntrypoint(kQuickGetShortStatic), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700137 qpoints->pGet32Static = art_quick_get32_static;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100138 static_assert(!IsDirectEntrypoint(kQuickGet32Static), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700139 qpoints->pGet64Static = art_quick_get64_static;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100140 static_assert(!IsDirectEntrypoint(kQuickGet64Static), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700141 qpoints->pGetObjStatic = art_quick_get_obj_static;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100142 static_assert(!IsDirectEntrypoint(kQuickGetObjStatic), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700143
Ian Rogersa9a82542013-10-04 11:17:26 -0700144 // Array
Ian Rogersa9a82542013-10-04 11:17:26 -0700145 qpoints->pAputObject = art_quick_aput_obj;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100146 static_assert(!IsDirectEntrypoint(kQuickAputObject), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700147
148 // JNI
149 qpoints->pJniMethodStart = JniMethodStart;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100150 static_assert(!IsDirectEntrypoint(kQuickJniMethodStart), "Non-direct C stub marked direct.");
Goran Jakovljevic79b6d0c2016-08-18 13:47:31 +0200151 qpoints->pJniMethodFastStart = JniMethodFastStart;
152 static_assert(!IsDirectEntrypoint(kQuickJniMethodFastStart), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700153 qpoints->pJniMethodStartSynchronized = JniMethodStartSynchronized;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100154 static_assert(!IsDirectEntrypoint(kQuickJniMethodStartSynchronized),
155 "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700156 qpoints->pJniMethodEnd = JniMethodEnd;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100157 static_assert(!IsDirectEntrypoint(kQuickJniMethodEnd), "Non-direct C stub marked direct.");
Goran Jakovljevic79b6d0c2016-08-18 13:47:31 +0200158 qpoints->pJniMethodFastEnd = JniMethodFastEnd;
159 static_assert(!IsDirectEntrypoint(kQuickJniMethodFastEnd), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700160 qpoints->pJniMethodEndSynchronized = JniMethodEndSynchronized;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100161 static_assert(!IsDirectEntrypoint(kQuickJniMethodEndSynchronized),
162 "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700163 qpoints->pJniMethodEndWithReference = JniMethodEndWithReference;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100164 static_assert(!IsDirectEntrypoint(kQuickJniMethodEndWithReference),
165 "Non-direct C stub marked direct.");
Goran Jakovljevic79b6d0c2016-08-18 13:47:31 +0200166 qpoints->pJniMethodFastEndWithReference = JniMethodFastEndWithReference;
167 static_assert(!IsDirectEntrypoint(kQuickJniMethodFastEndWithReference),
168 "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700169 qpoints->pJniMethodEndWithReferenceSynchronized = JniMethodEndWithReferenceSynchronized;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100170 static_assert(!IsDirectEntrypoint(kQuickJniMethodEndWithReferenceSynchronized),
171 "Non-direct C stub marked direct.");
Andreas Gampe2da88232014-02-27 12:26:20 -0800172 qpoints->pQuickGenericJniTrampoline = art_quick_generic_jni_trampoline;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100173 static_assert(!IsDirectEntrypoint(kQuickQuickGenericJniTrampoline),
174 "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700175
176 // Locks
Andreas Gampec7ed09b2016-04-25 20:08:55 -0700177 if (UNLIKELY(VLOG_IS_ON(systrace_lock_logging))) {
178 qpoints->pLockObject = art_quick_lock_object_no_inline;
179 qpoints->pUnlockObject = art_quick_unlock_object_no_inline;
180 } else {
181 qpoints->pLockObject = art_quick_lock_object;
182 qpoints->pUnlockObject = art_quick_unlock_object;
183 }
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100184 static_assert(!IsDirectEntrypoint(kQuickLockObject), "Non-direct C stub marked direct.");
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100185 static_assert(!IsDirectEntrypoint(kQuickUnlockObject), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700186
187 // Math
188 qpoints->pCmpgDouble = CmpgDouble;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100189 static_assert(IsDirectEntrypoint(kQuickCmpgDouble), "Direct C stub not marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700190 qpoints->pCmpgFloat = CmpgFloat;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100191 static_assert(IsDirectEntrypoint(kQuickCmpgFloat), "Direct C stub not marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700192 qpoints->pCmplDouble = CmplDouble;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100193 static_assert(IsDirectEntrypoint(kQuickCmplDouble), "Direct C stub not marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700194 qpoints->pCmplFloat = CmplFloat;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100195 static_assert(IsDirectEntrypoint(kQuickCmplFloat), "Direct C stub not marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700196 qpoints->pFmod = fmod;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100197 static_assert(IsDirectEntrypoint(kQuickFmod), "Direct C stub not marked direct.");
Douglas Leungd9cb8ae2014-07-09 14:28:35 -0700198 qpoints->pL2d = art_l2d;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100199 static_assert(IsDirectEntrypoint(kQuickL2d), "Direct C stub not marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700200 qpoints->pFmodf = fmodf;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100201 static_assert(IsDirectEntrypoint(kQuickFmodf), "Direct C stub not marked direct.");
Douglas Leungd9cb8ae2014-07-09 14:28:35 -0700202 qpoints->pL2f = art_l2f;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100203 static_assert(IsDirectEntrypoint(kQuickL2f), "Direct C stub not marked direct.");
Douglas Leungd9cb8ae2014-07-09 14:28:35 -0700204 qpoints->pD2iz = art_d2i;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100205 static_assert(IsDirectEntrypoint(kQuickD2iz), "Direct C stub not marked direct.");
Douglas Leungd9cb8ae2014-07-09 14:28:35 -0700206 qpoints->pF2iz = art_f2i;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100207 static_assert(IsDirectEntrypoint(kQuickF2iz), "Direct C stub not marked direct.");
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700208 qpoints->pIdivmod = nullptr;
Ian Rogers7655f292013-07-29 11:07:13 -0700209 qpoints->pD2l = art_d2l;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100210 static_assert(IsDirectEntrypoint(kQuickD2l), "Direct C stub not marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700211 qpoints->pF2l = art_f2l;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100212 static_assert(IsDirectEntrypoint(kQuickF2l), "Direct C stub not marked direct.");
Ian Rogersa9a82542013-10-04 11:17:26 -0700213 qpoints->pLdiv = artLdiv;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100214 static_assert(IsDirectEntrypoint(kQuickLdiv), "Direct C stub not marked direct.");
Ian Rogersa9a82542013-10-04 11:17:26 -0700215 qpoints->pLmod = artLmod;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100216 static_assert(IsDirectEntrypoint(kQuickLmod), "Direct C stub not marked direct.");
Ian Rogersa9a82542013-10-04 11:17:26 -0700217 qpoints->pLmul = artLmul;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100218 static_assert(IsDirectEntrypoint(kQuickLmul), "Direct C stub not marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700219 qpoints->pShlLong = art_quick_shl_long;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100220 static_assert(!IsDirectEntrypoint(kQuickShlLong), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700221 qpoints->pShrLong = art_quick_shr_long;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100222 static_assert(!IsDirectEntrypoint(kQuickShrLong), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700223 qpoints->pUshrLong = art_quick_ushr_long;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100224 static_assert(!IsDirectEntrypoint(kQuickUshrLong), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700225
Ian Rogers7655f292013-07-29 11:07:13 -0700226 // Intrinsics
227 qpoints->pIndexOf = art_quick_indexof;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100228 static_assert(!IsDirectEntrypoint(kQuickIndexOf), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700229 qpoints->pStringCompareTo = art_quick_string_compareto;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100230 static_assert(!IsDirectEntrypoint(kQuickStringCompareTo), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700231 qpoints->pMemcpy = memcpy;
232
233 // Invocation
Jeff Hao88474b42013-10-23 16:24:40 -0700234 qpoints->pQuickImtConflictTrampoline = art_quick_imt_conflict_trampoline;
Ian Rogers848871b2013-08-05 10:56:33 -0700235 qpoints->pQuickResolutionTrampoline = art_quick_resolution_trampoline;
236 qpoints->pQuickToInterpreterBridge = art_quick_to_interpreter_bridge;
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700237 qpoints->pInvokeDirectTrampolineWithAccessCheck =
238 art_quick_invoke_direct_trampoline_with_access_check;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100239 static_assert(!IsDirectEntrypoint(kQuickInvokeDirectTrampolineWithAccessCheck),
240 "Non-direct C stub marked direct.");
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700241 qpoints->pInvokeInterfaceTrampolineWithAccessCheck =
242 art_quick_invoke_interface_trampoline_with_access_check;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100243 static_assert(!IsDirectEntrypoint(kQuickInvokeInterfaceTrampolineWithAccessCheck),
244 "Non-direct C stub marked direct.");
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700245 qpoints->pInvokeStaticTrampolineWithAccessCheck =
246 art_quick_invoke_static_trampoline_with_access_check;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100247 static_assert(!IsDirectEntrypoint(kQuickInvokeStaticTrampolineWithAccessCheck),
248 "Non-direct C stub marked direct.");
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700249 qpoints->pInvokeSuperTrampolineWithAccessCheck =
250 art_quick_invoke_super_trampoline_with_access_check;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100251 static_assert(!IsDirectEntrypoint(kQuickInvokeSuperTrampolineWithAccessCheck),
252 "Non-direct C stub marked direct.");
Mathieu Chartier2cebb242015-04-21 16:50:40 -0700253 qpoints->pInvokeVirtualTrampolineWithAccessCheck =
254 art_quick_invoke_virtual_trampoline_with_access_check;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100255 static_assert(!IsDirectEntrypoint(kQuickInvokeVirtualTrampolineWithAccessCheck),
256 "Non-direct C stub marked direct.");
Alexey Frunzec480b982017-01-16 19:03:21 -0800257 qpoints->pInvokePolymorphic = art_quick_invoke_polymorphic;
Ian Rogers7655f292013-07-29 11:07:13 -0700258
259 // Thread
Ian Rogers848871b2013-08-05 10:56:33 -0700260 qpoints->pTestSuspend = art_quick_test_suspend;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100261 static_assert(!IsDirectEntrypoint(kQuickTestSuspend), "Non-direct C stub marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700262
263 // Throws
Ian Rogers848871b2013-08-05 10:56:33 -0700264 qpoints->pDeliverException = art_quick_deliver_exception;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100265 static_assert(!IsDirectEntrypoint(kQuickDeliverException), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700266 qpoints->pThrowArrayBounds = art_quick_throw_array_bounds;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100267 static_assert(!IsDirectEntrypoint(kQuickThrowArrayBounds), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700268 qpoints->pThrowDivZero = art_quick_throw_div_zero;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100269 static_assert(!IsDirectEntrypoint(kQuickThrowDivZero), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700270 qpoints->pThrowNullPointer = art_quick_throw_null_pointer_exception;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100271 static_assert(!IsDirectEntrypoint(kQuickThrowNullPointer), "Non-direct C stub marked direct.");
Ian Rogers848871b2013-08-05 10:56:33 -0700272 qpoints->pThrowStackOverflow = art_quick_throw_stack_overflow;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100273 static_assert(!IsDirectEntrypoint(kQuickThrowStackOverflow), "Non-direct C stub marked direct.");
Vladimir Marko87f3fcb2016-04-28 15:52:11 +0100274 qpoints->pThrowStringBounds = art_quick_throw_string_bounds;
275 static_assert(!IsDirectEntrypoint(kQuickThrowStringBounds), "Non-direct C stub marked direct.");
Douglas Leungd9cb8ae2014-07-09 14:28:35 -0700276
Sebastien Hertz07474662015-08-25 15:12:33 +0000277 // Deoptimization from compiled code.
278 qpoints->pDeoptimize = art_quick_deoptimize_from_compiled_code;
Douglas Leung2e8bf552015-07-07 17:27:34 -0700279 static_assert(!IsDirectEntrypoint(kQuickDeoptimize), "Non-direct C stub marked direct.");
280
Douglas Leungd9cb8ae2014-07-09 14:28:35 -0700281 // Atomic 64-bit load/store
282 qpoints->pA64Load = QuasiAtomic::Read64;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100283 static_assert(IsDirectEntrypoint(kQuickA64Load), "Non-direct C stub marked direct.");
Douglas Leungd9cb8ae2014-07-09 14:28:35 -0700284 qpoints->pA64Store = QuasiAtomic::Write64;
Nikola Veljkovic2d873b62015-02-20 17:21:15 +0100285 static_assert(IsDirectEntrypoint(kQuickA64Store), "Non-direct C stub marked direct.");
Hiroshi Yamauchi1cc71eb2015-05-07 10:47:27 -0700286
Roland Levillain0d5a2812015-11-13 10:07:31 +0000287 // Read barrier.
Hiroshi Yamauchi1cc71eb2015-05-07 10:47:27 -0700288 qpoints->pReadBarrierJni = ReadBarrierJni;
Roland Levillain0e5ff792016-07-06 13:45:52 +0100289 static_assert(IsDirectEntrypoint(kQuickReadBarrierJni), "Direct C stub not marked direct.");
Roland Levillain02b75802016-07-13 11:54:35 +0100290 // Read barriers (and these entry points in particular) are not
291 // supported in the compiler on MIPS32.
292 qpoints->pReadBarrierMarkReg00 = nullptr;
293 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg00),
294 "Non-direct C stub marked direct.");
295 qpoints->pReadBarrierMarkReg01 = nullptr;
296 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg01),
297 "Non-direct C stub marked direct.");
298 qpoints->pReadBarrierMarkReg02 = nullptr;
299 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg02),
300 "Non-direct C stub marked direct.");
301 qpoints->pReadBarrierMarkReg03 = nullptr;
302 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg03),
303 "Non-direct C stub marked direct.");
304 qpoints->pReadBarrierMarkReg04 = nullptr;
305 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg04),
306 "Non-direct C stub marked direct.");
307 qpoints->pReadBarrierMarkReg05 = nullptr;
308 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg05),
309 "Non-direct C stub marked direct.");
310 qpoints->pReadBarrierMarkReg06 = nullptr;
311 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg06),
312 "Non-direct C stub marked direct.");
313 qpoints->pReadBarrierMarkReg07 = nullptr;
314 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg07),
315 "Non-direct C stub marked direct.");
316 qpoints->pReadBarrierMarkReg08 = nullptr;
317 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg08),
318 "Non-direct C stub marked direct.");
319 qpoints->pReadBarrierMarkReg09 = nullptr;
320 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg09),
321 "Non-direct C stub marked direct.");
322 qpoints->pReadBarrierMarkReg10 = nullptr;
323 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg10),
324 "Non-direct C stub marked direct.");
325 qpoints->pReadBarrierMarkReg11 = nullptr;
326 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg11),
327 "Non-direct C stub marked direct.");
328 qpoints->pReadBarrierMarkReg12 = nullptr;
329 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg12),
330 "Non-direct C stub marked direct.");
331 qpoints->pReadBarrierMarkReg13 = nullptr;
332 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg13),
333 "Non-direct C stub marked direct.");
334 qpoints->pReadBarrierMarkReg14 = nullptr;
335 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg14),
336 "Non-direct C stub marked direct.");
337 qpoints->pReadBarrierMarkReg15 = nullptr;
338 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg15),
339 "Non-direct C stub marked direct.");
340 qpoints->pReadBarrierMarkReg16 = nullptr;
341 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg16),
342 "Non-direct C stub marked direct.");
343 qpoints->pReadBarrierMarkReg17 = nullptr;
344 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg17),
345 "Non-direct C stub marked direct.");
346 qpoints->pReadBarrierMarkReg18 = nullptr;
347 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg18),
348 "Non-direct C stub marked direct.");
349 qpoints->pReadBarrierMarkReg19 = nullptr;
350 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg19),
351 "Non-direct C stub marked direct.");
352 qpoints->pReadBarrierMarkReg20 = nullptr;
353 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg20),
354 "Non-direct C stub marked direct.");
355 qpoints->pReadBarrierMarkReg21 = nullptr;
356 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg21),
357 "Non-direct C stub marked direct.");
358 qpoints->pReadBarrierMarkReg22 = nullptr;
359 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg22),
360 "Non-direct C stub marked direct.");
361 qpoints->pReadBarrierMarkReg23 = nullptr;
362 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg23),
363 "Non-direct C stub marked direct.");
364 qpoints->pReadBarrierMarkReg24 = nullptr;
365 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg24),
366 "Non-direct C stub marked direct.");
367 qpoints->pReadBarrierMarkReg25 = nullptr;
368 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg25),
369 "Non-direct C stub marked direct.");
370 qpoints->pReadBarrierMarkReg26 = nullptr;
371 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg26),
372 "Non-direct C stub marked direct.");
373 qpoints->pReadBarrierMarkReg27 = nullptr;
374 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg27),
375 "Non-direct C stub marked direct.");
376 qpoints->pReadBarrierMarkReg28 = nullptr;
377 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg28),
378 "Non-direct C stub marked direct.");
379 qpoints->pReadBarrierMarkReg29 = nullptr;
380 static_assert(!IsDirectEntrypoint(kQuickReadBarrierMarkReg29),
381 "Non-direct C stub marked direct.");
Man Cao1aee9002015-07-14 22:31:42 -0700382 qpoints->pReadBarrierSlow = artReadBarrierSlow;
383 static_assert(IsDirectEntrypoint(kQuickReadBarrierSlow), "Direct C stub not marked direct.");
Roland Levillain0d5a2812015-11-13 10:07:31 +0000384 qpoints->pReadBarrierForRootSlow = artReadBarrierForRootSlow;
385 static_assert(IsDirectEntrypoint(kQuickReadBarrierForRootSlow),
386 "Direct C stub not marked direct.");
Ian Rogers7655f292013-07-29 11:07:13 -0700387};
388
389} // namespace art