| 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 #include "src/globals.h" |
| 11 |
| 10 // Opcodes for control operators. | 12 // Opcodes for control operators. |
| 11 #define CONTROL_OP_LIST(V) \ | 13 #define CONTROL_OP_LIST(V) \ |
| 12 V(Start) \ | 14 V(Start) \ |
| 13 V(Loop) \ | 15 V(Loop) \ |
| 14 V(Branch) \ | 16 V(Branch) \ |
| 15 V(Switch) \ | 17 V(Switch) \ |
| 16 V(IfTrue) \ | 18 V(IfTrue) \ |
| 17 V(IfFalse) \ | 19 V(IfFalse) \ |
| 18 V(IfSuccess) \ | 20 V(IfSuccess) \ |
| 19 V(IfException) \ | 21 V(IfException) \ |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 #define ALL_OP_LIST(V) \ | 719 #define ALL_OP_LIST(V) \ |
| 718 CONTROL_OP_LIST(V) \ | 720 CONTROL_OP_LIST(V) \ |
| 719 VALUE_OP_LIST(V) | 721 VALUE_OP_LIST(V) |
| 720 | 722 |
| 721 namespace v8 { | 723 namespace v8 { |
| 722 namespace internal { | 724 namespace internal { |
| 723 namespace compiler { | 725 namespace compiler { |
| 724 | 726 |
| 725 // Declare an enumeration with all the opcodes at all levels so that they | 727 // Declare an enumeration with all the opcodes at all levels so that they |
| 726 // can be globally, uniquely numbered. | 728 // can be globally, uniquely numbered. |
| 727 class IrOpcode { | 729 class V8_EXPORT_PRIVATE IrOpcode { |
| 728 public: | 730 public: |
| 729 enum Value { | 731 enum Value { |
| 730 #define DECLARE_OPCODE(x) k##x, | 732 #define DECLARE_OPCODE(x) k##x, |
| 731 ALL_OP_LIST(DECLARE_OPCODE) | 733 ALL_OP_LIST(DECLARE_OPCODE) |
| 732 #undef DECLARE_OPCODE | 734 #undef DECLARE_OPCODE |
| 733 kLast = -1 | 735 kLast = -1 |
| 734 #define COUNT_OPCODE(x) +1 | 736 #define COUNT_OPCODE(x) +1 |
| 735 ALL_OP_LIST(COUNT_OPCODE) | 737 ALL_OP_LIST(COUNT_OPCODE) |
| 736 #undef COUNT_OPCODE | 738 #undef COUNT_OPCODE |
| 737 }; | 739 }; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 } | 779 } |
| 778 | 780 |
| 779 // Returns true if opcode for comparison operator. | 781 // Returns true if opcode for comparison operator. |
| 780 static bool IsComparisonOpcode(Value value) { | 782 static bool IsComparisonOpcode(Value value) { |
| 781 return (kJSEqual <= value && value <= kJSGreaterThanOrEqual) || | 783 return (kJSEqual <= value && value <= kJSGreaterThanOrEqual) || |
| 782 (kNumberEqual <= value && value <= kStringLessThanOrEqual) || | 784 (kNumberEqual <= value && value <= kStringLessThanOrEqual) || |
| 783 (kWord32Equal <= value && value <= kFloat64LessThanOrEqual); | 785 (kWord32Equal <= value && value <= kFloat64LessThanOrEqual); |
| 784 } | 786 } |
| 785 }; | 787 }; |
| 786 | 788 |
| 787 std::ostream& operator<<(std::ostream&, IrOpcode::Value); | 789 V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, IrOpcode::Value); |
| 788 | 790 |
| 789 } // namespace compiler | 791 } // namespace compiler |
| 790 } // namespace internal | 792 } // namespace internal |
| 791 } // namespace v8 | 793 } // namespace v8 |
| 792 | 794 |
| 793 #endif // V8_COMPILER_OPCODES_H_ | 795 #endif // V8_COMPILER_OPCODES_H_ |
| OLD | NEW |