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