Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Unified Diff: src/globals.h

Issue 1841543003: [esnext] implement frontend changes for async/await proposal (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Uncomment that test Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/flag-definitions.h ('k') | src/messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/globals.h
diff --git a/src/globals.h b/src/globals.h
index c7e59198b10f805765991ec5320adce8b792eda0..777f4297cb903fe950a76f8ccf8087fefb1cf56c 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -963,11 +963,14 @@ enum FunctionKind {
kBaseConstructor = 1 << 5,
kGetterFunction = 1 << 6,
kSetterFunction = 1 << 7,
+ kAsyncFunction = 1 << 8,
kAccessorFunction = kGetterFunction | kSetterFunction,
kDefaultBaseConstructor = kDefaultConstructor | kBaseConstructor,
kDefaultSubclassConstructor = kDefaultConstructor | kSubclassConstructor,
kClassConstructor =
kBaseConstructor | kSubclassConstructor | kDefaultConstructor,
+ kAsyncArrowFunction = kArrowFunction | kAsyncFunction,
+ kAsyncConciseMethod = kAsyncFunction | kConciseMethod
};
inline bool IsValidFunctionKind(FunctionKind kind) {
@@ -982,7 +985,10 @@ inline bool IsValidFunctionKind(FunctionKind kind) {
kind == FunctionKind::kDefaultBaseConstructor ||
kind == FunctionKind::kDefaultSubclassConstructor ||
kind == FunctionKind::kBaseConstructor ||
- kind == FunctionKind::kSubclassConstructor;
+ kind == FunctionKind::kSubclassConstructor ||
+ kind == FunctionKind::kAsyncFunction ||
+ kind == FunctionKind::kAsyncArrowFunction ||
+ kind == FunctionKind::kAsyncConciseMethod;
}
@@ -997,6 +1003,10 @@ inline bool IsGeneratorFunction(FunctionKind kind) {
return kind & FunctionKind::kGeneratorFunction;
}
+inline bool IsAsyncFunction(FunctionKind kind) {
+ DCHECK(IsValidFunctionKind(kind));
+ return kind & FunctionKind::kAsyncFunction;
+}
inline bool IsConciseMethod(FunctionKind kind) {
DCHECK(IsValidFunctionKind(kind));
« no previous file with comments | « src/flag-definitions.h ('k') | src/messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698