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

Unified Diff: src/globals.h

Issue 1423663006: [es7] Implement async functions parsing Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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/js/v8natives.js » ('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 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;
« no previous file with comments | « src/flag-definitions.h ('k') | src/js/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698