| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_GLOBALS_H_ | 5 #ifndef V8_GLOBALS_H_ |
| 6 #define V8_GLOBALS_H_ | 6 #define V8_GLOBALS_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 ALWAYS_ALIGN_CSP, | 736 ALWAYS_ALIGN_CSP, |
| 737 COHERENT_CACHE, | 737 COHERENT_CACHE, |
| 738 // PPC | 738 // PPC |
| 739 FPR_GPR_MOV, | 739 FPR_GPR_MOV, |
| 740 LWSYNC, | 740 LWSYNC, |
| 741 ISELECT, | 741 ISELECT, |
| 742 NUMBER_OF_CPU_FEATURES | 742 NUMBER_OF_CPU_FEATURES |
| 743 }; | 743 }; |
| 744 | 744 |
| 745 | 745 |
| 746 // Defines hints about receiver values based on structural knowledge. |
| 747 enum class ConvertReceiverMode : unsigned { |
| 748 kNullOrUndefined, // Guaranteed to be null or undefined. |
| 749 kNotNullOrUndefined, // Guaranteed to never be null or undefined. |
| 750 kAny // No specific knowledge about receiver. |
| 751 }; |
| 752 |
| 753 inline size_t hash_value(ConvertReceiverMode mode) { |
| 754 return bit_cast<unsigned>(mode); |
| 755 } |
| 756 |
| 757 inline std::ostream& operator<<(std::ostream& os, ConvertReceiverMode mode) { |
| 758 switch (mode) { |
| 759 case ConvertReceiverMode::kNullOrUndefined: |
| 760 return os << "NULL_OR_UNDEFINED"; |
| 761 case ConvertReceiverMode::kNotNullOrUndefined: |
| 762 return os << "NOT_NULL_OR_UNDEFINED"; |
| 763 case ConvertReceiverMode::kAny: |
| 764 return os << "ANY"; |
| 765 } |
| 766 UNREACHABLE(); |
| 767 return os; |
| 768 } |
| 769 |
| 770 |
| 746 // Used to specify if a macro instruction must perform a smi check on tagged | 771 // Used to specify if a macro instruction must perform a smi check on tagged |
| 747 // values. | 772 // values. |
| 748 enum SmiCheckType { | 773 enum SmiCheckType { |
| 749 DONT_DO_SMI_CHECK, | 774 DONT_DO_SMI_CHECK, |
| 750 DO_SMI_CHECK | 775 DO_SMI_CHECK |
| 751 }; | 776 }; |
| 752 | 777 |
| 753 | 778 |
| 754 enum ScopeType { | 779 enum ScopeType { |
| 755 EVAL_SCOPE, // The top-level scope for an eval source. | 780 EVAL_SCOPE, // The top-level scope for an eval source. |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1020 kind = static_cast<FunctionKind>(kind | FunctionKind::kInObjectLiteral); | 1045 kind = static_cast<FunctionKind>(kind | FunctionKind::kInObjectLiteral); |
| 1021 DCHECK(IsValidFunctionKind(kind)); | 1046 DCHECK(IsValidFunctionKind(kind)); |
| 1022 return kind; | 1047 return kind; |
| 1023 } | 1048 } |
| 1024 } // namespace internal | 1049 } // namespace internal |
| 1025 } // namespace v8 | 1050 } // namespace v8 |
| 1026 | 1051 |
| 1027 namespace i = v8::internal; | 1052 namespace i = v8::internal; |
| 1028 | 1053 |
| 1029 #endif // V8_GLOBALS_H_ | 1054 #endif // V8_GLOBALS_H_ |
| OLD | NEW |