Chromium Code Reviews| 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 "include/v8stdint.h" | 8 #include "include/v8stdint.h" |
| 9 | 9 |
| 10 #include "src/base/build_config.h" | 10 #include "src/base/build_config.h" |
| (...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 764 kConciseMethod = 4 | 764 kConciseMethod = 4 |
| 765 }; | 765 }; |
| 766 | 766 |
| 767 | 767 |
| 768 inline bool IsValidFunctionKind(FunctionKind kind) { | 768 inline bool IsValidFunctionKind(FunctionKind kind) { |
| 769 // At the moment these are mutually exclusive but in the future that wont be | 769 // At the moment these are mutually exclusive but in the future that wont be |
| 770 // the case since ES6 allows concise generator methods. | 770 // the case since ES6 allows concise generator methods. |
| 771 return kind == FunctionKind::kNormalFunction || | 771 return kind == FunctionKind::kNormalFunction || |
| 772 kind == FunctionKind::kArrowFunction || | 772 kind == FunctionKind::kArrowFunction || |
| 773 kind == FunctionKind::kGeneratorFunction || | 773 kind == FunctionKind::kGeneratorFunction || |
| 774 kind == FunctionKind::kConciseMethod; | 774 kind == FunctionKind::kConciseMethod || |
| 775 kind == | |
| 776 (FunctionKind::kGeneratorFunction | FunctionKind::kConciseMethod); | |
|
Dmitry Lomov (no reviews)
2014/09/18 07:43:57
The comment in this function is now obsolete.
arv (Not doing code reviews)
2014/09/18 15:59:02
Done.
| |
| 775 } | 777 } |
| 776 | 778 |
| 777 | 779 |
| 778 inline bool IsArrowFunction(FunctionKind kind) { | 780 inline bool IsArrowFunction(FunctionKind kind) { |
| 779 DCHECK(IsValidFunctionKind(kind)); | 781 DCHECK(IsValidFunctionKind(kind)); |
| 780 return kind & FunctionKind::kArrowFunction; | 782 return kind & FunctionKind::kArrowFunction; |
| 781 } | 783 } |
| 782 | 784 |
| 783 | 785 |
| 784 inline bool IsGeneratorFunction(FunctionKind kind) { | 786 inline bool IsGeneratorFunction(FunctionKind kind) { |
| 785 DCHECK(IsValidFunctionKind(kind)); | 787 DCHECK(IsValidFunctionKind(kind)); |
| 786 return kind & FunctionKind::kGeneratorFunction; | 788 return kind & FunctionKind::kGeneratorFunction; |
| 787 } | 789 } |
| 788 | 790 |
| 789 | 791 |
| 790 inline bool IsConciseMethod(FunctionKind kind) { | 792 inline bool IsConciseMethod(FunctionKind kind) { |
| 791 DCHECK(IsValidFunctionKind(kind)); | 793 DCHECK(IsValidFunctionKind(kind)); |
| 792 return kind & FunctionKind::kConciseMethod; | 794 return kind & FunctionKind::kConciseMethod; |
| 793 } | 795 } |
| 794 } } // namespace v8::internal | 796 } } // namespace v8::internal |
| 795 | 797 |
| 796 namespace i = v8::internal; | 798 namespace i = v8::internal; |
| 797 | 799 |
| 798 #endif // V8_GLOBALS_H_ | 800 #endif // V8_GLOBALS_H_ |
| OLD | NEW |