1/*
2 * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#pragma once
27
28namespace JSC {
29
30enum Intrinsic : uint8_t {
31 // Call intrinsics.
32 NoIntrinsic,
33 AbsIntrinsic,
34 ACosIntrinsic,
35 ASinIntrinsic,
36 ATanIntrinsic,
37 ACoshIntrinsic,
38 ASinhIntrinsic,
39 ATanhIntrinsic,
40 MinIntrinsic,
41 MaxIntrinsic,
42 SqrtIntrinsic,
43 SinIntrinsic,
44 CbrtIntrinsic,
45 Clz32Intrinsic,
46 CosIntrinsic,
47 TanIntrinsic,
48 CoshIntrinsic,
49 SinhIntrinsic,
50 TanhIntrinsic,
51 ArrayPushIntrinsic,
52 ArrayPopIntrinsic,
53 ArraySliceIntrinsic,
54 ArrayIndexOfIntrinsic,
55 CharCodeAtIntrinsic,
56 CharAtIntrinsic,
57 DatePrototypeGetTimeIntrinsic,
58 DatePrototypeGetFullYearIntrinsic,
59 DatePrototypeGetUTCFullYearIntrinsic,
60 DatePrototypeGetMonthIntrinsic,
61 DatePrototypeGetUTCMonthIntrinsic,
62 DatePrototypeGetDateIntrinsic,
63 DatePrototypeGetUTCDateIntrinsic,
64 DatePrototypeGetDayIntrinsic,
65 DatePrototypeGetUTCDayIntrinsic,
66 DatePrototypeGetHoursIntrinsic,
67 DatePrototypeGetUTCHoursIntrinsic,
68 DatePrototypeGetMinutesIntrinsic,
69 DatePrototypeGetUTCMinutesIntrinsic,
70 DatePrototypeGetSecondsIntrinsic,
71 DatePrototypeGetUTCSecondsIntrinsic,
72 DatePrototypeGetMillisecondsIntrinsic,
73 DatePrototypeGetUTCMillisecondsIntrinsic,
74 DatePrototypeGetTimezoneOffsetIntrinsic,
75 DatePrototypeGetYearIntrinsic,
76 FromCharCodeIntrinsic,
77 PowIntrinsic,
78 FloorIntrinsic,
79 CeilIntrinsic,
80 RoundIntrinsic,
81 ExpIntrinsic,
82 Expm1Intrinsic,
83 LogIntrinsic,
84 Log10Intrinsic,
85 Log1pIntrinsic,
86 Log2Intrinsic,
87 RegExpExecIntrinsic,
88 RegExpTestIntrinsic,
89 RegExpTestFastIntrinsic,
90 RegExpMatchFastIntrinsic,
91 ObjectCreateIntrinsic,
92 ObjectGetPrototypeOfIntrinsic,
93 ObjectIsIntrinsic,
94 ObjectKeysIntrinsic,
95 ReflectGetPrototypeOfIntrinsic,
96 StringPrototypeCodePointAtIntrinsic,
97 StringPrototypeValueOfIntrinsic,
98 StringPrototypeReplaceIntrinsic,
99 StringPrototypeReplaceRegExpIntrinsic,
100 StringPrototypeSliceIntrinsic,
101 StringPrototypeToLowerCaseIntrinsic,
102 NumberPrototypeToStringIntrinsic,
103 NumberIsIntegerIntrinsic,
104 IMulIntrinsic,
105 RandomIntrinsic,
106 FRoundIntrinsic,
107 TruncIntrinsic,
108 IsTypedArrayViewIntrinsic,
109 BoundThisNoArgsFunctionCallIntrinsic,
110 JSMapGetIntrinsic,
111 JSMapHasIntrinsic,
112 JSMapSetIntrinsic,
113 JSMapBucketHeadIntrinsic,
114 JSMapBucketNextIntrinsic,
115 JSMapBucketKeyIntrinsic,
116 JSMapBucketValueIntrinsic,
117 JSSetHasIntrinsic,
118 JSSetAddIntrinsic,
119 JSSetBucketHeadIntrinsic,
120 JSSetBucketNextIntrinsic,
121 JSSetBucketKeyIntrinsic,
122 JSWeakMapGetIntrinsic,
123 JSWeakMapHasIntrinsic,
124 JSWeakMapSetIntrinsic,
125 JSWeakSetHasIntrinsic,
126 JSWeakSetAddIntrinsic,
127 HasOwnPropertyIntrinsic,
128 AtomicsAddIntrinsic,
129 AtomicsAndIntrinsic,
130 AtomicsCompareExchangeIntrinsic,
131 AtomicsExchangeIntrinsic,
132 AtomicsIsLockFreeIntrinsic,
133 AtomicsLoadIntrinsic,
134 AtomicsOrIntrinsic,
135 AtomicsStoreIntrinsic,
136 AtomicsSubIntrinsic,
137 AtomicsWaitIntrinsic,
138 AtomicsWakeIntrinsic,
139 AtomicsXorIntrinsic,
140 ParseIntIntrinsic,
141
142 // Getter intrinsics.
143 TypedArrayLengthIntrinsic,
144 TypedArrayByteLengthIntrinsic,
145 TypedArrayByteOffsetIntrinsic,
146 UnderscoreProtoIntrinsic,
147
148 // Debugging intrinsics. These are meant to be used as testing hacks within
149 // jsc.cpp and should never be exposed to users.
150 DFGTrueIntrinsic,
151 FTLTrueIntrinsic,
152 OSRExitIntrinsic,
153 IsFinalTierIntrinsic,
154 SetInt32HeapPredictionIntrinsic,
155 CheckInt32Intrinsic,
156 FiatInt52Intrinsic,
157
158 // These are used for $vm performance debugging features.
159 CPUMfenceIntrinsic,
160 CPURdtscIntrinsic,
161 CPUCpuidIntrinsic,
162 CPUPauseIntrinsic,
163
164 DataViewGetInt8,
165 DataViewGetUint8,
166 DataViewGetInt16,
167 DataViewGetUint16,
168 DataViewGetInt32,
169 DataViewGetUint32,
170 DataViewGetFloat32,
171 DataViewGetFloat64,
172 DataViewSetInt8,
173 DataViewSetUint8,
174 DataViewSetInt16,
175 DataViewSetUint16,
176 DataViewSetInt32,
177 DataViewSetUint32,
178 DataViewSetFloat32,
179 DataViewSetFloat64,
180};
181
182const char* intrinsicName(Intrinsic);
183
184} // namespace JSC
185
186namespace WTF {
187
188class PrintStream;
189
190void printInternal(PrintStream&, JSC::Intrinsic);
191
192} // namespace WTF
193
194
195