| 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 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 | 816 |
| 817 enum FunctionKind { | 817 enum FunctionKind { |
| 818 kNormalFunction = 0, | 818 kNormalFunction = 0, |
| 819 kArrowFunction = 1 << 0, | 819 kArrowFunction = 1 << 0, |
| 820 kGeneratorFunction = 1 << 1, | 820 kGeneratorFunction = 1 << 1, |
| 821 kConciseMethod = 1 << 2, | 821 kConciseMethod = 1 << 2, |
| 822 kConciseGeneratorMethod = kGeneratorFunction | kConciseMethod, | 822 kConciseGeneratorMethod = kGeneratorFunction | kConciseMethod, |
| 823 kAccessorFunction = 1 << 3, | 823 kAccessorFunction = 1 << 3, |
| 824 kDefaultConstructor = 1 << 4, | 824 kDefaultConstructor = 1 << 4, |
| 825 kSubclassConstructor = 1 << 5, | 825 kSubclassConstructor = 1 << 5, |
| 826 kBaseConstructor = 1 << 6 | 826 kBaseConstructor = 1 << 6, |
| 827 kDefaultBaseConstructor = kDefaultConstructor | kBaseConstructor, |
| 828 kDefaultSubclassConstructor = kDefaultConstructor | kSubclassConstructor, |
| 827 }; | 829 }; |
| 828 | 830 |
| 829 | 831 |
| 830 inline bool IsValidFunctionKind(FunctionKind kind) { | 832 inline bool IsValidFunctionKind(FunctionKind kind) { |
| 831 return kind == FunctionKind::kNormalFunction || | 833 return kind == FunctionKind::kNormalFunction || |
| 832 kind == FunctionKind::kArrowFunction || | 834 kind == FunctionKind::kArrowFunction || |
| 833 kind == FunctionKind::kGeneratorFunction || | 835 kind == FunctionKind::kGeneratorFunction || |
| 834 kind == FunctionKind::kConciseMethod || | 836 kind == FunctionKind::kConciseMethod || |
| 835 kind == FunctionKind::kConciseGeneratorMethod || | 837 kind == FunctionKind::kConciseGeneratorMethod || |
| 836 kind == FunctionKind::kAccessorFunction || | 838 kind == FunctionKind::kAccessorFunction || |
| 837 kind == FunctionKind::kDefaultConstructor || | 839 kind == FunctionKind::kDefaultBaseConstructor || |
| 840 kind == FunctionKind::kDefaultSubclassConstructor || |
| 838 kind == FunctionKind::kBaseConstructor || | 841 kind == FunctionKind::kBaseConstructor || |
| 839 kind == FunctionKind::kSubclassConstructor; | 842 kind == FunctionKind::kSubclassConstructor; |
| 840 } | 843 } |
| 841 | 844 |
| 842 | 845 |
| 843 inline bool IsArrowFunction(FunctionKind kind) { | 846 inline bool IsArrowFunction(FunctionKind kind) { |
| 844 DCHECK(IsValidFunctionKind(kind)); | 847 DCHECK(IsValidFunctionKind(kind)); |
| 845 return kind & FunctionKind::kArrowFunction; | 848 return kind & FunctionKind::kArrowFunction; |
| 846 } | 849 } |
| 847 | 850 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 DCHECK(IsValidFunctionKind(kind)); | 889 DCHECK(IsValidFunctionKind(kind)); |
| 887 return kind & | 890 return kind & |
| 888 (FunctionKind::kBaseConstructor | FunctionKind::kSubclassConstructor | | 891 (FunctionKind::kBaseConstructor | FunctionKind::kSubclassConstructor | |
| 889 FunctionKind::kDefaultConstructor); | 892 FunctionKind::kDefaultConstructor); |
| 890 } | 893 } |
| 891 } } // namespace v8::internal | 894 } } // namespace v8::internal |
| 892 | 895 |
| 893 namespace i = v8::internal; | 896 namespace i = v8::internal; |
| 894 | 897 |
| 895 #endif // V8_GLOBALS_H_ | 898 #endif // V8_GLOBALS_H_ |
| OLD | NEW |