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 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 kBaseConstructor = 1 << 5, | 936 kBaseConstructor = 1 << 5, |
937 kGetterFunction = 1 << 6, | 937 kGetterFunction = 1 << 6, |
938 kSetterFunction = 1 << 7, | 938 kSetterFunction = 1 << 7, |
939 kAsyncFunction = 1 << 8, | 939 kAsyncFunction = 1 << 8, |
940 kAccessorFunction = kGetterFunction | kSetterFunction, | 940 kAccessorFunction = kGetterFunction | kSetterFunction, |
941 kDefaultBaseConstructor = kDefaultConstructor | kBaseConstructor, | 941 kDefaultBaseConstructor = kDefaultConstructor | kBaseConstructor, |
942 kDefaultSubclassConstructor = kDefaultConstructor | kSubclassConstructor, | 942 kDefaultSubclassConstructor = kDefaultConstructor | kSubclassConstructor, |
943 kClassConstructor = | 943 kClassConstructor = |
944 kBaseConstructor | kSubclassConstructor | kDefaultConstructor, | 944 kBaseConstructor | kSubclassConstructor | kDefaultConstructor, |
945 kAsyncArrowFunction = kArrowFunction | kAsyncFunction, | 945 kAsyncArrowFunction = kArrowFunction | kAsyncFunction, |
946 kAsyncConciseMethod = kAsyncFunction | kConciseMethod | 946 kAsyncConciseMethod = kAsyncFunction | kConciseMethod, |
| 947 kArrowGeneratorFunction = kGeneratorFunction | kArrowFunction |
947 }; | 948 }; |
948 | 949 |
949 inline bool IsValidFunctionKind(FunctionKind kind) { | 950 inline bool IsValidFunctionKind(FunctionKind kind) { |
950 return kind == FunctionKind::kNormalFunction || | 951 return kind == FunctionKind::kNormalFunction || |
951 kind == FunctionKind::kArrowFunction || | 952 kind == FunctionKind::kArrowFunction || |
952 kind == FunctionKind::kGeneratorFunction || | 953 kind == FunctionKind::kGeneratorFunction || |
953 kind == FunctionKind::kConciseMethod || | 954 kind == FunctionKind::kConciseMethod || |
954 kind == FunctionKind::kConciseGeneratorMethod || | 955 kind == FunctionKind::kConciseGeneratorMethod || |
955 kind == FunctionKind::kGetterFunction || | 956 kind == FunctionKind::kGetterFunction || |
956 kind == FunctionKind::kSetterFunction || | 957 kind == FunctionKind::kSetterFunction || |
957 kind == FunctionKind::kAccessorFunction || | 958 kind == FunctionKind::kAccessorFunction || |
958 kind == FunctionKind::kDefaultBaseConstructor || | 959 kind == FunctionKind::kDefaultBaseConstructor || |
959 kind == FunctionKind::kDefaultSubclassConstructor || | 960 kind == FunctionKind::kDefaultSubclassConstructor || |
960 kind == FunctionKind::kBaseConstructor || | 961 kind == FunctionKind::kBaseConstructor || |
961 kind == FunctionKind::kSubclassConstructor || | 962 kind == FunctionKind::kSubclassConstructor || |
962 kind == FunctionKind::kAsyncFunction || | 963 kind == FunctionKind::kAsyncFunction || |
963 kind == FunctionKind::kAsyncArrowFunction || | 964 kind == FunctionKind::kAsyncArrowFunction || |
964 kind == FunctionKind::kAsyncConciseMethod; | 965 kind == FunctionKind::kAsyncConciseMethod || |
| 966 kind == FunctionKind::kArrowGeneratorFunction; |
965 } | 967 } |
966 | 968 |
967 | 969 |
968 inline bool IsArrowFunction(FunctionKind kind) { | 970 inline bool IsArrowFunction(FunctionKind kind) { |
969 DCHECK(IsValidFunctionKind(kind)); | 971 DCHECK(IsValidFunctionKind(kind)); |
970 return kind & FunctionKind::kArrowFunction; | 972 return kind & FunctionKind::kArrowFunction; |
971 } | 973 } |
972 | 974 |
973 | 975 |
974 inline bool IsGeneratorFunction(FunctionKind kind) { | 976 inline bool IsGeneratorFunction(FunctionKind kind) { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1041 return static_cast<uint32_t>(bit_cast<uintptr_t>(address) >> | 1043 return static_cast<uint32_t>(bit_cast<uintptr_t>(address) >> |
1042 kPointerSizeLog2); | 1044 kPointerSizeLog2); |
1043 } | 1045 } |
1044 | 1046 |
1045 } // namespace internal | 1047 } // namespace internal |
1046 } // namespace v8 | 1048 } // namespace v8 |
1047 | 1049 |
1048 namespace i = v8::internal; | 1050 namespace i = v8::internal; |
1049 | 1051 |
1050 #endif // V8_GLOBALS_H_ | 1052 #endif // V8_GLOBALS_H_ |
OLD | NEW |