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

Side by Side Diff: src/globals.h

Issue 1895603002: [esnext] prototype runtime implementation for async functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@AsyncFunction
Patch Set: properly rebase Created 4 years, 7 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
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 952 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 kBaseConstructor = 1 << 5, 963 kBaseConstructor = 1 << 5,
964 kGetterFunction = 1 << 6, 964 kGetterFunction = 1 << 6,
965 kSetterFunction = 1 << 7, 965 kSetterFunction = 1 << 7,
966 kAsyncFunction = 1 << 8, 966 kAsyncFunction = 1 << 8,
967 kAccessorFunction = kGetterFunction | kSetterFunction, 967 kAccessorFunction = kGetterFunction | kSetterFunction,
968 kDefaultBaseConstructor = kDefaultConstructor | kBaseConstructor, 968 kDefaultBaseConstructor = kDefaultConstructor | kBaseConstructor,
969 kDefaultSubclassConstructor = kDefaultConstructor | kSubclassConstructor, 969 kDefaultSubclassConstructor = kDefaultConstructor | kSubclassConstructor,
970 kClassConstructor = 970 kClassConstructor =
971 kBaseConstructor | kSubclassConstructor | kDefaultConstructor, 971 kBaseConstructor | kSubclassConstructor | kDefaultConstructor,
972 kAsyncArrowFunction = kArrowFunction | kAsyncFunction, 972 kAsyncArrowFunction = kArrowFunction | kAsyncFunction,
973 kAsyncConciseMethod = kAsyncFunction | kConciseMethod 973 kAsyncConciseMethod = kAsyncFunction | kConciseMethod,
974 kArrowGeneratorFunction = kGeneratorFunction | kArrowFunction
974 }; 975 };
975 976
976 inline bool IsValidFunctionKind(FunctionKind kind) { 977 inline bool IsValidFunctionKind(FunctionKind kind) {
977 return kind == FunctionKind::kNormalFunction || 978 return kind == FunctionKind::kNormalFunction ||
978 kind == FunctionKind::kArrowFunction || 979 kind == FunctionKind::kArrowFunction ||
979 kind == FunctionKind::kGeneratorFunction || 980 kind == FunctionKind::kGeneratorFunction ||
980 kind == FunctionKind::kConciseMethod || 981 kind == FunctionKind::kConciseMethod ||
981 kind == FunctionKind::kConciseGeneratorMethod || 982 kind == FunctionKind::kConciseGeneratorMethod ||
982 kind == FunctionKind::kGetterFunction || 983 kind == FunctionKind::kGetterFunction ||
983 kind == FunctionKind::kSetterFunction || 984 kind == FunctionKind::kSetterFunction ||
984 kind == FunctionKind::kAccessorFunction || 985 kind == FunctionKind::kAccessorFunction ||
985 kind == FunctionKind::kDefaultBaseConstructor || 986 kind == FunctionKind::kDefaultBaseConstructor ||
986 kind == FunctionKind::kDefaultSubclassConstructor || 987 kind == FunctionKind::kDefaultSubclassConstructor ||
987 kind == FunctionKind::kBaseConstructor || 988 kind == FunctionKind::kBaseConstructor ||
988 kind == FunctionKind::kSubclassConstructor || 989 kind == FunctionKind::kSubclassConstructor ||
989 kind == FunctionKind::kAsyncFunction || 990 kind == FunctionKind::kAsyncFunction ||
990 kind == FunctionKind::kAsyncArrowFunction || 991 kind == FunctionKind::kAsyncArrowFunction ||
991 kind == FunctionKind::kAsyncConciseMethod; 992 kind == FunctionKind::kAsyncConciseMethod ||
993 kind == FunctionKind::kArrowGeneratorFunction;
992 } 994 }
993 995
994 996
995 inline bool IsArrowFunction(FunctionKind kind) { 997 inline bool IsArrowFunction(FunctionKind kind) {
996 DCHECK(IsValidFunctionKind(kind)); 998 DCHECK(IsValidFunctionKind(kind));
997 return kind & FunctionKind::kArrowFunction; 999 return kind & FunctionKind::kArrowFunction;
998 } 1000 }
999 1001
1000 1002
1001 inline bool IsGeneratorFunction(FunctionKind kind) { 1003 inline bool IsGeneratorFunction(FunctionKind kind) {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1062 } 1064 }
1063 1065
1064 1066
1065 inline uint32_t ObjectHash(Address address) { 1067 inline uint32_t ObjectHash(Address address) {
1066 // All objects are at least pointer aligned, so we can remove the trailing 1068 // All objects are at least pointer aligned, so we can remove the trailing
1067 // zeros. 1069 // zeros.
1068 return static_cast<uint32_t>(bit_cast<uintptr_t>(address) >> 1070 return static_cast<uint32_t>(bit_cast<uintptr_t>(address) >>
1069 kPointerSizeLog2); 1071 kPointerSizeLog2);
1070 } 1072 }
1071 1073
1074 enum class AsyncFunctionResumeMode {
1075 Normal,
1076 Throw,
1077 };
Dan Ehrenberg 2016/05/04 22:52:36 This is not used in this patch, only in the subseq
1078
1072 } // namespace internal 1079 } // namespace internal
1073 } // namespace v8 1080 } // namespace v8
1074 1081
1075 namespace i = v8::internal; 1082 namespace i = v8::internal;
1076 1083
1077 #endif // V8_GLOBALS_H_ 1084 #endif // V8_GLOBALS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698