Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 1 | /* |
| 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 Yang | 98d1cc8 | 2014-05-15 17:02:16 -0700 | [diff] [blame] | 17 | #include "entrypoints/jni/jni_entrypoints.h" |
Mathieu Chartier | d889178 | 2014-03-02 13:28:37 -0800 | [diff] [blame] | 18 | #include "entrypoints/quick/quick_alloc_entrypoints.h" |
Andreas Gampe | e179456 | 2014-11-04 22:26:32 -0800 | [diff] [blame] | 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" |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 21 | #include "entrypoints/quick/quick_entrypoints.h" |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 22 | #include "entrypoints/runtime_asm_entrypoints.h" |
| 23 | #include "interpreter/interpreter.h" |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 24 | |
| 25 | namespace art { |
| 26 | |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 27 | // Cast entrypoints. |
| 28 | extern "C" uint32_t art_quick_is_assignable(const mirror::Class* klass, |
Andreas Gampe | e179456 | 2014-11-04 22:26:32 -0800 | [diff] [blame] | 29 | const mirror::Class* ref_class); |
Hiroshi Yamauchi | 3b4c189 | 2013-09-12 21:33:12 -0700 | [diff] [blame] | 30 | |
Man Cao | 1aee900 | 2015-07-14 22:31:42 -0700 | [diff] [blame] | 31 | // Read barrier entrypoints. |
Roland Levillain | 7c1559a | 2015-12-15 10:55:36 +0000 | [diff] [blame] | 32 | extern "C" mirror::Object* art_quick_read_barrier_mark(mirror::Object*); |
Man Cao | 1aee900 | 2015-07-14 22:31:42 -0700 | [diff] [blame] | 33 | extern "C" mirror::Object* art_quick_read_barrier_slow(mirror::Object*, mirror::Object*, uint32_t); |
Roland Levillain | 0d5a281 | 2015-11-13 10:07:31 +0000 | [diff] [blame] | 34 | extern "C" mirror::Object* art_quick_read_barrier_for_root_slow(GcRoot<mirror::Object>*); |
Man Cao | 1aee900 | 2015-07-14 22:31:42 -0700 | [diff] [blame] | 35 | |
Andreas Gampe | 3cfa4d0 | 2015-10-06 17:04:01 -0700 | [diff] [blame] | 36 | void InitEntryPoints(JniEntryPoints* jpoints, QuickEntryPoints* qpoints) { |
Andreas Gampe | c7ed09b | 2016-04-25 20:08:55 -0700 | [diff] [blame] | 37 | DefaultInitEntryPoints(jpoints, qpoints); |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 38 | |
| 39 | // Cast |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 40 | qpoints->pInstanceofNonTrivial = art_quick_is_assignable; |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 41 | qpoints->pCheckCast = art_quick_check_cast; |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 42 | |
Mark Mendell | a4f1220 | 2015-08-06 15:23:34 -0400 | [diff] [blame] | 43 | // More math. |
| 44 | qpoints->pCos = cos; |
| 45 | qpoints->pSin = sin; |
| 46 | qpoints->pAcos = acos; |
| 47 | qpoints->pAsin = asin; |
| 48 | qpoints->pAtan = atan; |
| 49 | qpoints->pAtan2 = atan2; |
| 50 | qpoints->pCbrt = cbrt; |
| 51 | qpoints->pCosh = cosh; |
| 52 | qpoints->pExp = exp; |
| 53 | qpoints->pExpm1 = expm1; |
| 54 | qpoints->pHypot = hypot; |
| 55 | qpoints->pLog = log; |
| 56 | qpoints->pLog10 = log10; |
| 57 | qpoints->pNextAfter = nextafter; |
| 58 | qpoints->pSinh = sinh; |
| 59 | qpoints->pTan = tan; |
| 60 | qpoints->pTanh = tanh; |
| 61 | |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 62 | // Math |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 63 | qpoints->pD2l = art_quick_d2l; |
| 64 | qpoints->pF2l = art_quick_f2l; |
| 65 | qpoints->pLdiv = art_quick_ldiv; |
Ian Rogers | a9a8254 | 2013-10-04 11:17:26 -0700 | [diff] [blame] | 66 | qpoints->pLmod = art_quick_lmod; |
Ian Rogers | 848871b | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 67 | qpoints->pLmul = art_quick_lmul; |
| 68 | qpoints->pShlLong = art_quick_lshl; |
| 69 | qpoints->pShrLong = art_quick_lshr; |
| 70 | qpoints->pUshrLong = art_quick_lushr; |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 71 | |
| 72 | // Intrinsics |
Mark Mendell | 4028a6c | 2014-02-19 20:06:20 -0800 | [diff] [blame] | 73 | // qpoints->pIndexOf = nullptr; // Not needed on x86 |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 74 | qpoints->pStringCompareTo = art_quick_string_compareto; |
| 75 | qpoints->pMemcpy = art_quick_memcpy; |
| 76 | |
Roland Levillain | 0d5a281 | 2015-11-13 10:07:31 +0000 | [diff] [blame] | 77 | // Read barrier. |
Hiroshi Yamauchi | 1cc71eb | 2015-05-07 10:47:27 -0700 | [diff] [blame] | 78 | qpoints->pReadBarrierJni = ReadBarrierJni; |
Roland Levillain | 7c1559a | 2015-12-15 10:55:36 +0000 | [diff] [blame] | 79 | qpoints->pReadBarrierMark = art_quick_read_barrier_mark; |
Man Cao | 1aee900 | 2015-07-14 22:31:42 -0700 | [diff] [blame] | 80 | qpoints->pReadBarrierSlow = art_quick_read_barrier_slow; |
Roland Levillain | 0d5a281 | 2015-11-13 10:07:31 +0000 | [diff] [blame] | 81 | qpoints->pReadBarrierForRootSlow = art_quick_read_barrier_for_root_slow; |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 82 | }; |
| 83 | |
| 84 | } // namespace art |