1/*
2 * Copyright (C) 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#include "config.h"
27#include "Intrinsic.h"
28
29#include <wtf/PrintStream.h>
30
31namespace JSC {
32
33const char* intrinsicName(Intrinsic intrinsic)
34{
35 switch (intrinsic) {
36 case NoIntrinsic:
37 return "NoIntrinsic";
38 case AbsIntrinsic:
39 return "AbsIntrinsic";
40 case ACosIntrinsic:
41 return "ACosIntrinsic";
42 case ASinIntrinsic:
43 return "ASinIntrinsic";
44 case ATanIntrinsic:
45 return "ATanIntrinsic";
46 case ACoshIntrinsic:
47 return "ACoshIntrinsic";
48 case ASinhIntrinsic:
49 return "ASinhIntrinsic";
50 case ATanhIntrinsic:
51 return "ATanhIntrinsic";
52 case MinIntrinsic:
53 return "MinIntrinsic";
54 case MaxIntrinsic:
55 return "MaxIntrinsic";
56 case SqrtIntrinsic:
57 return "SqrtIntrinsic";
58 case SinIntrinsic:
59 return "SinIntrinsic";
60 case CbrtIntrinsic:
61 return "CbrtIntrinsic";
62 case Clz32Intrinsic:
63 return "Clz32Intrinsic";
64 case CosIntrinsic:
65 return "CosIntrinsic";
66 case TanIntrinsic:
67 return "TanIntrinsic";
68 case CoshIntrinsic:
69 return "CoshIntrinsic";
70 case SinhIntrinsic:
71 return "SinhIntrinsic";
72 case TanhIntrinsic:
73 return "TanhIntrinsic";
74 case ArrayIndexOfIntrinsic:
75 return "ArrayIndexOfIntrinsic";
76 case ArrayPushIntrinsic:
77 return "ArrayPushIntrinsic";
78 case ArrayPopIntrinsic:
79 return "ArrayPopIntrinsic";
80 case ArraySliceIntrinsic:
81 return "ArraySliceIntrinsic";
82 case CharCodeAtIntrinsic:
83 return "CharCodeAtIntrinsic";
84 case CharAtIntrinsic:
85 return "CharAtIntrinsic";
86 case FromCharCodeIntrinsic:
87 return "FromCharCodeIntrinsic";
88 case PowIntrinsic:
89 return "PowIntrinsic";
90 case FloorIntrinsic:
91 return "FloorIntrinsic";
92 case CeilIntrinsic:
93 return "CeilIntrinsic";
94 case RoundIntrinsic:
95 return "RoundIntrinsic";
96 case ExpIntrinsic:
97 return "ExpIntrinsic";
98 case Expm1Intrinsic:
99 return "Expm1Intrinsic";
100 case LogIntrinsic:
101 return "LogIntrinsic";
102 case Log10Intrinsic:
103 return "Log10Intrinsic";
104 case Log1pIntrinsic:
105 return "Log1pIntrinsic";
106 case Log2Intrinsic:
107 return "Log2Intrinsic";
108 case RegExpExecIntrinsic:
109 return "RegExpExecIntrinsic";
110 case RegExpTestIntrinsic:
111 return "RegExpTestIntrinsic";
112 case RegExpTestFastIntrinsic:
113 return "RegExpTestFastIntrinsic";
114 case RegExpMatchFastIntrinsic:
115 return "RegExpMatchFastIntrinsic";
116 case ObjectCreateIntrinsic:
117 return "ObjectCreateIntrinsic";
118 case ObjectGetPrototypeOfIntrinsic:
119 return "ObjectGetPrototypeOfIntrinsic";
120 case ObjectIsIntrinsic:
121 return "ObjectIsIntrinsic";
122 case ObjectKeysIntrinsic:
123 return "ObjectKeysIntrinsic";
124 case ReflectGetPrototypeOfIntrinsic:
125 return "ReflectGetPrototypeOfIntrinsic";
126 case StringPrototypeValueOfIntrinsic:
127 return "StringPrototypeValueOfIntrinsic";
128 case StringPrototypeReplaceIntrinsic:
129 return "StringPrototypeReplaceIntrinsic";
130 case StringPrototypeReplaceRegExpIntrinsic:
131 return "StringPrototypeReplaceRegExpIntrinsic";
132 case StringPrototypeSliceIntrinsic:
133 return "StringPrototypeSliceIntrinsic";
134 case StringPrototypeToLowerCaseIntrinsic:
135 return "StringPrototypeToLowerCaseIntrinsic";
136 case NumberPrototypeToStringIntrinsic:
137 return "NumberPrototypeToStringIntrinsic";
138 case NumberIsIntegerIntrinsic:
139 return "NumberIsIntegerIntrinsic";
140 case IMulIntrinsic:
141 return "IMulIntrinsic";
142 case RandomIntrinsic:
143 return "RandomIntrinsic";
144 case FRoundIntrinsic:
145 return "FRoundIntrinsic";
146 case TruncIntrinsic:
147 return "TruncIntrinsic";
148 case IsTypedArrayViewIntrinsic:
149 return "IsTypedArrayViewIntrinsic";
150 case BoundThisNoArgsFunctionCallIntrinsic:
151 return "BoundThisNoArgsFunctionCallIntrinsic";
152 case JSMapGetIntrinsic:
153 return "JSMapGetIntrinsic";
154 case JSMapHasIntrinsic:
155 return "JSMapHasIntrinsic";
156 case JSMapSetIntrinsic:
157 return "JSMapSetIntrinsic";
158 case JSMapBucketHeadIntrinsic:
159 return "JSMapBucketHeadIntrinsic";
160 case JSMapBucketNextIntrinsic:
161 return "JSMapBucketNextIntrinsic";
162 case JSMapBucketKeyIntrinsic:
163 return "JSMapBucketKeyIntrinsic";
164 case JSMapBucketValueIntrinsic:
165 return "JSMapBucketValueIntrinsic";
166 case JSSetHasIntrinsic:
167 return "JSSetHasIntrinsic";
168 case JSSetAddIntrinsic:
169 return "JSSetAddIntrinsic";
170 case JSSetBucketHeadIntrinsic:
171 return "JSSetBucketHeadIntrinsic";
172 case JSSetBucketNextIntrinsic:
173 return "JSSetBucketNextIntrinsic";
174 case JSSetBucketKeyIntrinsic:
175 return "JSSetBucketKeyIntrinsic";
176 case JSWeakMapGetIntrinsic:
177 return "JSWeakMapGetIntrinsic";
178 case JSWeakMapHasIntrinsic:
179 return "JSWeakMapHasIntrinsic";
180 case JSWeakMapSetIntrinsic:
181 return "JSWeakMapSetIntrinsic";
182 case JSWeakSetHasIntrinsic:
183 return "JSWeakSetHasIntrinsic";
184 case JSWeakSetAddIntrinsic:
185 return "JSWeakSetAddIntrinsic";
186 case HasOwnPropertyIntrinsic:
187 return "HasOwnPropertyIntrinsic";
188 case AtomicsAddIntrinsic:
189 return "AtomicsAddIntrinsic";
190 case AtomicsAndIntrinsic:
191 return "AtomicsAndIntrinsic";
192 case AtomicsCompareExchangeIntrinsic:
193 return "AtomicsCompareExchangeIntrinsic";
194 case AtomicsExchangeIntrinsic:
195 return "AtomicsExchangeIntrinsic";
196 case AtomicsIsLockFreeIntrinsic:
197 return "AtomicsIsLockFreeIntrinsic";
198 case AtomicsLoadIntrinsic:
199 return "AtomicsLoadIntrinsic";
200 case AtomicsOrIntrinsic:
201 return "AtomicsOrIntrinsic";
202 case AtomicsStoreIntrinsic:
203 return "AtomicsStoreIntrinsic";
204 case AtomicsSubIntrinsic:
205 return "AtomicsSubIntrinsic";
206 case AtomicsWaitIntrinsic:
207 return "AtomicsWaitIntrinsic";
208 case AtomicsWakeIntrinsic:
209 return "AtomicsWakeIntrinsic";
210 case AtomicsXorIntrinsic:
211 return "AtomicsXorIntrinsic";
212 case ParseIntIntrinsic:
213 return "ParseIntIntrinsic";
214 case TypedArrayLengthIntrinsic:
215 return "TypedArrayLengthIntrinsic";
216 case TypedArrayByteLengthIntrinsic:
217 return "TypedArrayByteLengthIntrinsic";
218 case TypedArrayByteOffsetIntrinsic:
219 return "TypedArrayByteOffsetIntrinsic";
220 case UnderscoreProtoIntrinsic:
221 return "UnderscoreProtoIntrinsic";
222 case DFGTrueIntrinsic:
223 return "DFGTrueIntrinsic";
224 case FTLTrueIntrinsic:
225 return "FTLTrueIntrinsic";
226 case OSRExitIntrinsic:
227 return "OSRExitIntrinsic";
228 case IsFinalTierIntrinsic:
229 return "IsFinalTierIntrinsic";
230 case SetInt32HeapPredictionIntrinsic:
231 return "SetInt32HeapPredictionIntrinsic";
232 case CheckInt32Intrinsic:
233 return "CheckInt32Intrinsic";
234 case FiatInt52Intrinsic:
235 return "FiatInt52Intrinsic";
236 case CPUMfenceIntrinsic:
237 return "CPUMfenceIntrinsic";
238 case CPURdtscIntrinsic:
239 return "CPURdtscIntrinsic";
240 case CPUCpuidIntrinsic:
241 return "CPUCpuidIntrinsic";
242 case CPUPauseIntrinsic:
243 return "CPUPauseIntrinsic";
244 case DataViewGetInt8:
245 return "DataViewGetInt8";
246 case DataViewGetUint8:
247 return "DataViewGetUint8";
248 case DataViewGetInt16:
249 return "DataViewGetInt16";
250 case DataViewGetUint16:
251 return "DataViewGetUint16";
252 case DataViewGetInt32:
253 return "DataViewGetInt32";
254 case DataViewGetUint32:
255 return "DataViewGetUint32";
256 case DataViewGetFloat32:
257 return "DataViewGetFloat32";
258 case DataViewGetFloat64:
259 return "DataViewGetFloat64";
260 case DataViewSetInt8:
261 return "DataViewSetInt8";
262 case DataViewSetUint8:
263 return "DataViewSetUint8";
264 case DataViewSetInt16:
265 return "DataViewSetInt16";
266 case DataViewSetUint16:
267 return "DataViewSetUint16";
268 case DataViewSetInt32:
269 return "DataViewSetInt32";
270 case DataViewSetUint32:
271 return "DataViewSetUint32";
272 case DataViewSetFloat32:
273 return "DataViewSetFloat32";
274 case DataViewSetFloat64:
275 return "DataViewSetFloat64";
276 }
277 RELEASE_ASSERT_NOT_REACHED();
278 return nullptr;
279}
280
281} // namespace JSC
282
283namespace WTF {
284
285void printInternal(PrintStream& out, JSC::Intrinsic intrinsic)
286{
287 out.print(JSC::intrinsicName(intrinsic));
288}
289
290} // namespace WTF
291
292