1 /*
2  * Copyright (C) 2016 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 "quick_entrypoints_enum.h"
18 
19 namespace art {
20 
EntrypointRequiresStackMap(QuickEntrypointEnum trampoline)21 bool EntrypointRequiresStackMap(QuickEntrypointEnum trampoline) {
22   // Entrypoints that do not require a stackmap. In general leaf methods
23   // outside of the VM that are not safepoints.
24   switch (trampoline) {
25     // Listed in the same order as in quick_entrypoints_list.h.
26     case kQuickCmpgDouble:
27     case kQuickCmpgFloat:
28     case kQuickCmplDouble:
29     case kQuickCmplFloat:
30     case kQuickCos:
31     case kQuickSin:
32     case kQuickAcos:
33     case kQuickAsin:
34     case kQuickAtan:
35     case kQuickAtan2:
36     case kQuickCbrt:
37     case kQuickCosh:
38     case kQuickExp:
39     case kQuickExpm1:
40     case kQuickHypot:
41     case kQuickLog:
42     case kQuickLog10:
43     case kQuickNextAfter:
44     case kQuickSinh:
45     case kQuickTan:
46     case kQuickTanh:
47     case kQuickFmod:
48     case kQuickL2d:
49     case kQuickFmodf:
50     case kQuickL2f:
51     case kQuickD2iz:
52     case kQuickF2iz:
53     case kQuickIdivmod:
54     case kQuickD2l:
55     case kQuickF2l:
56     case kQuickLdiv:
57     case kQuickLmod:
58     case kQuickLmul:
59     case kQuickShlLong:
60     case kQuickShrLong:
61     case kQuickUshrLong:
62       return false;
63 
64     // TODO: Remove these entrypoints now that MIPS support was removed.
65     /* Used by mips for 64bit volatile load/stores. */
66     case kQuickA64Load:
67     case kQuickA64Store:
68       return false;
69 
70     default:
71       return true;
72   }
73 }
74 
EntrypointCanTriggerGC(QuickEntrypointEnum entrypoint)75 bool EntrypointCanTriggerGC(QuickEntrypointEnum entrypoint) {
76   switch (entrypoint) {
77     // Listed in the same order as in quick_entrypoints_list.h.
78     case kQuickCmpgDouble:
79     case kQuickCmpgFloat:
80     case kQuickCmplDouble:
81     case kQuickCmplFloat:
82     case kQuickCos:
83     case kQuickSin:
84     case kQuickAcos:
85     case kQuickAsin:
86     case kQuickAtan:
87     case kQuickAtan2:
88     case kQuickCbrt:
89     case kQuickCosh:
90     case kQuickExp:
91     case kQuickExpm1:
92     case kQuickHypot:
93     case kQuickLog:
94     case kQuickLog10:
95     case kQuickNextAfter:
96     case kQuickSinh:
97     case kQuickTan:
98     case kQuickTanh:
99     case kQuickFmod:
100     case kQuickL2d:
101     case kQuickFmodf:
102     case kQuickL2f:
103     case kQuickD2iz:
104     case kQuickF2iz:
105     case kQuickIdivmod:
106     case kQuickD2l:
107     case kQuickF2l:
108     case kQuickLdiv:
109     case kQuickLmod:
110     case kQuickLmul:
111     case kQuickShlLong:
112     case kQuickShrLong:
113     case kQuickUshrLong:
114       return false;
115 
116     // TODO: Remove these entrypoints now that MIPS support was removed.
117     /* Used by mips for 64bit volatile load/stores. */
118     case kQuickA64Load:
119     case kQuickA64Store:
120       return false;
121 
122     default:
123       return true;
124   }
125 }
126 
127 }   // namespace art
128