Bug 1885489 - Part 5: Add SnapshotIterator::readInt32(). r=iain
[gecko.git] / js / src / jit / InlinableNatives.h
blob16b438fd701f88cb7ac39ea57c288b33f9a45736
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: set ts=8 sts=2 et sw=2 tw=80:
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef jit_InlinableNatives_h
8 #define jit_InlinableNatives_h
10 #include <stdint.h> // For uint16_t
12 #ifdef FUZZING_JS_FUZZILLI
13 # define INLINABLE_NATIVE_FUZZILLI_LIST(_) _(FuzzilliHash)
14 #else
15 # define INLINABLE_NATIVE_FUZZILLI_LIST(_)
16 #endif
18 #define INLINABLE_NATIVE_LIST(_) \
19 _(Array) \
20 _(ArrayIsArray) \
21 _(ArrayJoin) \
22 _(ArrayPop) \
23 _(ArrayShift) \
24 _(ArrayPush) \
25 _(ArraySlice) \
27 _(AtomicsCompareExchange) \
28 _(AtomicsExchange) \
29 _(AtomicsLoad) \
30 _(AtomicsStore) \
31 _(AtomicsAdd) \
32 _(AtomicsSub) \
33 _(AtomicsAnd) \
34 _(AtomicsOr) \
35 _(AtomicsXor) \
36 _(AtomicsIsLockFree) \
38 _(BigIntAsIntN) \
39 _(BigIntAsUintN) \
41 _(Boolean) \
43 _(DataViewGetInt8) \
44 _(DataViewGetUint8) \
45 _(DataViewGetInt16) \
46 _(DataViewGetUint16) \
47 _(DataViewGetInt32) \
48 _(DataViewGetUint32) \
49 _(DataViewGetFloat32) \
50 _(DataViewGetFloat64) \
51 _(DataViewGetBigInt64) \
52 _(DataViewGetBigUint64) \
53 _(DataViewSetInt8) \
54 _(DataViewSetUint8) \
55 _(DataViewSetInt16) \
56 _(DataViewSetUint16) \
57 _(DataViewSetInt32) \
58 _(DataViewSetUint32) \
59 _(DataViewSetFloat32) \
60 _(DataViewSetFloat64) \
61 _(DataViewSetBigInt64) \
62 _(DataViewSetBigUint64) \
64 _(FunctionBind) \
66 _(IntlGuardToCollator) \
67 _(IntlGuardToDateTimeFormat) \
68 _(IntlGuardToDisplayNames) \
69 _(IntlGuardToListFormat) \
70 _(IntlGuardToNumberFormat) \
71 _(IntlGuardToPluralRules) \
72 _(IntlGuardToRelativeTimeFormat) \
73 _(IntlGuardToSegmenter) \
74 _(IntlGuardToSegments) \
75 _(IntlGuardToSegmentIterator) \
77 _(MapGet) \
78 _(MapHas) \
80 _(MathAbs) \
81 _(MathFloor) \
82 _(MathCeil) \
83 _(MathRound) \
84 _(MathClz32) \
85 _(MathSqrt) \
86 _(MathATan2) \
87 _(MathHypot) \
88 _(MathMax) \
89 _(MathMin) \
90 _(MathPow) \
91 _(MathRandom) \
92 _(MathImul) \
93 _(MathFRound) \
94 _(MathSin) \
95 _(MathTan) \
96 _(MathCos) \
97 _(MathExp) \
98 _(MathLog) \
99 _(MathASin) \
100 _(MathATan) \
101 _(MathACos) \
102 _(MathLog10) \
103 _(MathLog2) \
104 _(MathLog1P) \
105 _(MathExpM1) \
106 _(MathSinH) \
107 _(MathTanH) \
108 _(MathCosH) \
109 _(MathASinH) \
110 _(MathATanH) \
111 _(MathACosH) \
112 _(MathSign) \
113 _(MathTrunc) \
114 _(MathCbrt) \
116 _(Number) \
117 _(NumberParseInt) \
118 _(NumberToString) \
120 _(ReflectGetPrototypeOf) \
122 _(RegExpMatcher) \
123 _(RegExpSearcher) \
124 _(RegExpSearcherLastLimit) \
125 _(RegExpHasCaptureGroups) \
126 _(IsRegExpObject) \
127 _(IsPossiblyWrappedRegExpObject) \
128 _(RegExpPrototypeOptimizable) \
129 _(RegExpInstanceOptimizable) \
130 _(GetFirstDollarIndex) \
132 _(SetHas) \
133 _(SetSize) \
135 _(String) \
136 _(StringToString) \
137 _(StringValueOf) \
138 _(StringCharCodeAt) \
139 _(StringCodePointAt) \
140 _(StringFromCharCode) \
141 _(StringFromCodePoint) \
142 _(StringCharAt) \
143 _(StringAt) \
144 _(StringIncludes) \
145 _(StringIndexOf) \
146 _(StringLastIndexOf) \
147 _(StringStartsWith) \
148 _(StringEndsWith) \
149 _(StringToLowerCase) \
150 _(StringToUpperCase) \
151 _(StringTrim) \
152 _(StringTrimStart) \
153 _(StringTrimEnd) \
155 _(IntrinsicStringReplaceString) \
156 _(IntrinsicStringSplitString) \
158 _(Object) \
159 _(ObjectCreate) \
160 _(ObjectIs) \
161 _(ObjectIsPrototypeOf) \
162 _(ObjectKeys) \
163 _(ObjectToString) \
165 _(TestBailout) \
166 _(TestAssertFloat32) \
167 _(TestAssertRecoveredOnBailout) \
169 _(IntrinsicUnsafeSetReservedSlot) \
170 _(IntrinsicUnsafeGetReservedSlot) \
171 _(IntrinsicUnsafeGetObjectFromReservedSlot) \
172 _(IntrinsicUnsafeGetInt32FromReservedSlot) \
173 _(IntrinsicUnsafeGetStringFromReservedSlot) \
175 _(IntrinsicIsCallable) \
176 _(IntrinsicIsConstructor) \
177 _(IntrinsicToObject) \
178 _(IntrinsicIsObject) \
179 _(IntrinsicIsCrossRealmArrayConstructor) \
180 _(IntrinsicToInteger) \
181 _(IntrinsicToLength) \
182 _(IntrinsicIsConstructing) \
183 _(IntrinsicSubstringKernel) \
184 _(IntrinsicObjectHasPrototype) \
185 _(IntrinsicIsPackedArray) \
187 _(IntrinsicIsSuspendedGenerator) \
189 _(IntrinsicGuardToArrayIterator) \
190 _(IntrinsicGuardToMapIterator) \
191 _(IntrinsicGuardToSetIterator) \
192 _(IntrinsicGuardToStringIterator) \
193 _(IntrinsicGuardToRegExpStringIterator) \
194 _(IntrinsicGuardToWrapForValidIterator) \
195 _(IntrinsicGuardToIteratorHelper) \
196 _(IntrinsicGuardToAsyncIteratorHelper) \
198 _(IntrinsicGuardToMapObject) \
199 _(IntrinsicGetNextMapEntryForIterator) \
201 _(IntrinsicGuardToSetObject) \
202 _(IntrinsicGetNextSetEntryForIterator) \
204 _(IntrinsicNewArrayIterator) \
205 _(IntrinsicNewStringIterator) \
206 _(IntrinsicNewRegExpStringIterator) \
207 _(IntrinsicArrayIteratorPrototypeOptimizable) \
209 _(IntrinsicGuardToArrayBuffer) \
210 _(IntrinsicArrayBufferByteLength) \
211 _(IntrinsicPossiblyWrappedArrayBufferByteLength) \
213 _(IntrinsicGuardToSharedArrayBuffer) \
215 _(TypedArrayConstructor) \
216 _(IntrinsicIsTypedArrayConstructor) \
217 _(IntrinsicIsTypedArray) \
218 _(IntrinsicIsPossiblyWrappedTypedArray) \
219 _(IntrinsicTypedArrayLength) \
220 _(IntrinsicTypedArrayLengthZeroOnOutOfBounds) \
221 _(IntrinsicPossiblyWrappedTypedArrayLength) \
222 _(IntrinsicRegExpBuiltinExec) \
223 _(IntrinsicRegExpBuiltinExecForTest) \
224 _(IntrinsicRegExpExec) \
225 _(IntrinsicRegExpExecForTest) \
226 _(IntrinsicTypedArrayByteOffset) \
227 _(IntrinsicTypedArrayElementSize) \
229 INLINABLE_NATIVE_FUZZILLI_LIST(_)
231 struct JSClass;
232 class JSJitInfo;
234 namespace js {
235 namespace jit {
237 enum class InlinableNative : uint16_t {
238 #define ADD_NATIVE(native) native,
239 INLINABLE_NATIVE_LIST(ADD_NATIVE)
240 #undef ADD_NATIVE
241 Limit
244 #define ADD_NATIVE(native) extern const JSJitInfo JitInfo_##native;
245 INLINABLE_NATIVE_LIST(ADD_NATIVE)
246 #undef ADD_NATIVE
248 const JSClass* InlinableNativeGuardToClass(InlinableNative native);
250 bool CanInlineNativeCrossRealm(InlinableNative native);
252 } // namespace jit
253 } // namespace js
255 #endif /* jit_InlinableNatives_h */