OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_COMPILER_OPCODES_H_ | 5 #ifndef V8_COMPILER_OPCODES_H_ |
6 #define V8_COMPILER_OPCODES_H_ | 6 #define V8_COMPILER_OPCODES_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 // Opcodes for control operators. | 10 // Opcodes for control operators. |
11 #define CONTROL_OP_LIST(V) \ | 11 #define CONTROL_OP_LIST(V) \ |
12 V(Start) \ | 12 V(Start) \ |
13 V(Dead) \ | |
14 V(Loop) \ | 13 V(Loop) \ |
15 V(Branch) \ | 14 V(Branch) \ |
16 V(Switch) \ | 15 V(Switch) \ |
17 V(IfTrue) \ | 16 V(IfTrue) \ |
18 V(IfFalse) \ | 17 V(IfFalse) \ |
19 V(IfSuccess) \ | 18 V(IfSuccess) \ |
20 V(IfException) \ | 19 V(IfException) \ |
21 V(IfValue) \ | 20 V(IfValue) \ |
22 V(IfDefault) \ | 21 V(IfDefault) \ |
23 V(Merge) \ | 22 V(Merge) \ |
24 V(Deoptimize) \ | 23 V(Deoptimize) \ |
25 V(Return) \ | 24 V(Return) \ |
26 V(TailCall) \ | 25 V(TailCall) \ |
27 V(Terminate) \ | 26 V(Terminate) \ |
28 V(OsrNormalEntry) \ | 27 V(OsrNormalEntry) \ |
29 V(OsrLoopEntry) \ | 28 V(OsrLoopEntry) \ |
| 29 V(DeadControl) \ |
30 V(Throw) \ | 30 V(Throw) \ |
31 V(End) | 31 V(End) |
32 | 32 |
33 // Opcodes for constant operators. | 33 // Opcodes for constant operators. |
34 #define CONSTANT_OP_LIST(V) \ | 34 #define CONSTANT_OP_LIST(V) \ |
35 V(Int32Constant) \ | 35 V(Int32Constant) \ |
36 V(Int64Constant) \ | 36 V(Int64Constant) \ |
37 V(Float32Constant) \ | 37 V(Float32Constant) \ |
38 V(Float64Constant) \ | 38 V(Float64Constant) \ |
39 V(ExternalConstant) \ | 39 V(ExternalConstant) \ |
(...skipping 10 matching lines...) Expand all Loading... |
50 V(FrameState) \ | 50 V(FrameState) \ |
51 V(StateValues) \ | 51 V(StateValues) \ |
52 V(TypedStateValues) \ | 52 V(TypedStateValues) \ |
53 V(Call) \ | 53 V(Call) \ |
54 V(Parameter) \ | 54 V(Parameter) \ |
55 V(OsrValue) \ | 55 V(OsrValue) \ |
56 V(Projection) | 56 V(Projection) |
57 | 57 |
58 #define COMMON_OP_LIST(V) \ | 58 #define COMMON_OP_LIST(V) \ |
59 CONSTANT_OP_LIST(V) \ | 59 CONSTANT_OP_LIST(V) \ |
60 INNER_OP_LIST(V) | 60 INNER_OP_LIST(V) \ |
| 61 V(DeadEffect) \ |
| 62 V(DeadValue) |
| 63 |
61 | 64 |
62 // Opcodes for JavaScript operators. | 65 // Opcodes for JavaScript operators. |
63 #define JS_COMPARE_BINOP_LIST(V) \ | 66 #define JS_COMPARE_BINOP_LIST(V) \ |
64 V(JSEqual) \ | 67 V(JSEqual) \ |
65 V(JSNotEqual) \ | 68 V(JSNotEqual) \ |
66 V(JSStrictEqual) \ | 69 V(JSStrictEqual) \ |
67 V(JSStrictNotEqual) \ | 70 V(JSStrictNotEqual) \ |
68 V(JSLessThan) \ | 71 V(JSLessThan) \ |
69 V(JSGreaterThan) \ | 72 V(JSGreaterThan) \ |
70 V(JSLessThanOrEqual) \ | 73 V(JSLessThanOrEqual) \ |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 #define COUNT_OPCODE(x) +1 | 314 #define COUNT_OPCODE(x) +1 |
312 ALL_OP_LIST(COUNT_OPCODE) | 315 ALL_OP_LIST(COUNT_OPCODE) |
313 #undef COUNT_OPCODE | 316 #undef COUNT_OPCODE |
314 }; | 317 }; |
315 | 318 |
316 // Returns the mnemonic name of an opcode. | 319 // Returns the mnemonic name of an opcode. |
317 static char const* Mnemonic(Value value); | 320 static char const* Mnemonic(Value value); |
318 | 321 |
319 // Returns true if opcode for common operator. | 322 // Returns true if opcode for common operator. |
320 static bool IsCommonOpcode(Value value) { | 323 static bool IsCommonOpcode(Value value) { |
321 return kStart <= value && value <= kProjection; | 324 return kStart <= value && value <= kDeadValue; |
322 } | 325 } |
323 | 326 |
324 // Returns true if opcode for control operator. | 327 // Returns true if opcode for control operator. |
325 static bool IsControlOpcode(Value value) { | 328 static bool IsControlOpcode(Value value) { |
326 return kStart <= value && value <= kEnd; | 329 return kStart <= value && value <= kEnd; |
327 } | 330 } |
328 | 331 |
329 // Returns true if opcode for JavaScript operator. | 332 // Returns true if opcode for JavaScript operator. |
330 static bool IsJsOpcode(Value value) { | 333 static bool IsJsOpcode(Value value) { |
331 return kJSEqual <= value && value <= kJSStackCheck; | 334 return kJSEqual <= value && value <= kJSStackCheck; |
(...skipping 24 matching lines...) Expand all Loading... |
356 } | 359 } |
357 }; | 360 }; |
358 | 361 |
359 std::ostream& operator<<(std::ostream&, IrOpcode::Value); | 362 std::ostream& operator<<(std::ostream&, IrOpcode::Value); |
360 | 363 |
361 } // namespace compiler | 364 } // namespace compiler |
362 } // namespace internal | 365 } // namespace internal |
363 } // namespace v8 | 366 } // namespace v8 |
364 | 367 |
365 #endif // V8_COMPILER_OPCODES_H_ | 368 #endif // V8_COMPILER_OPCODES_H_ |
OLD | NEW |