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

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: 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
Index: src/globals.h
diff --git a/src/globals.h b/src/globals.h
index 83fa2fa720e7b660034d84df15ee9a3c4a2e18cb..52b2913f2c357a3db2833eeb934204d10f80c8ef 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -797,7 +797,8 @@ enum FunctionKind {
kConciseMethod = 4,
kConciseGeneratorMethod = kGeneratorFunction | kConciseMethod,
kDefaultConstructor = 8,
- kSubclassConstructor = 16
+ kBaseConstructor = 16,
+ kSubclassConstructor = 32,
};
@@ -808,6 +809,7 @@ inline bool IsValidFunctionKind(FunctionKind kind) {
kind == FunctionKind::kConciseMethod ||
kind == FunctionKind::kConciseGeneratorMethod ||
kind == FunctionKind::kDefaultConstructor ||
+ kind == FunctionKind::kBaseConstructor ||
kind == FunctionKind::kSubclassConstructor;
}
@@ -835,10 +837,25 @@ inline bool IsDefaultConstructor(FunctionKind kind) {
return kind & FunctionKind::kDefaultConstructor;
}
+
+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/code-stubs.h ('k') | src/messages.js » ('j') | test/mjsunit/mjsunit.status » ('J')

Powered by Google App Engine
This is Rietveld 408576698