summaryrefslogtreecommitdiff
path: root/deps/v8/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/common')
-rw-r--r--deps/v8/src/common/OWNERS2
-rw-r--r--deps/v8/src/common/assert-scope.cc12
-rw-r--r--deps/v8/src/common/assert-scope.h2
-rw-r--r--deps/v8/src/common/globals.h71
-rw-r--r--deps/v8/src/common/message-template.h25
-rw-r--r--deps/v8/src/common/ptr-compr-inl.h7
6 files changed, 93 insertions, 26 deletions
diff --git a/deps/v8/src/common/OWNERS b/deps/v8/src/common/OWNERS
index 3f9de7e204..4750620072 100644
--- a/deps/v8/src/common/OWNERS
+++ b/deps/v8/src/common/OWNERS
@@ -1,3 +1,3 @@
-file://COMMON_OWNERS
+file:../../COMMON_OWNERS
# COMPONENT: Blink>JavaScript
diff --git a/deps/v8/src/common/assert-scope.cc b/deps/v8/src/common/assert-scope.cc
index 5a299fa1ee..f1fe717cc0 100644
--- a/deps/v8/src/common/assert-scope.cc
+++ b/deps/v8/src/common/assert-scope.cc
@@ -92,16 +92,18 @@ bool PerThreadAssertScope<kType, kAllow>::IsAllowed() {
return current_data == nullptr || current_data->Get(kType);
}
-template <PerIsolateAssertType kType, bool kAllow>
-class PerIsolateAssertScope<kType, kAllow>::DataBit
- : public BitField<bool, kType, 1> {};
+namespace {
+template <PerIsolateAssertType kType>
+using DataBit = BitField<bool, kType, 1>;
+}
template <PerIsolateAssertType kType, bool kAllow>
PerIsolateAssertScope<kType, kAllow>::PerIsolateAssertScope(Isolate* isolate)
: isolate_(isolate), old_data_(isolate->per_isolate_assert_data()) {
DCHECK_NOT_NULL(isolate);
STATIC_ASSERT(kType < 32);
- isolate_->set_per_isolate_assert_data(DataBit::update(old_data_, kAllow));
+ isolate_->set_per_isolate_assert_data(
+ DataBit<kType>::update(old_data_, kAllow));
}
template <PerIsolateAssertType kType, bool kAllow>
@@ -112,7 +114,7 @@ PerIsolateAssertScope<kType, kAllow>::~PerIsolateAssertScope() {
// static
template <PerIsolateAssertType kType, bool kAllow>
bool PerIsolateAssertScope<kType, kAllow>::IsAllowed(Isolate* isolate) {
- return DataBit::decode(isolate->per_isolate_assert_data());
+ return DataBit<kType>::decode(isolate->per_isolate_assert_data());
}
// -----------------------------------------------------------------------------
diff --git a/deps/v8/src/common/assert-scope.h b/deps/v8/src/common/assert-scope.h
index 606439d42b..73729400ac 100644
--- a/deps/v8/src/common/assert-scope.h
+++ b/deps/v8/src/common/assert-scope.h
@@ -81,8 +81,6 @@ class PerIsolateAssertScope {
static bool IsAllowed(Isolate* isolate);
private:
- class DataBit;
-
Isolate* isolate_;
uint32_t old_data_;
diff --git a/deps/v8/src/common/globals.h b/deps/v8/src/common/globals.h
index 8d1bf5dfcc..a0584b95c4 100644
--- a/deps/v8/src/common/globals.h
+++ b/deps/v8/src/common/globals.h
@@ -101,6 +101,14 @@ constexpr int kStackSpaceRequiredForCompilation = 40;
#define V8_OS_WIN_X64 true
#endif
+#if defined(V8_OS_WIN) && defined(V8_TARGET_ARCH_ARM64)
+#define V8_OS_WIN_ARM64 true
+#endif
+
+#if defined(V8_OS_WIN_X64) || defined(V8_OS_WIN_ARM64)
+#define V8_OS_WIN64 true
+#endif
+
// Superclass for classes only using static method functions.
// The subclass of AllStatic cannot be instantiated at all.
class AllStatic {
@@ -882,14 +890,14 @@ constexpr int kIeeeDoubleExponentWordOffset = 0;
// Testers for test.
#define HAS_SMI_TAG(value) \
- ((static_cast<intptr_t>(value) & ::i::kSmiTagMask) == ::i::kSmiTag)
+ ((static_cast<i::Tagged_t>(value) & ::i::kSmiTagMask) == ::i::kSmiTag)
-#define HAS_STRONG_HEAP_OBJECT_TAG(value) \
- (((static_cast<intptr_t>(value) & ::i::kHeapObjectTagMask) == \
+#define HAS_STRONG_HEAP_OBJECT_TAG(value) \
+ (((static_cast<i::Tagged_t>(value) & ::i::kHeapObjectTagMask) == \
::i::kHeapObjectTag))
-#define HAS_WEAK_HEAP_OBJECT_TAG(value) \
- (((static_cast<intptr_t>(value) & ::i::kHeapObjectTagMask) == \
+#define HAS_WEAK_HEAP_OBJECT_TAG(value) \
+ (((static_cast<i::Tagged_t>(value) & ::i::kHeapObjectTagMask) == \
::i::kWeakHeapObjectTag))
// OBJECT_POINTER_ALIGN returns the value aligned as a HeapObject pointer
@@ -1060,6 +1068,25 @@ enum class VariableMode : uint8_t {
// has been shadowed by an eval-introduced
// variable
+ // Variables for private methods or accessors whose access require
+ // brand check. Declared only in class scopes by the compiler
+ // and allocated only in class contexts:
+ kPrivateMethod, // Does not coexist with any other variable with the same
+ // name in the same scope.
+
+ kPrivateSetterOnly, // Incompatible with variables with the same name but
+ // any mode other than kPrivateGetterOnly. Transition to
+ // kPrivateGetterAndSetter if a later declaration for the
+ // same name with kPrivateGetterOnly is made.
+
+ kPrivateGetterOnly, // Incompatible with variables with the same name but
+ // any mode other than kPrivateSetterOnly. Transition to
+ // kPrivateGetterAndSetter if a later declaration for the
+ // same name with kPrivateSetterOnly is made.
+
+ kPrivateGetterAndSetter, // Does not coexist with any other variable with the
+ // same name in the same scope.
+
kLastLexicalVariableMode = kConst,
};
@@ -1071,6 +1098,14 @@ inline const char* VariableMode2String(VariableMode mode) {
return "VAR";
case VariableMode::kLet:
return "LET";
+ case VariableMode::kPrivateGetterOnly:
+ return "PRIVATE_GETTER_ONLY";
+ case VariableMode::kPrivateSetterOnly:
+ return "PRIVATE_SETTER_ONLY";
+ case VariableMode::kPrivateMethod:
+ return "PRIVATE_METHOD";
+ case VariableMode::kPrivateGetterAndSetter:
+ return "PRIVATE_GETTER_AND_SETTER";
case VariableMode::kConst:
return "CONST";
case VariableMode::kDynamic:
@@ -1104,6 +1139,21 @@ inline bool IsDeclaredVariableMode(VariableMode mode) {
return mode <= VariableMode::kVar;
}
+inline bool IsPrivateMethodOrAccessorVariableMode(VariableMode mode) {
+ return mode >= VariableMode::kPrivateMethod &&
+ mode <= VariableMode::kPrivateGetterAndSetter;
+}
+
+inline bool IsSerializableVariableMode(VariableMode mode) {
+ return IsDeclaredVariableMode(mode) ||
+ IsPrivateMethodOrAccessorVariableMode(mode);
+}
+
+inline bool IsConstVariableMode(VariableMode mode) {
+ return mode == VariableMode::kConst ||
+ IsPrivateMethodOrAccessorVariableMode(mode);
+}
+
inline bool IsLexicalVariableMode(VariableMode mode) {
STATIC_ASSERT(static_cast<uint8_t>(VariableMode::kLet) ==
0); // Implies that mode >= VariableMode::kLet.
@@ -1168,8 +1218,6 @@ enum InitializationFlag : uint8_t { kNeedsInitialization, kCreatedInitialized };
enum MaybeAssignedFlag : uint8_t { kNotAssigned, kMaybeAssigned };
-enum RequiresBrandCheckFlag : uint8_t { kNoBrandCheck, kRequiresBrandCheck };
-
enum class InterpreterPushArgsMode : unsigned {
kArrayFunction,
kWithFinalSpread,
@@ -1498,12 +1546,12 @@ enum KeyedAccessStoreMode {
enum MutableMode { MUTABLE, IMMUTABLE };
-static inline bool IsCOWHandlingStoreMode(KeyedAccessStoreMode store_mode) {
+inline bool IsCOWHandlingStoreMode(KeyedAccessStoreMode store_mode) {
return store_mode == STORE_HANDLE_COW ||
store_mode == STORE_AND_GROW_HANDLE_COW;
}
-static inline bool IsGrowStoreMode(KeyedAccessStoreMode store_mode) {
+inline bool IsGrowStoreMode(KeyedAccessStoreMode store_mode) {
return store_mode == STORE_AND_GROW_HANDLE_COW;
}
@@ -1535,6 +1583,11 @@ constexpr int kSmallOrderedHashMapMinCapacity = 4;
// has correct value range (see Issue 830 for more details).
enum StackFrameId { ID_MIN_VALUE = kMinInt, ID_MAX_VALUE = kMaxInt, NO_ID = 0 };
+enum class ExceptionStatus : bool { kException = false, kSuccess = true };
+V8_INLINE bool operator!(ExceptionStatus status) {
+ return !static_cast<bool>(status);
+}
+
} // namespace internal
} // namespace v8
diff --git a/deps/v8/src/common/message-template.h b/deps/v8/src/common/message-template.h
index fedbfa5a10..e3307a525c 100644
--- a/deps/v8/src/common/message-template.h
+++ b/deps/v8/src/common/message-template.h
@@ -118,9 +118,9 @@ namespace internal {
T(NoAccess, "no access") \
T(NonCallableInInstanceOfCheck, \
"Right-hand side of 'instanceof' is not callable") \
- T(NonCoercible, "Cannot destructure 'undefined' or 'null'.") \
+ T(NonCoercible, "Cannot destructure '%' as it is %.") \
T(NonCoercibleWithProperty, \
- "Cannot destructure property `%` of 'undefined' or 'null'.") \
+ "Cannot destructure property '%' of '%' as it is %.") \
T(NonExtensibleProto, "% is not extensible") \
T(NonObjectInInstanceOfCheck, \
"Right-hand side of 'instanceof' is not an object") \
@@ -146,7 +146,8 @@ namespace internal {
T(NotSuperConstructorAnonymousClass, \
"Super constructor % of anonymous class is not a constructor") \
T(NotIntegerSharedTypedArray, "% is not an integer shared typed array.") \
- T(NotInt32SharedTypedArray, "% is not an int32 shared typed array.") \
+ T(NotInt32OrBigInt64SharedTypedArray, \
+ "% is not an int32 or BigInt64 shared typed array.") \
T(ObjectGetterExpectingFunction, \
"Object.prototype.__defineGetter__: Expecting function") \
T(ObjectGetterCallable, "Getter must be a function: %") \
@@ -412,11 +413,15 @@ namespace internal {
T(InvalidOrUnexpectedToken, "Invalid or unexpected token") \
T(InvalidPrivateFieldResolution, \
"Private field '%' must be declared in an enclosing class") \
- T(InvalidPrivateFieldRead, \
- "Read of private field % from an object which did not contain the field") \
- T(InvalidPrivateFieldWrite, \
- "Write of private field % to an object which did not contain the field") \
+ T(InvalidPrivateMemberRead, \
+ "Cannot read private member % from an object whose class did not declare " \
+ "it") \
+ T(InvalidPrivateMemberWrite, \
+ "Cannot write private member % to an object whose class did not declare " \
+ "it") \
T(InvalidPrivateMethodWrite, "Private method '%' is not writable") \
+ T(InvalidPrivateGetterAccess, "'%' was defined without a getter") \
+ T(InvalidPrivateSetterAccess, "'%' was defined without a setter") \
T(JsonParseUnexpectedEOS, "Unexpected end of JSON input") \
T(JsonParseUnexpectedToken, "Unexpected token % in JSON at position %") \
T(JsonParseUnexpectedTokenNumber, "Unexpected number in JSON at position %") \
@@ -484,6 +489,7 @@ namespace internal {
"Too many arguments in function call (only 65535 allowed)") \
T(TooManyParameters, \
"Too many parameters in function definition (only 65534 allowed)") \
+ T(TooManyProperties, "Too many properties to enumerate") \
T(TooManySpreads, \
"Literal containing too many nested spreads (up to 65534 allowed)") \
T(TooManyVariables, "Too many variables declared (only 4194303 allowed)") \
@@ -574,7 +580,10 @@ namespace internal {
"FinalizationGroup.prototype.register: target and holdings must not be " \
"same") \
T(WeakRefsWeakRefConstructorTargetMustBeObject, \
- "WeakRef: target must be an object")
+ "WeakRef: target must be an object") \
+ T(OptionalChainingNoNew, "Invalid optional chain from new expression") \
+ T(OptionalChainingNoSuper, "Invalid optional chain from super property") \
+ T(OptionalChainingNoTemplate, "Invalid tagged template on optional chain")
enum class MessageTemplate {
#define TEMPLATE(NAME, STRING) k##NAME,
diff --git a/deps/v8/src/common/ptr-compr-inl.h b/deps/v8/src/common/ptr-compr-inl.h
index 00a79bb291..a8fd7f245c 100644
--- a/deps/v8/src/common/ptr-compr-inl.h
+++ b/deps/v8/src/common/ptr-compr-inl.h
@@ -35,7 +35,12 @@ V8_INLINE Address GetIsolateRoot<Address>(Address on_heap_addr) {
template <>
V8_INLINE Address GetIsolateRoot<Isolate*>(Isolate* isolate) {
- return isolate->isolate_root();
+ Address isolate_root = isolate->isolate_root();
+#ifdef V8_COMPRESS_POINTERS
+ isolate_root = reinterpret_cast<Address>(V8_ASSUME_ALIGNED(
+ reinterpret_cast<void*>(isolate_root), kPtrComprIsolateRootAlignment));
+#endif
+ return isolate_root;
}
// Decompresses smi value.