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

Side by Side Diff: src/globals.h

Issue 2375793002: Reland: [modules] Properly initialize declared variables. (Closed)
Patch Set: Update CompilerHints. Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « src/contexts.h ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_GLOBALS_H_ 5 #ifndef V8_GLOBALS_H_
6 #define V8_GLOBALS_H_ 6 #define V8_GLOBALS_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 kArrowFunction = 1 << 0, 1071 kArrowFunction = 1 << 0,
1072 kGeneratorFunction = 1 << 1, 1072 kGeneratorFunction = 1 << 1,
1073 kConciseMethod = 1 << 2, 1073 kConciseMethod = 1 << 2,
1074 kConciseGeneratorMethod = kGeneratorFunction | kConciseMethod, 1074 kConciseGeneratorMethod = kGeneratorFunction | kConciseMethod,
1075 kDefaultConstructor = 1 << 3, 1075 kDefaultConstructor = 1 << 3,
1076 kSubclassConstructor = 1 << 4, 1076 kSubclassConstructor = 1 << 4,
1077 kBaseConstructor = 1 << 5, 1077 kBaseConstructor = 1 << 5,
1078 kGetterFunction = 1 << 6, 1078 kGetterFunction = 1 << 6,
1079 kSetterFunction = 1 << 7, 1079 kSetterFunction = 1 << 7,
1080 kAsyncFunction = 1 << 8, 1080 kAsyncFunction = 1 << 8,
1081 kModule = 1 << 9,
1081 kAccessorFunction = kGetterFunction | kSetterFunction, 1082 kAccessorFunction = kGetterFunction | kSetterFunction,
1082 kDefaultBaseConstructor = kDefaultConstructor | kBaseConstructor, 1083 kDefaultBaseConstructor = kDefaultConstructor | kBaseConstructor,
1083 kDefaultSubclassConstructor = kDefaultConstructor | kSubclassConstructor, 1084 kDefaultSubclassConstructor = kDefaultConstructor | kSubclassConstructor,
1084 kClassConstructor = 1085 kClassConstructor =
1085 kBaseConstructor | kSubclassConstructor | kDefaultConstructor, 1086 kBaseConstructor | kSubclassConstructor | kDefaultConstructor,
1086 kAsyncArrowFunction = kArrowFunction | kAsyncFunction, 1087 kAsyncArrowFunction = kArrowFunction | kAsyncFunction,
1087 kAsyncConciseMethod = kAsyncFunction | kConciseMethod 1088 kAsyncConciseMethod = kAsyncFunction | kConciseMethod
1088 }; 1089 };
1089 1090
1090 inline bool IsValidFunctionKind(FunctionKind kind) { 1091 inline bool IsValidFunctionKind(FunctionKind kind) {
1091 return kind == FunctionKind::kNormalFunction || 1092 return kind == FunctionKind::kNormalFunction ||
1092 kind == FunctionKind::kArrowFunction || 1093 kind == FunctionKind::kArrowFunction ||
1093 kind == FunctionKind::kGeneratorFunction || 1094 kind == FunctionKind::kGeneratorFunction ||
1095 kind == FunctionKind::kModule ||
1094 kind == FunctionKind::kConciseMethod || 1096 kind == FunctionKind::kConciseMethod ||
1095 kind == FunctionKind::kConciseGeneratorMethod || 1097 kind == FunctionKind::kConciseGeneratorMethod ||
1096 kind == FunctionKind::kGetterFunction || 1098 kind == FunctionKind::kGetterFunction ||
1097 kind == FunctionKind::kSetterFunction || 1099 kind == FunctionKind::kSetterFunction ||
1098 kind == FunctionKind::kAccessorFunction || 1100 kind == FunctionKind::kAccessorFunction ||
1099 kind == FunctionKind::kDefaultBaseConstructor || 1101 kind == FunctionKind::kDefaultBaseConstructor ||
1100 kind == FunctionKind::kDefaultSubclassConstructor || 1102 kind == FunctionKind::kDefaultSubclassConstructor ||
1101 kind == FunctionKind::kBaseConstructor || 1103 kind == FunctionKind::kBaseConstructor ||
1102 kind == FunctionKind::kSubclassConstructor || 1104 kind == FunctionKind::kSubclassConstructor ||
1103 kind == FunctionKind::kAsyncFunction || 1105 kind == FunctionKind::kAsyncFunction ||
1104 kind == FunctionKind::kAsyncArrowFunction || 1106 kind == FunctionKind::kAsyncArrowFunction ||
1105 kind == FunctionKind::kAsyncConciseMethod; 1107 kind == FunctionKind::kAsyncConciseMethod;
1106 } 1108 }
1107 1109
1108 1110
1109 inline bool IsArrowFunction(FunctionKind kind) { 1111 inline bool IsArrowFunction(FunctionKind kind) {
1110 DCHECK(IsValidFunctionKind(kind)); 1112 DCHECK(IsValidFunctionKind(kind));
1111 return kind & FunctionKind::kArrowFunction; 1113 return kind & FunctionKind::kArrowFunction;
1112 } 1114 }
1113 1115
1114 1116
1115 inline bool IsGeneratorFunction(FunctionKind kind) { 1117 inline bool IsGeneratorFunction(FunctionKind kind) {
1116 DCHECK(IsValidFunctionKind(kind)); 1118 DCHECK(IsValidFunctionKind(kind));
1117 return kind & FunctionKind::kGeneratorFunction; 1119 return kind & FunctionKind::kGeneratorFunction;
1118 } 1120 }
1119 1121
1122 inline bool IsModule(FunctionKind kind) {
1123 DCHECK(IsValidFunctionKind(kind));
1124 return kind & FunctionKind::kModule;
1125 }
1126
1120 inline bool IsAsyncFunction(FunctionKind kind) { 1127 inline bool IsAsyncFunction(FunctionKind kind) {
1121 DCHECK(IsValidFunctionKind(kind)); 1128 DCHECK(IsValidFunctionKind(kind));
1122 return kind & FunctionKind::kAsyncFunction; 1129 return kind & FunctionKind::kAsyncFunction;
1123 } 1130 }
1124 1131
1125 inline bool IsResumableFunction(FunctionKind kind) { 1132 inline bool IsResumableFunction(FunctionKind kind) {
1126 return IsGeneratorFunction(kind) || IsAsyncFunction(kind); 1133 return IsGeneratorFunction(kind) || IsAsyncFunction(kind) || IsModule(kind);
1127 } 1134 }
1128 1135
1129 inline bool IsConciseMethod(FunctionKind kind) { 1136 inline bool IsConciseMethod(FunctionKind kind) {
1130 DCHECK(IsValidFunctionKind(kind)); 1137 DCHECK(IsValidFunctionKind(kind));
1131 return kind & FunctionKind::kConciseMethod; 1138 return kind & FunctionKind::kConciseMethod;
1132 } 1139 }
1133 1140
1134 inline bool IsGetterFunction(FunctionKind kind) { 1141 inline bool IsGetterFunction(FunctionKind kind) {
1135 DCHECK(IsValidFunctionKind(kind)); 1142 DCHECK(IsValidFunctionKind(kind));
1136 return kind & FunctionKind::kGetterFunction; 1143 return kind & FunctionKind::kGetterFunction;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 LIVE_EDIT_FRAME_DROPPED_IN_RETURN_CALL, 1237 LIVE_EDIT_FRAME_DROPPED_IN_RETURN_CALL,
1231 LIVE_EDIT_CURRENTLY_SET_MODE 1238 LIVE_EDIT_CURRENTLY_SET_MODE
1232 }; 1239 };
1233 1240
1234 } // namespace internal 1241 } // namespace internal
1235 } // namespace v8 1242 } // namespace v8
1236 1243
1237 namespace i = v8::internal; 1244 namespace i = v8::internal;
1238 1245
1239 #endif // V8_GLOBALS_H_ 1246 #endif // V8_GLOBALS_H_
OLDNEW
« no previous file with comments | « src/contexts.h ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698