• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
17 #include "entrypoints/jni/jni_entrypoints.h"
18 #include "entrypoints/quick/quick_alloc_entrypoints.h"
19 #include "entrypoints/quick/quick_default_externs.h"
20 #include "entrypoints/quick/quick_default_init_entrypoints.h"
21 #include "entrypoints/quick/quick_entrypoints.h"
22 #include "entrypoints/entrypoint_utils.h"
23 #include "entrypoints/math_entrypoints.h"
24 #include "entrypoints/runtime_asm_entrypoints.h"
25 #include "interpreter/interpreter.h"
26 
27 namespace art {
28 
29 // Cast entrypoints.
30 extern "C" uint32_t artIsAssignableFromCode(const mirror::Class* klass,
31                                             const mirror::Class* ref_class);
32 
InitEntryPoints(JniEntryPoints * jpoints,QuickEntryPoints * qpoints)33 void InitEntryPoints(JniEntryPoints* jpoints, QuickEntryPoints* qpoints) {
34   DefaultInitEntryPoints(jpoints, qpoints);
35 
36   // Cast
37   qpoints->pInstanceofNonTrivial = artIsAssignableFromCode;
38   qpoints->pCheckCast = art_quick_check_cast;
39 
40   // Math
41   // TODO null entrypoints not needed for ARM64 - generate inline.
42   qpoints->pCmpgDouble = nullptr;
43   qpoints->pCmpgFloat = nullptr;
44   qpoints->pCmplDouble = nullptr;
45   qpoints->pCmplFloat = nullptr;
46   qpoints->pFmod = fmod;
47   qpoints->pL2d = nullptr;
48   qpoints->pFmodf = fmodf;
49   qpoints->pL2f = nullptr;
50   qpoints->pD2iz = nullptr;
51   qpoints->pF2iz = nullptr;
52   qpoints->pIdivmod = nullptr;
53   qpoints->pD2l = nullptr;
54   qpoints->pF2l = nullptr;
55   qpoints->pLdiv = nullptr;
56   qpoints->pLmod = nullptr;
57   qpoints->pLmul = nullptr;
58   qpoints->pShlLong = nullptr;
59   qpoints->pShrLong = nullptr;
60   qpoints->pUshrLong = nullptr;
61 
62   // More math.
63   qpoints->pCos = cos;
64   qpoints->pSin = sin;
65   qpoints->pAcos = acos;
66   qpoints->pAsin = asin;
67   qpoints->pAtan = atan;
68   qpoints->pAtan2 = atan2;
69   qpoints->pCbrt = cbrt;
70   qpoints->pCosh = cosh;
71   qpoints->pExp = exp;
72   qpoints->pExpm1 = expm1;
73   qpoints->pHypot = hypot;
74   qpoints->pLog = log;
75   qpoints->pLog10 = log10;
76   qpoints->pNextAfter = nextafter;
77   qpoints->pSinh = sinh;
78   qpoints->pTan = tan;
79   qpoints->pTanh = tanh;
80 
81   // Intrinsics
82   qpoints->pIndexOf = art_quick_indexof;
83   qpoints->pStringCompareTo = art_quick_string_compareto;
84   qpoints->pMemcpy = memcpy;
85 
86   // Read barrier.
87   qpoints->pReadBarrierJni = ReadBarrierJni;
88   qpoints->pReadBarrierMark = artReadBarrierMark;
89   qpoints->pReadBarrierSlow = artReadBarrierSlow;
90   qpoints->pReadBarrierForRootSlow = artReadBarrierForRootSlow;
91 };
92 
93 }  // namespace art
94