Index: src/globals.h |
diff --git a/src/globals.h b/src/globals.h |
index 0e30a9468890cbca262bb992a4e5fddf2bba0fa2..7bdb8a4f1e065bd347ff96e5c657dd633bbbc23f 100644 |
--- a/src/globals.h |
+++ b/src/globals.h |
@@ -925,14 +925,15 @@ enum Signedness { kSigned, kUnsigned }; |
enum FunctionKind { |
kNormalFunction = 0, |
kArrowFunction = 1 << 0, |
- kGeneratorFunction = 1 << 1, |
- kConciseMethod = 1 << 2, |
+ kAsyncFunction = 1 << 1, |
+ kGeneratorFunction = 1 << 2, |
+ kConciseMethod = 1 << 3, |
kConciseGeneratorMethod = kGeneratorFunction | kConciseMethod, |
- kAccessorFunction = 1 << 3, |
- kDefaultConstructor = 1 << 4, |
- kSubclassConstructor = 1 << 5, |
- kBaseConstructor = 1 << 6, |
- kInObjectLiteral = 1 << 7, |
+ kAccessorFunction = 1 << 4, |
+ kDefaultConstructor = 1 << 5, |
+ kSubclassConstructor = 1 << 6, |
+ kBaseConstructor = 1 << 7, |
+ kInObjectLiteral = 1 << 8, |
kDefaultBaseConstructor = kDefaultConstructor | kBaseConstructor, |
kDefaultSubclassConstructor = kDefaultConstructor | kSubclassConstructor, |
kConciseMethodInObjectLiteral = kConciseMethod | kInObjectLiteral, |
@@ -945,6 +946,7 @@ enum FunctionKind { |
inline bool IsValidFunctionKind(FunctionKind kind) { |
return kind == FunctionKind::kNormalFunction || |
kind == FunctionKind::kArrowFunction || |
+ kind == FunctionKind::kAsyncFunction || |
kind == FunctionKind::kGeneratorFunction || |
kind == FunctionKind::kConciseMethod || |
kind == FunctionKind::kConciseGeneratorMethod || |
@@ -965,6 +967,12 @@ inline bool IsArrowFunction(FunctionKind kind) { |
} |
+inline bool IsAsyncFunction(FunctionKind kind) { |
+ DCHECK(IsValidFunctionKind(kind)); |
+ return kind & FunctionKind::kAsyncFunction; |
+} |
+ |
+ |
inline bool IsGeneratorFunction(FunctionKind kind) { |
DCHECK(IsValidFunctionKind(kind)); |
return kind & FunctionKind::kGeneratorFunction; |