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

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: update bytecode expectations (CallRuntime.golden) 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
« no previous file with comments | « src/factory.cc ('k') | src/js/harmony-async-await.js » ('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 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;
Dan Ehrenberg 2016/05/09 23:02:54 Huh? What's this? I don't think we have syntax for
caitp (gmail) 2016/05/10 00:34:58 beats me, i thought it was added in a rebase, i do
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 DCHECK(IsValidFunctionKind(kind)); 1053 DCHECK(IsValidFunctionKind(kind));
1052 return kind & FunctionKind::kClassConstructor; 1054 return kind & FunctionKind::kClassConstructor;
1053 } 1055 }
1054 1056
1055 1057
1056 inline bool IsConstructable(FunctionKind kind, LanguageMode mode) { 1058 inline bool IsConstructable(FunctionKind kind, LanguageMode mode) {
1057 if (IsAccessorFunction(kind)) return false; 1059 if (IsAccessorFunction(kind)) return false;
1058 if (IsConciseMethod(kind)) return false; 1060 if (IsConciseMethod(kind)) return false;
1059 if (IsArrowFunction(kind)) return false; 1061 if (IsArrowFunction(kind)) return false;
1060 if (IsGeneratorFunction(kind)) return false; 1062 if (IsGeneratorFunction(kind)) return false;
1063 if (IsAsyncFunction(kind)) return false;
1061 return true; 1064 return true;
1062 } 1065 }
1063 1066
1064 1067
1065 inline uint32_t ObjectHash(Address address) { 1068 inline uint32_t ObjectHash(Address address) {
1066 // All objects are at least pointer aligned, so we can remove the trailing 1069 // All objects are at least pointer aligned, so we can remove the trailing
1067 // zeros. 1070 // zeros.
1068 return static_cast<uint32_t>(bit_cast<uintptr_t>(address) >> 1071 return static_cast<uint32_t>(bit_cast<uintptr_t>(address) >>
1069 kPointerSizeLog2); 1072 kPointerSizeLog2);
1070 } 1073 }
1071 1074
1072 } // namespace internal 1075 } // namespace internal
1073 } // namespace v8 1076 } // namespace v8
1074 1077
1075 namespace i = v8::internal; 1078 namespace i = v8::internal;
1076 1079
1077 #endif // V8_GLOBALS_H_ 1080 #endif // V8_GLOBALS_H_
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/js/harmony-async-await.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698