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

Unified Diff: src/globals.h

Issue 885643004: new classes: assert that constructors are not callable and rewrite 'return;' (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix bit width 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/compiler/linkage.cc ('k') | src/messages.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 3f2c33593b012acabb7c9102cf269f51a26ee55d..0248bb1600d8e8487fa2d1ffae2f9fba33a04013 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -820,7 +820,8 @@ enum FunctionKind {
kConciseGeneratorMethod = kGeneratorFunction | kConciseMethod,
kAccessorFunction = 1 << 3,
kDefaultConstructor = 1 << 4,
- kSubclassConstructor = 1 << 5
+ kSubclassConstructor = 1 << 5,
+ kBaseConstructor = 1 << 6,
};
@@ -832,6 +833,7 @@ inline bool IsValidFunctionKind(FunctionKind kind) {
kind == FunctionKind::kConciseGeneratorMethod ||
kind == FunctionKind::kAccessorFunction ||
kind == FunctionKind::kDefaultConstructor ||
+ kind == FunctionKind::kBaseConstructor ||
kind == FunctionKind::kSubclassConstructor;
}
@@ -866,10 +868,24 @@ inline bool IsDefaultConstructor(FunctionKind kind) {
}
+inline bool IsBaseConstructor(FunctionKind kind) {
+ DCHECK(IsValidFunctionKind(kind));
+ return kind & FunctionKind::kBaseConstructor;
+}
+
+
inline bool IsSubclassConstructor(FunctionKind kind) {
DCHECK(IsValidFunctionKind(kind));
return kind & FunctionKind::kSubclassConstructor;
}
+
+
+inline bool IsConstructor(FunctionKind kind) {
+ DCHECK(IsValidFunctionKind(kind));
+ return kind &
+ (FunctionKind::kBaseConstructor | FunctionKind::kSubclassConstructor |
+ FunctionKind::kDefaultConstructor);
+}
} } // namespace v8::internal
namespace i = v8::internal;
« no previous file with comments | « src/compiler/linkage.cc ('k') | src/messages.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698