blob: 5387e44d9b0d621a3f8e6e53b78fdf9ef4c01c46 [file] [log] [blame]
Serban Constantinescuda8ffec2016-03-09 12:02:11 +00001/*
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
19namespace art {
20
21bool 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
Vladimir Marko41b605c2020-02-12 10:52:22 +000064 // TODO: Remove these entrypoints now that MIPS support was removed.
Serban Constantinescufca16662016-07-14 09:21:59 +010065 /* Used by mips for 64bit volatile load/stores. */
66 case kQuickA64Load:
67 case kQuickA64Store:
68 return false;
69
Serban Constantinescuda8ffec2016-03-09 12:02:11 +000070 default:
71 return true;
72 }
73}
74
Alexandre Rames91a65162016-09-19 13:54:30 +010075bool 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
Vladimir Marko41b605c2020-02-12 10:52:22 +0000116 // TODO: Remove these entrypoints now that MIPS support was removed.
Alexandre Rames91a65162016-09-19 13:54:30 +0100117 /* 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
Serban Constantinescuda8ffec2016-03-09 12:02:11 +0000127} // namespace art