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

Unified Diff: src/globals.h

Issue 883073008: Accessor functions should have no prototype property (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use bitshift Created 5 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/contexts.h ('k') | src/hydrogen-instructions.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 761a85d011f10a43c15d0e3ef2bd1ba5d38c4eb0..3f2c33593b012acabb7c9102cf269f51a26ee55d 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -814,12 +814,13 @@ enum Signedness { kSigned, kUnsigned };
enum FunctionKind {
kNormalFunction = 0,
- kArrowFunction = 1,
- kGeneratorFunction = 2,
- kConciseMethod = 4,
+ kArrowFunction = 1 << 0,
+ kGeneratorFunction = 1 << 1,
+ kConciseMethod = 1 << 2,
kConciseGeneratorMethod = kGeneratorFunction | kConciseMethod,
- kDefaultConstructor = 8,
- kSubclassConstructor = 16
+ kAccessorFunction = 1 << 3,
+ kDefaultConstructor = 1 << 4,
+ kSubclassConstructor = 1 << 5
};
@@ -829,6 +830,7 @@ inline bool IsValidFunctionKind(FunctionKind kind) {
kind == FunctionKind::kGeneratorFunction ||
kind == FunctionKind::kConciseMethod ||
kind == FunctionKind::kConciseGeneratorMethod ||
+ kind == FunctionKind::kAccessorFunction ||
kind == FunctionKind::kDefaultConstructor ||
kind == FunctionKind::kSubclassConstructor;
}
@@ -852,11 +854,18 @@ inline bool IsConciseMethod(FunctionKind kind) {
}
+inline bool IsAccessorFunction(FunctionKind kind) {
+ DCHECK(IsValidFunctionKind(kind));
+ return kind & FunctionKind::kAccessorFunction;
+}
+
+
inline bool IsDefaultConstructor(FunctionKind kind) {
DCHECK(IsValidFunctionKind(kind));
return kind & FunctionKind::kDefaultConstructor;
}
+
inline bool IsSubclassConstructor(FunctionKind kind) {
DCHECK(IsValidFunctionKind(kind));
return kind & FunctionKind::kSubclassConstructor;
« no previous file with comments | « src/contexts.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698