• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
17 #include "entrypoints/jni/jni_entrypoints.h"
18 #include "entrypoints/quick/quick_alloc_entrypoints.h"
19 #include "entrypoints/quick/quick_default_externs.h"
20 #if !defined(__APPLE__)
21 #include "entrypoints/quick/quick_default_init_entrypoints.h"
22 #endif
23 #include "entrypoints/quick/quick_entrypoints.h"
24 #include "entrypoints/math_entrypoints.h"
25 #include "entrypoints/runtime_asm_entrypoints.h"
26 #include "interpreter/interpreter.h"
27 
28 namespace art {
29 
30 // Cast entrypoints.
31 extern "C" uint32_t art_quick_assignable_from_code(const mirror::Class* klass,
32                                                    const mirror::Class* ref_class);
33 
34 // Read barrier entrypoints.
35 extern "C" mirror::Object* art_quick_read_barrier_mark(mirror::Object*);
36 extern "C" mirror::Object* art_quick_read_barrier_slow(mirror::Object*, mirror::Object*, uint32_t);
37 extern "C" mirror::Object* art_quick_read_barrier_for_root_slow(GcRoot<mirror::Object>*);
38 
InitEntryPoints(JniEntryPoints * jpoints,QuickEntryPoints * qpoints)39 void InitEntryPoints(JniEntryPoints* jpoints, QuickEntryPoints* qpoints) {
40 #if defined(__APPLE__)
41   UNUSED(jpoints, qpoints);
42   UNIMPLEMENTED(FATAL);
43 #else
44   DefaultInitEntryPoints(jpoints, qpoints);
45 
46   // Cast
47   qpoints->pInstanceofNonTrivial = art_quick_assignable_from_code;
48   qpoints->pCheckCast = art_quick_check_cast;
49 
50   // More math.
51   qpoints->pCos = cos;
52   qpoints->pSin = sin;
53   qpoints->pAcos = acos;
54   qpoints->pAsin = asin;
55   qpoints->pAtan = atan;
56   qpoints->pAtan2 = atan2;
57   qpoints->pCbrt = cbrt;
58   qpoints->pCosh = cosh;
59   qpoints->pExp = exp;
60   qpoints->pExpm1 = expm1;
61   qpoints->pHypot = hypot;
62   qpoints->pLog = log;
63   qpoints->pLog10 = log10;
64   qpoints->pNextAfter = nextafter;
65   qpoints->pSinh = sinh;
66   qpoints->pTan = tan;
67   qpoints->pTanh = tanh;
68 
69   // Math
70   qpoints->pD2l = art_d2l;
71   qpoints->pF2l = art_f2l;
72   qpoints->pLdiv = art_quick_ldiv;
73   qpoints->pLmod = art_quick_lmod;
74   qpoints->pLmul = art_quick_lmul;
75   qpoints->pShlLong = art_quick_lshl;
76   qpoints->pShrLong = art_quick_lshr;
77   qpoints->pUshrLong = art_quick_lushr;
78 
79   // Intrinsics
80   qpoints->pStringCompareTo = art_quick_string_compareto;
81   qpoints->pMemcpy = art_quick_memcpy;
82 
83   // Read barrier.
84   qpoints->pReadBarrierJni = ReadBarrierJni;
85   qpoints->pReadBarrierMark = art_quick_read_barrier_mark;
86   qpoints->pReadBarrierSlow = art_quick_read_barrier_slow;
87   qpoints->pReadBarrierForRootSlow = art_quick_read_barrier_for_root_slow;
88 #endif  // __APPLE__
89 };
90 
91 }  // namespace art
92