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

Side by Side Diff: src/globals.h

Issue 1467473002: Install ConstructNonConstructable as construct stub for non-constructables. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years 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/ia32/builtins-ia32.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 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 return kind & FunctionKind::kSubclassConstructor; 1015 return kind & FunctionKind::kSubclassConstructor;
1016 } 1016 }
1017 1017
1018 1018
1019 inline bool IsClassConstructor(FunctionKind kind) { 1019 inline bool IsClassConstructor(FunctionKind kind) {
1020 DCHECK(IsValidFunctionKind(kind)); 1020 DCHECK(IsValidFunctionKind(kind));
1021 return kind & FunctionKind::kClassConstructor; 1021 return kind & FunctionKind::kClassConstructor;
1022 } 1022 }
1023 1023
1024 1024
1025 inline bool IsConstructable(FunctionKind kind, LanguageMode mode) {
1026 if (IsAccessorFunction(kind)) return false;
1027 if (IsConciseMethod(kind) && !IsGeneratorFunction(kind)) return false;
1028 if (IsArrowFunction(kind)) return false;
1029 if (is_strong(mode)) return IsClassConstructor(kind);
1030 return true;
1031 }
1032
1033
1025 inline bool IsInObjectLiteral(FunctionKind kind) { 1034 inline bool IsInObjectLiteral(FunctionKind kind) {
1026 DCHECK(IsValidFunctionKind(kind)); 1035 DCHECK(IsValidFunctionKind(kind));
1027 return kind & FunctionKind::kInObjectLiteral; 1036 return kind & FunctionKind::kInObjectLiteral;
1028 } 1037 }
1029 1038
1030 1039
1031 inline FunctionKind WithObjectLiteralBit(FunctionKind kind) { 1040 inline FunctionKind WithObjectLiteralBit(FunctionKind kind) {
1032 kind = static_cast<FunctionKind>(kind | FunctionKind::kInObjectLiteral); 1041 kind = static_cast<FunctionKind>(kind | FunctionKind::kInObjectLiteral);
1033 DCHECK(IsValidFunctionKind(kind)); 1042 DCHECK(IsValidFunctionKind(kind));
1034 return kind; 1043 return kind;
1035 } 1044 }
1036 } // namespace internal 1045 } // namespace internal
1037 } // namespace v8 1046 } // namespace v8
1038 1047
1039 namespace i = v8::internal; 1048 namespace i = v8::internal;
1040 1049
1041 #endif // V8_GLOBALS_H_ 1050 #endif // V8_GLOBALS_H_
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698