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

Unified Diff: src/globals.h

Issue 700523003: Classes: Partial fix for constructor not calling super (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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 c6ba010fc5ff0851e0de43e0776e59e912b38ca3..f39575ee4b00d0ef689b985e19129e2489783110 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -771,12 +771,15 @@ enum MinusZeroMode {
enum Signedness { kSigned, kUnsigned };
+// TODO(arv): We have 7 options so this will fit in 3 bits instead of 5.
enum FunctionKind {
kNormalFunction = 0,
kArrowFunction = 1,
kGeneratorFunction = 2,
kConciseMethod = 4,
- kConciseGeneratorMethod = kGeneratorFunction | kConciseMethod
+ kConciseGeneratorMethod = kGeneratorFunction | kConciseMethod,
+ kDefaultConstructor = 8,
+ kDefaultConstructorCallSuper = 16
};
@@ -785,7 +788,9 @@ inline bool IsValidFunctionKind(FunctionKind kind) {
kind == FunctionKind::kArrowFunction ||
kind == FunctionKind::kGeneratorFunction ||
kind == FunctionKind::kConciseMethod ||
- kind == FunctionKind::kConciseGeneratorMethod;
+ kind == FunctionKind::kConciseGeneratorMethod ||
+ kind == FunctionKind::kDefaultConstructor ||
+ kind == FunctionKind::kDefaultConstructorCallSuper;
}
@@ -805,6 +810,18 @@ inline bool IsConciseMethod(FunctionKind kind) {
DCHECK(IsValidFunctionKind(kind));
return kind & FunctionKind::kConciseMethod;
}
+
+
+inline bool IsDefaultConstructor(FunctionKind kind) {
+ DCHECK(IsValidFunctionKind(kind));
+ return kind & FunctionKind::kDefaultConstructor;
+}
+
+
+inline bool IsDefaultConstructorCallSuper(FunctionKind kind) {
+ DCHECK(IsValidFunctionKind(kind));
+ return kind & FunctionKind::kDefaultConstructorCallSuper;
+}
} } // namespace v8::internal
namespace i = v8::internal;

Powered by Google App Engine
This is Rietveld 408576698