blob: 81f152b6fdfe8490608b4ffd478bf302632ab477 [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
Serban Constantinescufca16662016-07-14 09:21:59 +010064 /* Used by mips for 64bit volatile load/stores. */
65 case kQuickA64Load:
66 case kQuickA64Store:
67 return false;
68
Serban Constantinescuda8ffec2016-03-09 12:02:11 +000069 default:
70 return true;
71 }
72}
73
Alexandre Rames91a65162016-09-19 13:54:30 +010074bool EntrypointCanTriggerGC(QuickEntrypointEnum entrypoint) {
75 switch (entrypoint) {
76 // Listed in the same order as in quick_entrypoints_list.h.
77 case kQuickCmpgDouble:
78 case kQuickCmpgFloat:
79 case kQuickCmplDouble:
80 case kQuickCmplFloat:
81 case kQuickCos:
82 case kQuickSin:
83 case kQuickAcos:
84 case kQuickAsin:
85 case kQuickAtan:
86 case kQuickAtan2:
87 case kQuickCbrt:
88 case kQuickCosh:
89 case kQuickExp:
90 case kQuickExpm1:
91 case kQuickHypot:
92 case kQuickLog:
93 case kQuickLog10:
94 case kQuickNextAfter:
95 case kQuickSinh:
96 case kQuickTan:
97 case kQuickTanh:
98 case kQuickFmod:
99 case kQuickL2d:
100 case kQuickFmodf:
101 case kQuickL2f:
102 case kQuickD2iz:
103 case kQuickF2iz:
104 case kQuickIdivmod:
105 case kQuickD2l:
106 case kQuickF2l:
107 case kQuickLdiv:
108 case kQuickLmod:
109 case kQuickLmul:
110 case kQuickShlLong:
111 case kQuickShrLong:
112 case kQuickUshrLong:
113 return false;
114
115 /* Used by mips for 64bit volatile load/stores. */
116 case kQuickA64Load:
117 case kQuickA64Store:
118 return false;
119
120 default:
121 return true;
122 }
123}
124
Serban Constantinescuda8ffec2016-03-09 12:02:11 +0000125} // namespace art