Line data Source code
1 : // Copyright 2013 the V8 project authors. All rights reserved.
2 : // Use of this source code is governed by a BSD-style license that can be
3 : // found in the LICENSE file.
4 :
5 : #ifndef V8_COMPILER_OPCODES_H_
6 : #define V8_COMPILER_OPCODES_H_
7 :
8 : #include <iosfwd>
9 :
10 : #include "src/globals.h"
11 :
12 : // Opcodes for control operators.
13 : #define CONTROL_OP_LIST(V) \
14 : V(Start) \
15 : V(Loop) \
16 : V(Branch) \
17 : V(Switch) \
18 : V(IfTrue) \
19 : V(IfFalse) \
20 : V(IfSuccess) \
21 : V(IfException) \
22 : V(IfValue) \
23 : V(IfDefault) \
24 : V(Merge) \
25 : V(Deoptimize) \
26 : V(DeoptimizeIf) \
27 : V(DeoptimizeUnless) \
28 : V(TrapIf) \
29 : V(TrapUnless) \
30 : V(Return) \
31 : V(TailCall) \
32 : V(Terminate) \
33 : V(OsrNormalEntry) \
34 : V(OsrLoopEntry) \
35 : V(Throw) \
36 : V(End)
37 :
38 : // Opcodes for constant operators.
39 : #define CONSTANT_OP_LIST(V) \
40 : V(Int32Constant) \
41 : V(Int64Constant) \
42 : V(Float32Constant) \
43 : V(Float64Constant) \
44 : V(ExternalConstant) \
45 : V(NumberConstant) \
46 : V(PointerConstant) \
47 : V(HeapConstant) \
48 : V(RelocatableInt32Constant) \
49 : V(RelocatableInt64Constant)
50 :
51 : #define INNER_OP_LIST(V) \
52 : V(Select) \
53 : V(Phi) \
54 : V(EffectPhi) \
55 : V(InductionVariablePhi) \
56 : V(Checkpoint) \
57 : V(BeginRegion) \
58 : V(FinishRegion) \
59 : V(FrameState) \
60 : V(StateValues) \
61 : V(TypedStateValues) \
62 : V(ArgumentsElementsState) \
63 : V(ArgumentsLengthState) \
64 : V(ObjectState) \
65 : V(TypedObjectState) \
66 : V(Call) \
67 : V(Parameter) \
68 : V(OsrValue) \
69 : V(OsrGuard) \
70 : V(LoopExit) \
71 : V(LoopExitValue) \
72 : V(LoopExitEffect) \
73 : V(Projection) \
74 : V(Retain) \
75 : V(TypeGuard)
76 :
77 : #define COMMON_OP_LIST(V) \
78 : CONSTANT_OP_LIST(V) \
79 : INNER_OP_LIST(V) \
80 : V(Dead)
81 :
82 : // Opcodes for JavaScript operators.
83 : #define JS_COMPARE_BINOP_LIST(V) \
84 : V(JSEqual) \
85 : V(JSStrictEqual) \
86 : V(JSLessThan) \
87 : V(JSGreaterThan) \
88 : V(JSLessThanOrEqual) \
89 : V(JSGreaterThanOrEqual)
90 :
91 : #define JS_BITWISE_BINOP_LIST(V) \
92 : V(JSBitwiseOr) \
93 : V(JSBitwiseXor) \
94 : V(JSBitwiseAnd) \
95 : V(JSShiftLeft) \
96 : V(JSShiftRight) \
97 : V(JSShiftRightLogical)
98 :
99 : #define JS_ARITH_BINOP_LIST(V) \
100 : V(JSAdd) \
101 : V(JSSubtract) \
102 : V(JSMultiply) \
103 : V(JSDivide) \
104 : V(JSModulus)
105 :
106 : #define JS_SIMPLE_BINOP_LIST(V) \
107 : JS_COMPARE_BINOP_LIST(V) \
108 : JS_BITWISE_BINOP_LIST(V) \
109 : JS_ARITH_BINOP_LIST(V) \
110 : V(JSInstanceOf) \
111 : V(JSOrdinaryHasInstance)
112 :
113 : #define JS_CONVERSION_UNOP_LIST(V) \
114 : V(JSToBoolean) \
115 : V(JSToInteger) \
116 : V(JSToLength) \
117 : V(JSToName) \
118 : V(JSToNumber) \
119 : V(JSToObject) \
120 : V(JSToString)
121 :
122 : #define JS_OTHER_UNOP_LIST(V) \
123 : V(JSClassOf) \
124 : V(JSTypeOf)
125 :
126 : #define JS_SIMPLE_UNOP_LIST(V) \
127 : JS_CONVERSION_UNOP_LIST(V) \
128 : JS_OTHER_UNOP_LIST(V)
129 :
130 : #define JS_OBJECT_OP_LIST(V) \
131 : V(JSCreate) \
132 : V(JSCreateArguments) \
133 : V(JSCreateArray) \
134 : V(JSCreateClosure) \
135 : V(JSCreateIterResultObject) \
136 : V(JSCreateKeyValueArray) \
137 : V(JSCreateLiteralArray) \
138 : V(JSCreateLiteralObject) \
139 : V(JSCreateLiteralRegExp) \
140 : V(JSLoadProperty) \
141 : V(JSLoadNamed) \
142 : V(JSLoadGlobal) \
143 : V(JSStoreProperty) \
144 : V(JSStoreNamed) \
145 : V(JSStoreNamedOwn) \
146 : V(JSStoreGlobal) \
147 : V(JSStoreDataPropertyInLiteral) \
148 : V(JSDeleteProperty) \
149 : V(JSHasProperty) \
150 : V(JSGetSuperConstructor)
151 :
152 : #define JS_CONTEXT_OP_LIST(V) \
153 : V(JSLoadContext) \
154 : V(JSStoreContext) \
155 : V(JSCreateFunctionContext) \
156 : V(JSCreateCatchContext) \
157 : V(JSCreateWithContext) \
158 : V(JSCreateBlockContext) \
159 : V(JSCreateScriptContext)
160 :
161 : #define JS_OTHER_OP_LIST(V) \
162 : V(JSConstruct) \
163 : V(JSConstructWithSpread) \
164 : V(JSCallForwardVarargs) \
165 : V(JSCall) \
166 : V(JSCallWithSpread) \
167 : V(JSCallRuntime) \
168 : V(JSConvertReceiver) \
169 : V(JSForInNext) \
170 : V(JSForInPrepare) \
171 : V(JSLoadMessage) \
172 : V(JSStoreMessage) \
173 : V(JSLoadModule) \
174 : V(JSStoreModule) \
175 : V(JSGeneratorStore) \
176 : V(JSGeneratorRestoreContinuation) \
177 : V(JSGeneratorRestoreRegister) \
178 : V(JSStackCheck) \
179 : V(JSDebugger)
180 :
181 : #define JS_OP_LIST(V) \
182 : JS_SIMPLE_BINOP_LIST(V) \
183 : JS_SIMPLE_UNOP_LIST(V) \
184 : JS_OBJECT_OP_LIST(V) \
185 : JS_CONTEXT_OP_LIST(V) \
186 : JS_OTHER_OP_LIST(V)
187 :
188 : // Opcodes for VirtuaMachine-level operators.
189 : #define SIMPLIFIED_CHANGE_OP_LIST(V) \
190 : V(ChangeTaggedSignedToInt32) \
191 : V(ChangeTaggedToInt32) \
192 : V(ChangeTaggedToUint32) \
193 : V(ChangeTaggedToFloat64) \
194 : V(ChangeTaggedToTaggedSigned) \
195 : V(ChangeInt31ToTaggedSigned) \
196 : V(ChangeInt32ToTagged) \
197 : V(ChangeUint32ToTagged) \
198 : V(ChangeFloat64ToTagged) \
199 : V(ChangeFloat64ToTaggedPointer) \
200 : V(ChangeTaggedToBit) \
201 : V(ChangeBitToTagged) \
202 : V(TruncateTaggedToWord32) \
203 : V(TruncateTaggedToFloat64) \
204 : V(TruncateTaggedToBit) \
205 : V(TruncateTaggedPointerToBit)
206 :
207 : #define SIMPLIFIED_CHECKED_OP_LIST(V) \
208 : V(CheckedInt32Add) \
209 : V(CheckedInt32Sub) \
210 : V(CheckedInt32Div) \
211 : V(CheckedInt32Mod) \
212 : V(CheckedUint32Div) \
213 : V(CheckedUint32Mod) \
214 : V(CheckedInt32Mul) \
215 : V(CheckedInt32ToTaggedSigned) \
216 : V(CheckedUint32ToInt32) \
217 : V(CheckedUint32ToTaggedSigned) \
218 : V(CheckedFloat64ToInt32) \
219 : V(CheckedTaggedSignedToInt32) \
220 : V(CheckedTaggedToInt32) \
221 : V(CheckedTruncateTaggedToWord32) \
222 : V(CheckedTaggedToFloat64) \
223 : V(CheckedTaggedToTaggedSigned) \
224 : V(CheckedTaggedToTaggedPointer)
225 :
226 : #define SIMPLIFIED_COMPARE_BINOP_LIST(V) \
227 : V(NumberEqual) \
228 : V(NumberLessThan) \
229 : V(NumberLessThanOrEqual) \
230 : V(SpeculativeNumberEqual) \
231 : V(SpeculativeNumberLessThan) \
232 : V(SpeculativeNumberLessThanOrEqual) \
233 : V(ReferenceEqual) \
234 : V(StringEqual) \
235 : V(StringLessThan) \
236 : V(StringLessThanOrEqual)
237 :
238 : #define SIMPLIFIED_NUMBER_BINOP_LIST(V) \
239 : V(NumberAdd) \
240 : V(NumberSubtract) \
241 : V(NumberMultiply) \
242 : V(NumberDivide) \
243 : V(NumberModulus) \
244 : V(NumberBitwiseOr) \
245 : V(NumberBitwiseXor) \
246 : V(NumberBitwiseAnd) \
247 : V(NumberShiftLeft) \
248 : V(NumberShiftRight) \
249 : V(NumberShiftRightLogical) \
250 : V(NumberAtan2) \
251 : V(NumberImul) \
252 : V(NumberMax) \
253 : V(NumberMin) \
254 : V(NumberPow)
255 :
256 : #define SIMPLIFIED_SPECULATIVE_NUMBER_BINOP_LIST(V) \
257 : V(SpeculativeNumberAdd) \
258 : V(SpeculativeNumberSubtract) \
259 : V(SpeculativeNumberMultiply) \
260 : V(SpeculativeNumberDivide) \
261 : V(SpeculativeNumberModulus) \
262 : V(SpeculativeNumberBitwiseAnd) \
263 : V(SpeculativeNumberBitwiseOr) \
264 : V(SpeculativeNumberBitwiseXor) \
265 : V(SpeculativeNumberShiftLeft) \
266 : V(SpeculativeNumberShiftRight) \
267 : V(SpeculativeNumberShiftRightLogical)
268 :
269 : #define SIMPLIFIED_NUMBER_UNOP_LIST(V) \
270 : V(NumberAbs) \
271 : V(NumberAcos) \
272 : V(NumberAcosh) \
273 : V(NumberAsin) \
274 : V(NumberAsinh) \
275 : V(NumberAtan) \
276 : V(NumberAtanh) \
277 : V(NumberCbrt) \
278 : V(NumberCeil) \
279 : V(NumberClz32) \
280 : V(NumberCos) \
281 : V(NumberCosh) \
282 : V(NumberExp) \
283 : V(NumberExpm1) \
284 : V(NumberFloor) \
285 : V(NumberFround) \
286 : V(NumberLog) \
287 : V(NumberLog1p) \
288 : V(NumberLog2) \
289 : V(NumberLog10) \
290 : V(NumberRound) \
291 : V(NumberSign) \
292 : V(NumberSin) \
293 : V(NumberSinh) \
294 : V(NumberSqrt) \
295 : V(NumberTan) \
296 : V(NumberTanh) \
297 : V(NumberTrunc) \
298 : V(NumberToBoolean) \
299 : V(NumberToInt32) \
300 : V(NumberToUint32) \
301 : V(NumberToUint8Clamped) \
302 : V(NumberSilenceNaN)
303 :
304 : #define SIMPLIFIED_SPECULATIVE_NUMBER_UNOP_LIST(V) V(SpeculativeToNumber)
305 :
306 : #define SIMPLIFIED_OTHER_OP_LIST(V) \
307 : V(PlainPrimitiveToNumber) \
308 : V(PlainPrimitiveToWord32) \
309 : V(PlainPrimitiveToFloat64) \
310 : V(BooleanNot) \
311 : V(StringCharAt) \
312 : V(StringCharCodeAt) \
313 : V(StringFromCharCode) \
314 : V(StringFromCodePoint) \
315 : V(StringIndexOf) \
316 : V(CheckBounds) \
317 : V(CheckIf) \
318 : V(CheckMaps) \
319 : V(CheckNumber) \
320 : V(CheckInternalizedString) \
321 : V(CheckReceiver) \
322 : V(CheckString) \
323 : V(CheckSmi) \
324 : V(CheckHeapObject) \
325 : V(CheckFloat64Hole) \
326 : V(CheckTaggedHole) \
327 : V(ConvertTaggedHoleToUndefined) \
328 : V(Allocate) \
329 : V(LoadField) \
330 : V(LoadBuffer) \
331 : V(LoadElement) \
332 : V(LoadTypedElement) \
333 : V(StoreField) \
334 : V(StoreBuffer) \
335 : V(StoreElement) \
336 : V(StoreTypedElement) \
337 : V(ObjectIsDetectableCallable) \
338 : V(ObjectIsNaN) \
339 : V(ObjectIsNonCallable) \
340 : V(ObjectIsNumber) \
341 : V(ObjectIsReceiver) \
342 : V(ObjectIsSmi) \
343 : V(ObjectIsString) \
344 : V(ObjectIsSymbol) \
345 : V(ObjectIsUndetectable) \
346 : V(ArgumentsFrame) \
347 : V(ArgumentsLength) \
348 : V(NewUnmappedArgumentsElements) \
349 : V(ArrayBufferWasNeutered) \
350 : V(EnsureWritableFastElements) \
351 : V(MaybeGrowFastElements) \
352 : V(TransitionElementsKind)
353 :
354 : #define SIMPLIFIED_OP_LIST(V) \
355 : SIMPLIFIED_CHANGE_OP_LIST(V) \
356 : SIMPLIFIED_CHECKED_OP_LIST(V) \
357 : SIMPLIFIED_COMPARE_BINOP_LIST(V) \
358 : SIMPLIFIED_NUMBER_BINOP_LIST(V) \
359 : SIMPLIFIED_SPECULATIVE_NUMBER_BINOP_LIST(V) \
360 : SIMPLIFIED_NUMBER_UNOP_LIST(V) \
361 : SIMPLIFIED_SPECULATIVE_NUMBER_UNOP_LIST(V) \
362 : SIMPLIFIED_OTHER_OP_LIST(V)
363 :
364 : // Opcodes for Machine-level operators.
365 : #define MACHINE_COMPARE_BINOP_LIST(V) \
366 : V(Word32Equal) \
367 : V(Word64Equal) \
368 : V(Int32LessThan) \
369 : V(Int32LessThanOrEqual) \
370 : V(Uint32LessThan) \
371 : V(Uint32LessThanOrEqual) \
372 : V(Int64LessThan) \
373 : V(Int64LessThanOrEqual) \
374 : V(Uint64LessThan) \
375 : V(Uint64LessThanOrEqual) \
376 : V(Float32Equal) \
377 : V(Float32LessThan) \
378 : V(Float32LessThanOrEqual) \
379 : V(Float64Equal) \
380 : V(Float64LessThan) \
381 : V(Float64LessThanOrEqual)
382 :
383 : #define MACHINE_UNOP_32_LIST(V) \
384 : V(Word32Clz) \
385 : V(Word32Ctz) \
386 : V(Int32AbsWithOverflow) \
387 : V(Word32ReverseBits) \
388 : V(Word32ReverseBytes)
389 :
390 : #define MACHINE_BINOP_32_LIST(V) \
391 : V(Word32And) \
392 : V(Word32Or) \
393 : V(Word32Xor) \
394 : V(Word32Shl) \
395 : V(Word32Shr) \
396 : V(Word32Sar) \
397 : V(Word32Ror) \
398 : V(Int32Add) \
399 : V(Int32AddWithOverflow) \
400 : V(Int32Sub) \
401 : V(Int32SubWithOverflow) \
402 : V(Int32Mul) \
403 : V(Int32MulWithOverflow) \
404 : V(Int32MulHigh) \
405 : V(Int32Div) \
406 : V(Int32Mod) \
407 : V(Uint32Div) \
408 : V(Uint32Mod) \
409 : V(Uint32MulHigh)
410 :
411 : #define MACHINE_BINOP_64_LIST(V) \
412 : V(Word64And) \
413 : V(Word64Or) \
414 : V(Word64Xor) \
415 : V(Word64Shl) \
416 : V(Word64Shr) \
417 : V(Word64Sar) \
418 : V(Word64Ror) \
419 : V(Int64Add) \
420 : V(Int64AddWithOverflow) \
421 : V(Int64Sub) \
422 : V(Int64SubWithOverflow) \
423 : V(Int64Mul) \
424 : V(Int64Div) \
425 : V(Int64Mod) \
426 : V(Uint64Div) \
427 : V(Uint64Mod)
428 :
429 : #define MACHINE_FLOAT32_UNOP_LIST(V) \
430 : V(Float32Abs) \
431 : V(Float32Neg) \
432 : V(Float32RoundDown) \
433 : V(Float32RoundTiesEven) \
434 : V(Float32RoundTruncate) \
435 : V(Float32RoundUp) \
436 : V(Float32Sqrt)
437 :
438 : #define MACHINE_FLOAT32_BINOP_LIST(V) \
439 : V(Float32Add) \
440 : V(Float32Sub) \
441 : V(Float32Mul) \
442 : V(Float32Div) \
443 : V(Float32Max) \
444 : V(Float32Min)
445 :
446 : #define MACHINE_FLOAT64_UNOP_LIST(V) \
447 : V(Float64Abs) \
448 : V(Float64Acos) \
449 : V(Float64Acosh) \
450 : V(Float64Asin) \
451 : V(Float64Asinh) \
452 : V(Float64Atan) \
453 : V(Float64Atanh) \
454 : V(Float64Cbrt) \
455 : V(Float64Cos) \
456 : V(Float64Cosh) \
457 : V(Float64Exp) \
458 : V(Float64Expm1) \
459 : V(Float64Log) \
460 : V(Float64Log1p) \
461 : V(Float64Log10) \
462 : V(Float64Log2) \
463 : V(Float64Neg) \
464 : V(Float64RoundDown) \
465 : V(Float64RoundTiesAway) \
466 : V(Float64RoundTiesEven) \
467 : V(Float64RoundTruncate) \
468 : V(Float64RoundUp) \
469 : V(Float64Sin) \
470 : V(Float64Sinh) \
471 : V(Float64Sqrt) \
472 : V(Float64Tan) \
473 : V(Float64Tanh)
474 :
475 : #define MACHINE_FLOAT64_BINOP_LIST(V) \
476 : V(Float64Atan2) \
477 : V(Float64Max) \
478 : V(Float64Min) \
479 : V(Float64Add) \
480 : V(Float64Sub) \
481 : V(Float64Mul) \
482 : V(Float64Div) \
483 : V(Float64Mod) \
484 : V(Float64Pow)
485 :
486 : #define MACHINE_OP_LIST(V) \
487 : MACHINE_UNOP_32_LIST(V) \
488 : MACHINE_BINOP_32_LIST(V) \
489 : MACHINE_BINOP_64_LIST(V) \
490 : MACHINE_COMPARE_BINOP_LIST(V) \
491 : MACHINE_FLOAT32_BINOP_LIST(V) \
492 : MACHINE_FLOAT32_UNOP_LIST(V) \
493 : MACHINE_FLOAT64_BINOP_LIST(V) \
494 : MACHINE_FLOAT64_UNOP_LIST(V) \
495 : V(DebugBreak) \
496 : V(Comment) \
497 : V(Load) \
498 : V(Store) \
499 : V(StackSlot) \
500 : V(Word32Popcnt) \
501 : V(Word64Popcnt) \
502 : V(Word64Clz) \
503 : V(Word64Ctz) \
504 : V(Word64ReverseBits) \
505 : V(Word64ReverseBytes) \
506 : V(Int64AbsWithOverflow) \
507 : V(BitcastTaggedToWord) \
508 : V(BitcastWordToTagged) \
509 : V(BitcastWordToTaggedSigned) \
510 : V(TruncateFloat64ToWord32) \
511 : V(ChangeFloat32ToFloat64) \
512 : V(ChangeFloat64ToInt32) \
513 : V(ChangeFloat64ToUint32) \
514 : V(ChangeFloat64ToUint64) \
515 : V(Float64SilenceNaN) \
516 : V(TruncateFloat64ToUint32) \
517 : V(TruncateFloat32ToInt32) \
518 : V(TruncateFloat32ToUint32) \
519 : V(TryTruncateFloat32ToInt64) \
520 : V(TryTruncateFloat64ToInt64) \
521 : V(TryTruncateFloat32ToUint64) \
522 : V(TryTruncateFloat64ToUint64) \
523 : V(ChangeInt32ToFloat64) \
524 : V(ChangeInt32ToInt64) \
525 : V(ChangeUint32ToFloat64) \
526 : V(ChangeUint32ToUint64) \
527 : V(TruncateFloat64ToFloat32) \
528 : V(TruncateInt64ToInt32) \
529 : V(RoundFloat64ToInt32) \
530 : V(RoundInt32ToFloat32) \
531 : V(RoundInt64ToFloat32) \
532 : V(RoundInt64ToFloat64) \
533 : V(RoundUint32ToFloat32) \
534 : V(RoundUint64ToFloat32) \
535 : V(RoundUint64ToFloat64) \
536 : V(BitcastFloat32ToInt32) \
537 : V(BitcastFloat64ToInt64) \
538 : V(BitcastInt32ToFloat32) \
539 : V(BitcastInt64ToFloat64) \
540 : V(Float64ExtractLowWord32) \
541 : V(Float64ExtractHighWord32) \
542 : V(Float64InsertLowWord32) \
543 : V(Float64InsertHighWord32) \
544 : V(LoadStackPointer) \
545 : V(LoadFramePointer) \
546 : V(LoadParentFramePointer) \
547 : V(CheckedLoad) \
548 : V(CheckedStore) \
549 : V(UnalignedLoad) \
550 : V(UnalignedStore) \
551 : V(Int32PairAdd) \
552 : V(Int32PairSub) \
553 : V(Int32PairMul) \
554 : V(Word32PairShl) \
555 : V(Word32PairShr) \
556 : V(Word32PairSar) \
557 : V(ProtectedLoad) \
558 : V(ProtectedStore) \
559 : V(AtomicLoad) \
560 : V(AtomicStore) \
561 : V(AtomicExchange) \
562 : V(AtomicCompareExchange) \
563 : V(AtomicAdd) \
564 : V(AtomicSub) \
565 : V(AtomicAnd) \
566 : V(AtomicOr) \
567 : V(AtomicXor) \
568 : V(UnsafePointerAdd)
569 :
570 : #define MACHINE_SIMD_OP_LIST(V) \
571 : V(F32x4Splat) \
572 : V(F32x4ExtractLane) \
573 : V(F32x4ReplaceLane) \
574 : V(F32x4SConvertI32x4) \
575 : V(F32x4UConvertI32x4) \
576 : V(F32x4Abs) \
577 : V(F32x4Neg) \
578 : V(F32x4RecipApprox) \
579 : V(F32x4RecipSqrtApprox) \
580 : V(F32x4Add) \
581 : V(F32x4AddHoriz) \
582 : V(F32x4Sub) \
583 : V(F32x4Mul) \
584 : V(F32x4Min) \
585 : V(F32x4Max) \
586 : V(F32x4Eq) \
587 : V(F32x4Ne) \
588 : V(F32x4Lt) \
589 : V(F32x4Le) \
590 : V(F32x4Gt) \
591 : V(F32x4Ge) \
592 : V(I32x4Splat) \
593 : V(I32x4ExtractLane) \
594 : V(I32x4ReplaceLane) \
595 : V(I32x4SConvertF32x4) \
596 : V(I32x4SConvertI16x8Low) \
597 : V(I32x4SConvertI16x8High) \
598 : V(I32x4Neg) \
599 : V(I32x4Shl) \
600 : V(I32x4ShrS) \
601 : V(I32x4Add) \
602 : V(I32x4AddHoriz) \
603 : V(I32x4Sub) \
604 : V(I32x4Mul) \
605 : V(I32x4MinS) \
606 : V(I32x4MaxS) \
607 : V(I32x4Eq) \
608 : V(I32x4Ne) \
609 : V(I32x4LtS) \
610 : V(I32x4LeS) \
611 : V(I32x4GtS) \
612 : V(I32x4GeS) \
613 : V(I32x4UConvertF32x4) \
614 : V(I32x4UConvertI16x8Low) \
615 : V(I32x4UConvertI16x8High) \
616 : V(I32x4ShrU) \
617 : V(I32x4MinU) \
618 : V(I32x4MaxU) \
619 : V(I32x4LtU) \
620 : V(I32x4LeU) \
621 : V(I32x4GtU) \
622 : V(I32x4GeU) \
623 : V(I16x8Splat) \
624 : V(I16x8ExtractLane) \
625 : V(I16x8ReplaceLane) \
626 : V(I16x8SConvertI8x16Low) \
627 : V(I16x8SConvertI8x16High) \
628 : V(I16x8Neg) \
629 : V(I16x8Shl) \
630 : V(I16x8ShrS) \
631 : V(I16x8SConvertI32x4) \
632 : V(I16x8Add) \
633 : V(I16x8AddSaturateS) \
634 : V(I16x8AddHoriz) \
635 : V(I16x8Sub) \
636 : V(I16x8SubSaturateS) \
637 : V(I16x8Mul) \
638 : V(I16x8MinS) \
639 : V(I16x8MaxS) \
640 : V(I16x8Eq) \
641 : V(I16x8Ne) \
642 : V(I16x8LtS) \
643 : V(I16x8LeS) \
644 : V(I16x8GtS) \
645 : V(I16x8GeS) \
646 : V(I16x8UConvertI8x16Low) \
647 : V(I16x8UConvertI8x16High) \
648 : V(I16x8ShrU) \
649 : V(I16x8UConvertI32x4) \
650 : V(I16x8AddSaturateU) \
651 : V(I16x8SubSaturateU) \
652 : V(I16x8MinU) \
653 : V(I16x8MaxU) \
654 : V(I16x8LtU) \
655 : V(I16x8LeU) \
656 : V(I16x8GtU) \
657 : V(I16x8GeU) \
658 : V(I8x16Splat) \
659 : V(I8x16ExtractLane) \
660 : V(I8x16ReplaceLane) \
661 : V(I8x16SConvertI16x8) \
662 : V(I8x16Neg) \
663 : V(I8x16Shl) \
664 : V(I8x16ShrS) \
665 : V(I8x16Add) \
666 : V(I8x16AddSaturateS) \
667 : V(I8x16Sub) \
668 : V(I8x16SubSaturateS) \
669 : V(I8x16Mul) \
670 : V(I8x16MinS) \
671 : V(I8x16MaxS) \
672 : V(I8x16Eq) \
673 : V(I8x16Ne) \
674 : V(I8x16LtS) \
675 : V(I8x16LeS) \
676 : V(I8x16GtS) \
677 : V(I8x16GeS) \
678 : V(I8x16UConvertI16x8) \
679 : V(I8x16AddSaturateU) \
680 : V(I8x16SubSaturateU) \
681 : V(I8x16ShrU) \
682 : V(I8x16MinU) \
683 : V(I8x16MaxU) \
684 : V(I8x16LtU) \
685 : V(I8x16LeU) \
686 : V(I8x16GtU) \
687 : V(I8x16GeU) \
688 : V(S128Load) \
689 : V(S128Store) \
690 : V(S128Zero) \
691 : V(S128Not) \
692 : V(S128And) \
693 : V(S128Or) \
694 : V(S128Xor) \
695 : V(S32x4ZipLeft) \
696 : V(S32x4ZipRight) \
697 : V(S32x4UnzipLeft) \
698 : V(S32x4UnzipRight) \
699 : V(S32x4TransposeLeft) \
700 : V(S32x4TransposeRight) \
701 : V(S32x4Select) \
702 : V(S16x8ZipLeft) \
703 : V(S16x8ZipRight) \
704 : V(S16x8UnzipLeft) \
705 : V(S16x8UnzipRight) \
706 : V(S16x8TransposeLeft) \
707 : V(S16x8TransposeRight) \
708 : V(S16x8Select) \
709 : V(S8x16ZipLeft) \
710 : V(S8x16ZipRight) \
711 : V(S8x16UnzipLeft) \
712 : V(S8x16UnzipRight) \
713 : V(S8x16TransposeLeft) \
714 : V(S8x16TransposeRight) \
715 : V(S8x16Select) \
716 : V(S8x16Concat) \
717 : V(S32x2Reverse) \
718 : V(S16x4Reverse) \
719 : V(S16x2Reverse) \
720 : V(S8x8Reverse) \
721 : V(S8x4Reverse) \
722 : V(S8x2Reverse) \
723 : V(S1x4Zero) \
724 : V(S1x4And) \
725 : V(S1x4Or) \
726 : V(S1x4Xor) \
727 : V(S1x4Not) \
728 : V(S1x4AnyTrue) \
729 : V(S1x4AllTrue) \
730 : V(S1x8Zero) \
731 : V(S1x8And) \
732 : V(S1x8Or) \
733 : V(S1x8Xor) \
734 : V(S1x8Not) \
735 : V(S1x8AnyTrue) \
736 : V(S1x8AllTrue) \
737 : V(S1x16Zero) \
738 : V(S1x16And) \
739 : V(S1x16Or) \
740 : V(S1x16Xor) \
741 : V(S1x16Not) \
742 : V(S1x16AnyTrue) \
743 : V(S1x16AllTrue)
744 :
745 : #define VALUE_OP_LIST(V) \
746 : COMMON_OP_LIST(V) \
747 : SIMPLIFIED_OP_LIST(V) \
748 : MACHINE_OP_LIST(V) \
749 : MACHINE_SIMD_OP_LIST(V) \
750 : JS_OP_LIST(V)
751 :
752 : // The combination of all operators at all levels and the common operators.
753 : #define ALL_OP_LIST(V) \
754 : CONTROL_OP_LIST(V) \
755 : VALUE_OP_LIST(V)
756 :
757 : namespace v8 {
758 : namespace internal {
759 : namespace compiler {
760 :
761 : // Declare an enumeration with all the opcodes at all levels so that they
762 : // can be globally, uniquely numbered.
763 : class V8_EXPORT_PRIVATE IrOpcode {
764 : public:
765 : enum Value {
766 : #define DECLARE_OPCODE(x) k##x,
767 : ALL_OP_LIST(DECLARE_OPCODE)
768 : #undef DECLARE_OPCODE
769 : kLast = -1
770 : #define COUNT_OPCODE(x) +1
771 : ALL_OP_LIST(COUNT_OPCODE)
772 : #undef COUNT_OPCODE
773 : };
774 :
775 : // Returns the mnemonic name of an opcode.
776 : static char const* Mnemonic(Value value);
777 :
778 : // Returns true if opcode for common operator.
779 : static bool IsCommonOpcode(Value value) {
780 : return kStart <= value && value <= kDead;
781 : }
782 :
783 : // Returns true if opcode for control operator.
784 : static bool IsControlOpcode(Value value) {
785 : return kStart <= value && value <= kEnd;
786 : }
787 :
788 : // Returns true if opcode for JavaScript operator.
789 : static bool IsJsOpcode(Value value) {
790 879997076 : return kJSEqual <= value && value <= kJSDebugger;
791 : }
792 :
793 : // Returns true if opcode for constant operator.
794 : static bool IsConstantOpcode(Value value) {
795 31802129 : return kInt32Constant <= value && value <= kRelocatableInt64Constant;
796 : }
797 :
798 : static bool IsPhiOpcode(Value value) {
799 249326120 : return value == kPhi || value == kEffectPhi;
800 : }
801 :
802 : static bool IsMergeOpcode(Value value) {
803 219073405 : return value == kMerge || value == kLoop;
804 : }
805 :
806 : static bool IsIfProjectionOpcode(Value value) {
807 : return kIfTrue <= value && value <= kIfDefault;
808 : }
809 :
810 : // Returns true if opcode terminates control flow in a graph (i.e. respective
811 : // nodes are expected to have control uses by the graphs {End} node only).
812 : static bool IsGraphTerminator(Value value) {
813 649881 : return value == kDeoptimize || value == kReturn || value == kTailCall ||
814 649881 : value == kTerminate || value == kThrow;
815 : }
816 :
817 : // Returns true if opcode can be inlined.
818 : static bool IsInlineeOpcode(Value value) {
819 31530655 : return value == kJSConstruct || value == kJSCall;
820 : }
821 :
822 : // Returns true if opcode for comparison operator.
823 : static bool IsComparisonOpcode(Value value) {
824 1093292 : return (kJSEqual <= value && value <= kJSGreaterThanOrEqual) ||
825 1639938 : (kNumberEqual <= value && value <= kStringLessThanOrEqual) ||
826 546646 : (kWord32Equal <= value && value <= kFloat64LessThanOrEqual);
827 : }
828 :
829 : static bool IsContextChainExtendingOpcode(Value value) {
830 13410 : return kJSCreateFunctionContext <= value && value <= kJSCreateScriptContext;
831 : }
832 : };
833 :
834 : V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, IrOpcode::Value);
835 :
836 : } // namespace compiler
837 : } // namespace internal
838 : } // namespace v8
839 :
840 : #endif // V8_COMPILER_OPCODES_H_
|