Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 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 Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame] | 17 | #include "entrypoints/jni/jni_entrypoints.h" |
Andreas Gampe | e179456 | 2014-11-04 22:26:32 -0800 | [diff] [blame] | 18 | #include "entrypoints/quick/quick_alloc_entrypoints.h" |
| 19 | #include "entrypoints/quick/quick_default_externs.h" |
Andreas Gampe | c7ed09b | 2016-04-25 20:08:55 -0700 | [diff] [blame] | 20 | #include "entrypoints/quick/quick_default_init_entrypoints.h" |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 21 | #include "entrypoints/quick/quick_entrypoints.h" |
| 22 | #include "entrypoints/entrypoint_utils.h" |
| 23 | #include "entrypoints/math_entrypoints.h" |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 24 | #include "entrypoints/runtime_asm_entrypoints.h" |
| 25 | #include "interpreter/interpreter.h" |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 26 | |
| 27 | namespace art { |
| 28 | |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 29 | // Cast entrypoints. |
Serban Constantinescu | 9bd88b0 | 2015-04-22 16:24:46 +0100 | [diff] [blame] | 30 | extern "C" uint32_t artIsAssignableFromCode(const mirror::Class* klass, |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 31 | const mirror::Class* ref_class); |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 32 | |
Roland Levillain | 02b7580 | 2016-07-13 11:54:35 +0100 | [diff] [blame] | 33 | // Read barrier entrypoints. |
| 34 | // art_quick_read_barrier_mark_regX uses an non-standard calling |
| 35 | // convention: it expects its input in register X and returns its |
Roland Levillain | 4359e61 | 2016-07-20 11:32:19 +0100 | [diff] [blame^] | 36 | // result in that same register, and saves and restores all |
| 37 | // caller-save registers. |
| 38 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg00(mirror::Object*); |
Roland Levillain | 02b7580 | 2016-07-13 11:54:35 +0100 | [diff] [blame] | 39 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg01(mirror::Object*); |
| 40 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg02(mirror::Object*); |
| 41 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg03(mirror::Object*); |
| 42 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg04(mirror::Object*); |
| 43 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg05(mirror::Object*); |
| 44 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg06(mirror::Object*); |
| 45 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg07(mirror::Object*); |
| 46 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg08(mirror::Object*); |
| 47 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg09(mirror::Object*); |
| 48 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg10(mirror::Object*); |
| 49 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg11(mirror::Object*); |
| 50 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg12(mirror::Object*); |
| 51 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg12(mirror::Object*); |
| 52 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg13(mirror::Object*); |
| 53 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg14(mirror::Object*); |
| 54 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg15(mirror::Object*); |
| 55 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg16(mirror::Object*); |
| 56 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg17(mirror::Object*); |
| 57 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg18(mirror::Object*); |
| 58 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg19(mirror::Object*); |
| 59 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg20(mirror::Object*); |
| 60 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg21(mirror::Object*); |
| 61 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg22(mirror::Object*); |
| 62 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg22(mirror::Object*); |
| 63 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg23(mirror::Object*); |
| 64 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg24(mirror::Object*); |
| 65 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg25(mirror::Object*); |
| 66 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg26(mirror::Object*); |
| 67 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg27(mirror::Object*); |
| 68 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg28(mirror::Object*); |
| 69 | extern "C" mirror::Object* art_quick_read_barrier_mark_reg29(mirror::Object*); |
| 70 | |
Andreas Gampe | 3cfa4d0 | 2015-10-06 17:04:01 -0700 | [diff] [blame] | 71 | void InitEntryPoints(JniEntryPoints* jpoints, QuickEntryPoints* qpoints) { |
Andreas Gampe | c7ed09b | 2016-04-25 20:08:55 -0700 | [diff] [blame] | 72 | DefaultInitEntryPoints(jpoints, qpoints); |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 73 | |
| 74 | // Cast |
Serban Constantinescu | 9bd88b0 | 2015-04-22 16:24:46 +0100 | [diff] [blame] | 75 | qpoints->pInstanceofNonTrivial = artIsAssignableFromCode; |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 76 | qpoints->pCheckCast = art_quick_check_cast; |
| 77 | |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 78 | // Math |
Mathieu Chartier | 2cebb24 | 2015-04-21 16:50:40 -0700 | [diff] [blame] | 79 | // TODO null entrypoints not needed for ARM64 - generate inline. |
Zheng Xu | 0210d11 | 2014-06-17 12:25:48 +0800 | [diff] [blame] | 80 | qpoints->pCmpgDouble = nullptr; |
| 81 | qpoints->pCmpgFloat = nullptr; |
| 82 | qpoints->pCmplDouble = nullptr; |
| 83 | qpoints->pCmplFloat = nullptr; |
Serban Constantinescu | 9bd88b0 | 2015-04-22 16:24:46 +0100 | [diff] [blame] | 84 | qpoints->pFmod = fmod; |
Zheng Xu | 0210d11 | 2014-06-17 12:25:48 +0800 | [diff] [blame] | 85 | qpoints->pL2d = nullptr; |
Serban Constantinescu | 9bd88b0 | 2015-04-22 16:24:46 +0100 | [diff] [blame] | 86 | qpoints->pFmodf = fmodf; |
Zheng Xu | 0210d11 | 2014-06-17 12:25:48 +0800 | [diff] [blame] | 87 | qpoints->pL2f = nullptr; |
| 88 | qpoints->pD2iz = nullptr; |
| 89 | qpoints->pF2iz = nullptr; |
| 90 | qpoints->pIdivmod = nullptr; |
| 91 | qpoints->pD2l = nullptr; |
| 92 | qpoints->pF2l = nullptr; |
| 93 | qpoints->pLdiv = nullptr; |
| 94 | qpoints->pLmod = nullptr; |
| 95 | qpoints->pLmul = nullptr; |
| 96 | qpoints->pShlLong = nullptr; |
| 97 | qpoints->pShrLong = nullptr; |
| 98 | qpoints->pUshrLong = nullptr; |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 99 | |
Anton Kirilov | 02fc24e | 2016-01-20 16:48:19 +0000 | [diff] [blame] | 100 | // More math. |
| 101 | qpoints->pCos = cos; |
| 102 | qpoints->pSin = sin; |
| 103 | qpoints->pAcos = acos; |
| 104 | qpoints->pAsin = asin; |
| 105 | qpoints->pAtan = atan; |
| 106 | qpoints->pAtan2 = atan2; |
| 107 | qpoints->pCbrt = cbrt; |
| 108 | qpoints->pCosh = cosh; |
| 109 | qpoints->pExp = exp; |
| 110 | qpoints->pExpm1 = expm1; |
| 111 | qpoints->pHypot = hypot; |
| 112 | qpoints->pLog = log; |
| 113 | qpoints->pLog10 = log10; |
| 114 | qpoints->pNextAfter = nextafter; |
| 115 | qpoints->pSinh = sinh; |
| 116 | qpoints->pTan = tan; |
| 117 | qpoints->pTanh = tanh; |
| 118 | |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 119 | // Intrinsics |
| 120 | qpoints->pIndexOf = art_quick_indexof; |
Scott Wakeling | 1f36f41 | 2016-04-21 11:13:45 +0100 | [diff] [blame] | 121 | // The ARM64 StringCompareTo intrinsic does not call the runtime. |
| 122 | qpoints->pStringCompareTo = nullptr; |
Serban Constantinescu | 9bd88b0 | 2015-04-22 16:24:46 +0100 | [diff] [blame] | 123 | qpoints->pMemcpy = memcpy; |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 124 | |
Roland Levillain | 0d5a281 | 2015-11-13 10:07:31 +0000 | [diff] [blame] | 125 | // Read barrier. |
Hiroshi Yamauchi | 1cc71eb | 2015-05-07 10:47:27 -0700 | [diff] [blame] | 126 | qpoints->pReadBarrierJni = ReadBarrierJni; |
Roland Levillain | 4359e61 | 2016-07-20 11:32:19 +0100 | [diff] [blame^] | 127 | qpoints->pReadBarrierMarkReg00 = art_quick_read_barrier_mark_reg00; |
Roland Levillain | 02b7580 | 2016-07-13 11:54:35 +0100 | [diff] [blame] | 128 | qpoints->pReadBarrierMarkReg01 = art_quick_read_barrier_mark_reg01; |
| 129 | qpoints->pReadBarrierMarkReg02 = art_quick_read_barrier_mark_reg02; |
| 130 | qpoints->pReadBarrierMarkReg03 = art_quick_read_barrier_mark_reg03; |
| 131 | qpoints->pReadBarrierMarkReg04 = art_quick_read_barrier_mark_reg04; |
| 132 | qpoints->pReadBarrierMarkReg05 = art_quick_read_barrier_mark_reg05; |
| 133 | qpoints->pReadBarrierMarkReg06 = art_quick_read_barrier_mark_reg06; |
| 134 | qpoints->pReadBarrierMarkReg07 = art_quick_read_barrier_mark_reg07; |
| 135 | qpoints->pReadBarrierMarkReg08 = art_quick_read_barrier_mark_reg08; |
| 136 | qpoints->pReadBarrierMarkReg09 = art_quick_read_barrier_mark_reg09; |
| 137 | qpoints->pReadBarrierMarkReg10 = art_quick_read_barrier_mark_reg10; |
| 138 | qpoints->pReadBarrierMarkReg11 = art_quick_read_barrier_mark_reg11; |
| 139 | qpoints->pReadBarrierMarkReg12 = art_quick_read_barrier_mark_reg12; |
| 140 | qpoints->pReadBarrierMarkReg13 = art_quick_read_barrier_mark_reg13; |
| 141 | qpoints->pReadBarrierMarkReg14 = art_quick_read_barrier_mark_reg14; |
| 142 | qpoints->pReadBarrierMarkReg15 = art_quick_read_barrier_mark_reg15; |
| 143 | qpoints->pReadBarrierMarkReg16 = art_quick_read_barrier_mark_reg16; |
| 144 | qpoints->pReadBarrierMarkReg17 = art_quick_read_barrier_mark_reg17; |
| 145 | qpoints->pReadBarrierMarkReg18 = art_quick_read_barrier_mark_reg18; |
| 146 | qpoints->pReadBarrierMarkReg19 = art_quick_read_barrier_mark_reg19; |
| 147 | qpoints->pReadBarrierMarkReg20 = art_quick_read_barrier_mark_reg20; |
| 148 | qpoints->pReadBarrierMarkReg21 = art_quick_read_barrier_mark_reg21; |
| 149 | qpoints->pReadBarrierMarkReg22 = art_quick_read_barrier_mark_reg22; |
| 150 | qpoints->pReadBarrierMarkReg23 = art_quick_read_barrier_mark_reg23; |
| 151 | qpoints->pReadBarrierMarkReg24 = art_quick_read_barrier_mark_reg24; |
| 152 | qpoints->pReadBarrierMarkReg25 = art_quick_read_barrier_mark_reg25; |
| 153 | qpoints->pReadBarrierMarkReg26 = art_quick_read_barrier_mark_reg26; |
| 154 | qpoints->pReadBarrierMarkReg27 = art_quick_read_barrier_mark_reg27; |
| 155 | qpoints->pReadBarrierMarkReg28 = art_quick_read_barrier_mark_reg28; |
| 156 | qpoints->pReadBarrierMarkReg29 = art_quick_read_barrier_mark_reg29; |
| 157 | qpoints->pReadBarrierMarkReg30 = nullptr; // Cannot use register 30 (LR) to pass arguments. |
| 158 | qpoints->pReadBarrierMarkReg31 = nullptr; // Cannot use register 31 (SP/XZR) to pass arguments. |
Man Cao | 1aee900 | 2015-07-14 22:31:42 -0700 | [diff] [blame] | 159 | qpoints->pReadBarrierSlow = artReadBarrierSlow; |
Roland Levillain | 0d5a281 | 2015-11-13 10:07:31 +0000 | [diff] [blame] | 160 | qpoints->pReadBarrierForRootSlow = artReadBarrierForRootSlow; |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 161 | }; |
| 162 | |
| 163 | } // namespace art |