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 | |
28 | namespace JSC { |
29 | |
30 | enum 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 | FromCharCodeIntrinsic, |
58 | PowIntrinsic, |
59 | FloorIntrinsic, |
60 | CeilIntrinsic, |
61 | RoundIntrinsic, |
62 | ExpIntrinsic, |
63 | Expm1Intrinsic, |
64 | LogIntrinsic, |
65 | Log10Intrinsic, |
66 | Log1pIntrinsic, |
67 | Log2Intrinsic, |
68 | RegExpExecIntrinsic, |
69 | RegExpTestIntrinsic, |
70 | RegExpTestFastIntrinsic, |
71 | RegExpMatchFastIntrinsic, |
72 | ObjectCreateIntrinsic, |
73 | ObjectGetPrototypeOfIntrinsic, |
74 | ObjectIsIntrinsic, |
75 | ObjectKeysIntrinsic, |
76 | ReflectGetPrototypeOfIntrinsic, |
77 | StringPrototypeValueOfIntrinsic, |
78 | StringPrototypeReplaceIntrinsic, |
79 | StringPrototypeReplaceRegExpIntrinsic, |
80 | StringPrototypeSliceIntrinsic, |
81 | StringPrototypeToLowerCaseIntrinsic, |
82 | NumberPrototypeToStringIntrinsic, |
83 | NumberIsIntegerIntrinsic, |
84 | IMulIntrinsic, |
85 | RandomIntrinsic, |
86 | FRoundIntrinsic, |
87 | TruncIntrinsic, |
88 | IsTypedArrayViewIntrinsic, |
89 | BoundThisNoArgsFunctionCallIntrinsic, |
90 | JSMapGetIntrinsic, |
91 | JSMapHasIntrinsic, |
92 | JSMapSetIntrinsic, |
93 | JSMapBucketHeadIntrinsic, |
94 | JSMapBucketNextIntrinsic, |
95 | JSMapBucketKeyIntrinsic, |
96 | JSMapBucketValueIntrinsic, |
97 | JSSetHasIntrinsic, |
98 | JSSetAddIntrinsic, |
99 | JSSetBucketHeadIntrinsic, |
100 | JSSetBucketNextIntrinsic, |
101 | JSSetBucketKeyIntrinsic, |
102 | JSWeakMapGetIntrinsic, |
103 | JSWeakMapHasIntrinsic, |
104 | JSWeakMapSetIntrinsic, |
105 | JSWeakSetHasIntrinsic, |
106 | JSWeakSetAddIntrinsic, |
107 | HasOwnPropertyIntrinsic, |
108 | AtomicsAddIntrinsic, |
109 | AtomicsAndIntrinsic, |
110 | AtomicsCompareExchangeIntrinsic, |
111 | AtomicsExchangeIntrinsic, |
112 | AtomicsIsLockFreeIntrinsic, |
113 | AtomicsLoadIntrinsic, |
114 | AtomicsOrIntrinsic, |
115 | AtomicsStoreIntrinsic, |
116 | AtomicsSubIntrinsic, |
117 | AtomicsWaitIntrinsic, |
118 | AtomicsWakeIntrinsic, |
119 | AtomicsXorIntrinsic, |
120 | ParseIntIntrinsic, |
121 | |
122 | // Getter intrinsics. |
123 | TypedArrayLengthIntrinsic, |
124 | TypedArrayByteLengthIntrinsic, |
125 | TypedArrayByteOffsetIntrinsic, |
126 | UnderscoreProtoIntrinsic, |
127 | |
128 | // Debugging intrinsics. These are meant to be used as testing hacks within |
129 | // jsc.cpp and should never be exposed to users. |
130 | DFGTrueIntrinsic, |
131 | FTLTrueIntrinsic, |
132 | OSRExitIntrinsic, |
133 | IsFinalTierIntrinsic, |
134 | SetInt32HeapPredictionIntrinsic, |
135 | CheckInt32Intrinsic, |
136 | FiatInt52Intrinsic, |
137 | |
138 | // These are used for $vm performance debugging features. |
139 | CPUMfenceIntrinsic, |
140 | CPURdtscIntrinsic, |
141 | CPUCpuidIntrinsic, |
142 | CPUPauseIntrinsic, |
143 | |
144 | DataViewGetInt8, |
145 | DataViewGetUint8, |
146 | DataViewGetInt16, |
147 | DataViewGetUint16, |
148 | DataViewGetInt32, |
149 | DataViewGetUint32, |
150 | DataViewGetFloat32, |
151 | DataViewGetFloat64, |
152 | DataViewSetInt8, |
153 | DataViewSetUint8, |
154 | DataViewSetInt16, |
155 | DataViewSetUint16, |
156 | DataViewSetInt32, |
157 | DataViewSetUint32, |
158 | DataViewSetFloat32, |
159 | DataViewSetFloat64, |
160 | }; |
161 | |
162 | const char* intrinsicName(Intrinsic); |
163 | |
164 | } // namespace JSC |
165 | |
166 | namespace WTF { |
167 | |
168 | class PrintStream; |
169 | |
170 | void printInternal(PrintStream&, JSC::Intrinsic); |
171 | |
172 | } // namespace WTF |
173 | |
174 | |
175 | |