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 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 | 905 |
906 kLastVariableMode = DYNAMIC_LOCAL | 906 kLastVariableMode = DYNAMIC_LOCAL |
907 }; | 907 }; |
908 | 908 |
909 inline bool IsDynamicVariableMode(VariableMode mode) { | 909 inline bool IsDynamicVariableMode(VariableMode mode) { |
910 return mode >= DYNAMIC && mode <= DYNAMIC_LOCAL; | 910 return mode >= DYNAMIC && mode <= DYNAMIC_LOCAL; |
911 } | 911 } |
912 | 912 |
913 | 913 |
914 inline bool IsDeclaredVariableMode(VariableMode mode) { | 914 inline bool IsDeclaredVariableMode(VariableMode mode) { |
915 return mode >= VAR && mode <= CONST; | 915 STATIC_ASSERT(VAR == 0); // Implies that mode >= VAR. |
| 916 return mode <= CONST; |
916 } | 917 } |
917 | 918 |
918 | 919 |
919 inline bool IsLexicalVariableMode(VariableMode mode) { | 920 inline bool IsLexicalVariableMode(VariableMode mode) { |
920 return mode >= LET && mode <= CONST; | 921 return mode >= LET && mode <= CONST; |
921 } | 922 } |
922 | 923 |
923 | 924 |
924 inline bool IsImmutableVariableMode(VariableMode mode) { | 925 inline bool IsImmutableVariableMode(VariableMode mode) { |
925 return mode == CONST || mode == CONST_LEGACY; | 926 return mode == CONST || mode == CONST_LEGACY; |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1154 public: | 1155 public: |
1155 enum { kNone = 0x00, kSignedSmall = 0x01, kNumber = 0x3, kAny = 0x7 }; | 1156 enum { kNone = 0x00, kSignedSmall = 0x01, kNumber = 0x3, kAny = 0x7 }; |
1156 }; | 1157 }; |
1157 | 1158 |
1158 } // namespace internal | 1159 } // namespace internal |
1159 } // namespace v8 | 1160 } // namespace v8 |
1160 | 1161 |
1161 namespace i = v8::internal; | 1162 namespace i = v8::internal; |
1162 | 1163 |
1163 #endif // V8_GLOBALS_H_ | 1164 #endif // V8_GLOBALS_H_ |
OLD | NEW |