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

Unified Diff: src/globals.h

Issue 1712833002: Don't reflect ES2015 Function name inference in Function.prototype.toString (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Move bits around to make STATIC_ASSERT happy Created 4 years, 10 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/ast/ast.cc ('k') | src/objects.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 75006ae0ecfdd459c89d9717c5edb0e469e49b38..be401a62eca1750d462d757676e7a6482717ec69 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -973,30 +973,32 @@ enum MinusZeroMode {
enum Signedness { kSigned, kUnsigned };
-
enum FunctionKind {
kNormalFunction = 0,
kArrowFunction = 1 << 0,
kGeneratorFunction = 1 << 1,
kConciseMethod = 1 << 2,
kConciseGeneratorMethod = kGeneratorFunction | kConciseMethod,
- kAccessorFunction = 1 << 3,
- kDefaultConstructor = 1 << 4,
- kSubclassConstructor = 1 << 5,
- kBaseConstructor = 1 << 6,
+ kDefaultConstructor = 1 << 3,
+ kSubclassConstructor = 1 << 4,
+ kBaseConstructor = 1 << 5,
+ kGetterFunction = 1 << 6,
+ kSetterFunction = 1 << 7,
+ kAccessorFunction = kGetterFunction | kSetterFunction,
kDefaultBaseConstructor = kDefaultConstructor | kBaseConstructor,
kDefaultSubclassConstructor = kDefaultConstructor | kSubclassConstructor,
kClassConstructor =
kBaseConstructor | kSubclassConstructor | kDefaultConstructor,
};
-
inline bool IsValidFunctionKind(FunctionKind kind) {
return kind == FunctionKind::kNormalFunction ||
kind == FunctionKind::kArrowFunction ||
kind == FunctionKind::kGeneratorFunction ||
kind == FunctionKind::kConciseMethod ||
kind == FunctionKind::kConciseGeneratorMethod ||
+ kind == FunctionKind::kGetterFunction ||
+ kind == FunctionKind::kSetterFunction ||
kind == FunctionKind::kAccessorFunction ||
kind == FunctionKind::kDefaultBaseConstructor ||
kind == FunctionKind::kDefaultSubclassConstructor ||
@@ -1022,6 +1024,15 @@ inline bool IsConciseMethod(FunctionKind kind) {
return kind & FunctionKind::kConciseMethod;
}
+inline bool IsGetterFunction(FunctionKind kind) {
+ DCHECK(IsValidFunctionKind(kind));
+ return kind & FunctionKind::kGetterFunction;
+}
+
+inline bool IsSetterFunction(FunctionKind kind) {
+ DCHECK(IsValidFunctionKind(kind));
+ return kind & FunctionKind::kSetterFunction;
+}
inline bool IsAccessorFunction(FunctionKind kind) {
DCHECK(IsValidFunctionKind(kind));
« no previous file with comments | « src/ast/ast.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698