diff --git a/deps/include/libplatform/v8-tracing.h b/deps/include/libplatform/v8-tracing.h index 12489327..6039a9c5 100644 --- a/deps/include/libplatform/v8-tracing.h +++ b/deps/include/libplatform/v8-tracing.h @@ -282,12 +282,12 @@ class V8_PLATFORM_EXPORT TracingController const char* name, uint64_t handle) override; static const char* GetCategoryGroupName(const uint8_t* category_enabled_flag); -#endif // !defined(V8_USE_PERFETTO) void AddTraceStateObserver( v8::TracingController::TraceStateObserver* observer) override; void RemoveTraceStateObserver( v8::TracingController::TraceStateObserver* observer) override; +#endif // !defined(V8_USE_PERFETTO) void StartTracing(TraceConfig* trace_config); void StopTracing(); @@ -307,7 +307,6 @@ class V8_PLATFORM_EXPORT TracingController std::unique_ptr mutex_; std::unique_ptr trace_config_; std::atomic_bool recording_{false}; - std::unordered_set observers_; #if defined(V8_USE_PERFETTO) std::ostream* output_stream_ = nullptr; @@ -316,6 +315,7 @@ class V8_PLATFORM_EXPORT TracingController TraceEventListener* listener_for_testing_ = nullptr; std::unique_ptr tracing_session_; #else // !defined(V8_USE_PERFETTO) + std::unordered_set observers_; std::unique_ptr trace_buffer_; #endif // !defined(V8_USE_PERFETTO) diff --git a/deps/include/v8-array-buffer.h b/deps/include/v8-array-buffer.h index 841bd02a..804fc42c 100644 --- a/deps/include/v8-array-buffer.h +++ b/deps/include/v8-array-buffer.h @@ -53,12 +53,28 @@ class V8_EXPORT BackingStore : public v8::internal::BackingStoreBase { */ size_t ByteLength() const; + /** + * The maximum length (in bytes) that this backing store may grow to. + * + * If this backing store was created for a resizable ArrayBuffer or a growable + * SharedArrayBuffer, it is >= ByteLength(). Otherwise it is == + * ByteLength(). + */ + size_t MaxByteLength() const; + /** * Indicates whether the backing store was created for an ArrayBuffer or * a SharedArrayBuffer. */ bool IsShared() const; + /** + * Indicates whether the backing store was created for a resizable ArrayBuffer + * or a growable SharedArrayBuffer, and thus may be resized by user JavaScript + * code. + */ + bool IsResizableByUserJavaScript() const; + /** * Prevent implicit instantiation of operator delete with size_t argument. * The size_t argument would be incorrect because ptr points to the @@ -189,6 +205,11 @@ class V8_EXPORT ArrayBuffer : public Object { */ size_t ByteLength() const; + /** + * Maximum length in bytes. + */ + size_t MaxByteLength() const; + /** * Create a new ArrayBuffer. Allocate |byte_length| bytes. * Allocated memory will be owned by a created ArrayBuffer and @@ -235,6 +256,21 @@ class V8_EXPORT ArrayBuffer : public Object { void* data, size_t byte_length, v8::BackingStore::DeleterCallback deleter, void* deleter_data); + /** + * Returns a new resizable standalone BackingStore that is allocated using the + * array buffer allocator of the isolate. The result can be later passed to + * ArrayBuffer::New. + * + * |byte_length| must be <= |max_byte_length|. + * + * This function is usable without an isolate. Unlike |NewBackingStore| calls + * with an isolate, GCs cannot be triggered, and there are no + * retries. Allocation failure will cause the function to crash with an + * out-of-memory error. + */ + static std::unique_ptr NewResizableBackingStore( + size_t byte_length, size_t max_byte_length); + /** * Returns true if this ArrayBuffer may be detached. */ @@ -392,6 +428,11 @@ class V8_EXPORT SharedArrayBuffer : public Object { */ size_t ByteLength() const; + /** + * Maximum length in bytes. + */ + size_t MaxByteLength() const; + /** * Create a new SharedArrayBuffer. Allocate |byte_length| bytes. * Allocated memory will be owned by a created SharedArrayBuffer and diff --git a/deps/include/v8-fast-api-calls.h b/deps/include/v8-fast-api-calls.h index 1826f133..0fe7cd24 100644 --- a/deps/include/v8-fast-api-calls.h +++ b/deps/include/v8-fast-api-calls.h @@ -247,7 +247,9 @@ class CTypeInfo { kUint64, kFloat32, kFloat64, + kPointer, kV8Value, + kSeqOneByteString, kApiObject, // This will be deprecated once all users have // migrated from v8::ApiObject to v8::Local. kAny, // This is added to enable untyped representation of fast @@ -379,6 +381,11 @@ struct FastApiArrayBuffer { size_t byte_length; }; +struct FastOneByteString { + const char* data; + uint32_t length; +}; + class V8_EXPORT CFunctionInfo { public: // Construct a struct to hold a CFunction's type information. @@ -429,6 +436,7 @@ struct AnyCType { uint64_t uint64_value; float float_value; double double_value; + void* pointer_value; Local object_value; Local sequence_value; const FastApiTypedArray* uint8_ta_value; @@ -438,6 +446,7 @@ struct AnyCType { const FastApiTypedArray* uint64_ta_value; const FastApiTypedArray* float_ta_value; const FastApiTypedArray* double_ta_value; + const FastOneByteString* string_value; FastApiCallbackOptions* options_value; }; }; @@ -613,8 +622,9 @@ class CFunctionInfoImpl : public CFunctionInfo { kReturnType == CTypeInfo::Type::kUint32 || kReturnType == CTypeInfo::Type::kFloat32 || kReturnType == CTypeInfo::Type::kFloat64 || + kReturnType == CTypeInfo::Type::kPointer || kReturnType == CTypeInfo::Type::kAny, - "64-bit int and api object values are not currently " + "64-bit int, string and api object values are not currently " "supported return types."); } @@ -651,13 +661,14 @@ struct CTypeInfoTraits {}; #define PRIMITIVE_C_TYPES(V) \ V(bool, kBool) \ + V(uint8_t, kUint8) \ V(int32_t, kInt32) \ V(uint32_t, kUint32) \ V(int64_t, kInt64) \ V(uint64_t, kUint64) \ V(float, kFloat32) \ V(double, kFloat64) \ - V(uint8_t, kUint8) + V(void*, kPointer) // Same as above, but includes deprecated types for compatibility. #define ALL_C_TYPES(V) \ @@ -691,13 +702,13 @@ PRIMITIVE_C_TYPES(DEFINE_TYPE_INFO_TRAITS) }; #define TYPED_ARRAY_C_TYPES(V) \ + V(uint8_t, kUint8) \ V(int32_t, kInt32) \ V(uint32_t, kUint32) \ V(int64_t, kInt64) \ V(uint64_t, kUint64) \ V(float, kFloat32) \ - V(double, kFloat64) \ - V(uint8_t, kUint8) + V(double, kFloat64) TYPED_ARRAY_C_TYPES(SPECIALIZE_GET_TYPE_INFO_HELPER_FOR_TA) @@ -735,6 +746,18 @@ struct TypeInfoHelper { } }; +template <> +struct TypeInfoHelper { + static constexpr CTypeInfo::Flags Flags() { return CTypeInfo::Flags::kNone; } + + static constexpr CTypeInfo::Type Type() { + return CTypeInfo::Type::kSeqOneByteString; + } + static constexpr CTypeInfo::SequenceType SequenceType() { + return CTypeInfo::SequenceType::kScalar; + } +}; + #define STATIC_ASSERT_IMPLIES(COND, ASSERTION, MSG) \ static_assert(((COND) == 0) || (ASSERTION), MSG) diff --git a/deps/include/v8-inspector.h b/deps/include/v8-inspector.h index aa5a044a..563ad196 100644 --- a/deps/include/v8-inspector.h +++ b/deps/include/v8-inspector.h @@ -32,19 +32,19 @@ namespace Debugger { namespace API { class SearchMatch; } -} +} // namespace Debugger namespace Runtime { namespace API { class RemoteObject; class StackTrace; class StackTraceId; -} -} +} // namespace API +} // namespace Runtime namespace Schema { namespace API { class Domain; } -} +} // namespace Schema } // namespace protocol class V8_EXPORT StringView { @@ -134,6 +134,13 @@ class V8_EXPORT V8DebuggerId { int64_t m_second = 0; }; +struct V8_EXPORT V8StackFrame { + StringView sourceURL; + StringView functionName; + int lineNumber; + int columnNumber; +}; + class V8_EXPORT V8StackTrace { public: virtual StringView firstNonEmptySourceURL() const = 0; @@ -151,6 +158,8 @@ class V8_EXPORT V8StackTrace { // Safe to pass between threads, drops async chain. virtual std::unique_ptr clone() = 0; + + virtual std::vector frames() const = 0; }; class V8_EXPORT V8InspectorSession { @@ -203,6 +212,9 @@ class V8_EXPORT V8InspectorSession { std::unique_ptr* objectGroup) = 0; virtual void releaseObjectGroup(StringView) = 0; virtual void triggerPreciseCoverageDeltaUpdate(StringView occasion) = 0; + + // Prepare for shutdown (disables debugger pausing, etc.). + virtual void stop() = 0; }; class V8_EXPORT WebDriverValue { @@ -365,9 +377,12 @@ class V8_EXPORT V8Inspector { virtual void flushProtocolNotifications() = 0; }; enum ClientTrustLevel { kUntrusted, kFullyTrusted }; + enum SessionPauseState { kWaitingForDebugger, kNotWaitingForDebugger }; + // TODO(chromium:1352175): remove default value once downstream change lands. virtual std::unique_ptr connect( int contextGroupId, Channel*, StringView state, - ClientTrustLevel client_trust_level) { + ClientTrustLevel client_trust_level, + SessionPauseState = kNotWaitingForDebugger) { return nullptr; } diff --git a/deps/include/v8-internal.h b/deps/include/v8-internal.h index 704e89e2..c5613030 100644 --- a/deps/include/v8-internal.h +++ b/deps/include/v8-internal.h @@ -345,6 +345,14 @@ using ExternalPointer_t = Address; // that the Embedder is not using this byte (really only this one bit) for any // other purpose. This bit also does not collide with the memory tagging // extension (MTE) which would use bits [56, 60). +// +// External pointer tables are also available even when the sandbox is off but +// pointer compression is on. In that case, the mechanism can be used to easy +// alignment requirements as it turns unaligned 64-bit raw pointers into +// aligned 32-bit indices. To "opt-in" to the external pointer table mechanism +// for this purpose, instead of using the ExternalPointer accessors one needs to +// use ExternalPointerHandles directly and use them to access the pointers in an +// ExternalPointerTable. constexpr uint64_t kExternalPointerMarkBit = 1ULL << 62; constexpr uint64_t kExternalPointerTagMask = 0x40ff000000000000; constexpr uint64_t kExternalPointerTagShift = 48; @@ -367,70 +375,58 @@ constexpr uint64_t kAllExternalPointerTypeTags[] = { 0b11001100, 0b11010001, 0b11010010, 0b11010100, 0b11011000, 0b11100001, 0b11100010, 0b11100100, 0b11101000, 0b11110000}; +#define TAG(i) \ + ((kAllExternalPointerTypeTags[i] << kExternalPointerTagShift) | \ + kExternalPointerMarkBit) + // clang-format off -// New entries should be added with state "sandboxed". + // When adding new tags, please ensure that the code using these tags is // "substitution-safe", i.e. still operate safely if external pointers of the // same type are swapped by an attacker. See comment above for more details. -#define TAG(i) (kAllExternalPointerTypeTags[i]) // Shared external pointers are owned by the shared Isolate and stored in the // shared external pointer table associated with that Isolate, where they can // be accessed from multiple threads at the same time. The objects referenced // in this way must therefore always be thread-safe. -#define SHARED_EXTERNAL_POINTER_TAGS(V) \ - V(kFirstSharedTag, sandboxed, TAG(0)) \ - V(kWaiterQueueNodeTag, sandboxed, TAG(0)) \ - V(kExternalStringResourceTag, sandboxed, TAG(1)) \ - V(kExternalStringResourceDataTag, sandboxed, TAG(2)) \ - V(kLastSharedTag, sandboxed, TAG(2)) +#define SHARED_EXTERNAL_POINTER_TAGS(V) \ + V(kFirstSharedTag, TAG(0)) \ + V(kWaiterQueueNodeTag, TAG(0)) \ + V(kExternalStringResourceTag, TAG(1)) \ + V(kExternalStringResourceDataTag, TAG(2)) \ + V(kLastSharedTag, TAG(2)) // External pointers using these tags are kept in a per-Isolate external // pointer table and can only be accessed when this Isolate is active. -#define PER_ISOLATE_EXTERNAL_POINTER_TAGS(V) \ - V(kForeignForeignAddressTag, sandboxed, TAG(10)) \ - V(kNativeContextMicrotaskQueueTag, sandboxed, TAG(11)) \ - V(kEmbedderDataSlotPayloadTag, sandboxed, TAG(12)) \ - V(kExternalObjectValueTag, sandboxed, TAG(13)) \ - V(kCallHandlerInfoCallbackTag, sandboxed, TAG(14)) \ - V(kAccessorInfoGetterTag, sandboxed, TAG(15)) \ - V(kAccessorInfoSetterTag, sandboxed, TAG(16)) \ - V(kWasmInternalFunctionCallTargetTag, sandboxed, TAG(17)) \ - V(kWasmTypeInfoNativeTypeTag, sandboxed, TAG(18)) \ - V(kWasmExportedFunctionDataSignatureTag, sandboxed, TAG(19)) \ - V(kWasmContinuationJmpbufTag, sandboxed, TAG(20)) +#define PER_ISOLATE_EXTERNAL_POINTER_TAGS(V) \ + V(kForeignForeignAddressTag, TAG(10)) \ + V(kNativeContextMicrotaskQueueTag, TAG(11)) \ + V(kEmbedderDataSlotPayloadTag, TAG(12)) \ +/* This tag essentially stands for a `void*` pointer in the V8 API, and */ \ +/* it is the Embedder's responsibility to ensure type safety (against */ \ +/* substitution) and lifetime validity of these objects. */ \ + V(kExternalObjectValueTag, TAG(13)) \ + V(kCallHandlerInfoCallbackTag, TAG(14)) \ + V(kAccessorInfoGetterTag, TAG(15)) \ + V(kAccessorInfoSetterTag, TAG(16)) \ + V(kWasmInternalFunctionCallTargetTag, TAG(17)) \ + V(kWasmTypeInfoNativeTypeTag, TAG(18)) \ + V(kWasmExportedFunctionDataSignatureTag, TAG(19)) \ + V(kWasmContinuationJmpbufTag, TAG(20)) \ + V(kArrayBufferExtensionTag, TAG(21)) // All external pointer tags. #define ALL_EXTERNAL_POINTER_TAGS(V) \ SHARED_EXTERNAL_POINTER_TAGS(V) \ PER_ISOLATE_EXTERNAL_POINTER_TAGS(V) -// When the sandbox is enabled, external pointers marked as "sandboxed" above -// use the external pointer table (i.e. are sandboxed). This allows a gradual -// rollout of external pointer sandboxing. If the sandbox is off, no external -// pointers are sandboxed. -// -// Sandboxed external pointer tags are available when compressing pointers even -// when the sandbox is off. Some tags (e.g. kWaiterQueueNodeTag) are used -// manually with the external pointer table even when the sandbox is off to ease -// alignment requirements. -#define sandboxed(X) (X << kExternalPointerTagShift) | kExternalPointerMarkBit -#define unsandboxed(X) kUnsandboxedExternalPointerTag -#if defined(V8_COMPRESS_POINTERS) -#define EXTERNAL_POINTER_TAG_ENUM(Name, State, Bits) Name = State(Bits), -#else -#define EXTERNAL_POINTER_TAG_ENUM(Name, State, Bits) Name = unsandboxed(Bits), -#endif - +#define EXTERNAL_POINTER_TAG_ENUM(Name, Tag) Name = Tag, #define MAKE_TAG(HasMarkBit, TypeTag) \ ((static_cast(TypeTag) << kExternalPointerTagShift) | \ (HasMarkBit ? kExternalPointerMarkBit : 0)) enum ExternalPointerTag : uint64_t { // Empty tag value. Mostly used as placeholder. kExternalPointerNullTag = MAKE_TAG(0, 0b00000000), - // Tag to use for unsandboxed external pointers, which are still stored as - // raw pointers on the heap. - kUnsandboxedExternalPointerTag = MAKE_TAG(0, 0b00000000), // External pointer tag that will match any external pointer. Use with care! kAnyExternalPointerTag = MAKE_TAG(1, 0b11111111), // The free entry tag has all type bits set so every type check with a @@ -444,20 +440,11 @@ enum ExternalPointerTag : uint64_t { }; #undef MAKE_TAG -#undef unsandboxed -#undef sandboxed #undef TAG #undef EXTERNAL_POINTER_TAG_ENUM // clang-format on -// True if the external pointer is sandboxed and so must be referenced through -// an external pointer table. -V8_INLINE static constexpr bool IsSandboxedExternalPointerType( - ExternalPointerTag tag) { - return tag != kUnsandboxedExternalPointerTag; -} - // True if the external pointer must be accessed from the shared isolate's // external pointer table. V8_INLINE static constexpr bool IsSharedExternalPointerType( @@ -466,12 +453,10 @@ V8_INLINE static constexpr bool IsSharedExternalPointerType( } // Sanity checks. -#define CHECK_SHARED_EXTERNAL_POINTER_TAGS(Tag, ...) \ - static_assert(!IsSandboxedExternalPointerType(Tag) || \ - IsSharedExternalPointerType(Tag)); +#define CHECK_SHARED_EXTERNAL_POINTER_TAGS(Tag, ...) \ + static_assert(IsSharedExternalPointerType(Tag)); #define CHECK_NON_SHARED_EXTERNAL_POINTER_TAGS(Tag, ...) \ - static_assert(!IsSandboxedExternalPointerType(Tag) || \ - !IsSharedExternalPointerType(Tag)); + static_assert(!IsSharedExternalPointerType(Tag)); SHARED_EXTERNAL_POINTER_TAGS(CHECK_SHARED_EXTERNAL_POINTER_TAGS) PER_ISOLATE_EXTERNAL_POINTER_TAGS(CHECK_NON_SHARED_EXTERNAL_POINTER_TAGS) @@ -544,7 +529,7 @@ class Internals { static const int kVariousBooleanFlagsOffset = kIsolateStackGuardOffset + kStackGuardSize; static const int kBuiltinTier0EntryTableOffset = - kVariousBooleanFlagsOffset + kApiSystemPointerSize; + kVariousBooleanFlagsOffset + 8; static const int kBuiltinTier0TableOffset = kBuiltinTier0EntryTableOffset + kBuiltinTier0EntryTableSize; static const int kIsolateEmbedderDataOffset = @@ -792,24 +777,23 @@ class Internals { V8_INLINE static internal::Address ReadExternalPointerField( v8::Isolate* isolate, internal::Address heap_object_ptr, int offset) { #ifdef V8_ENABLE_SANDBOX - if (IsSandboxedExternalPointerType(tag)) { - // See src/sandbox/external-pointer-table-inl.h. Logic duplicated here so - // it can be inlined and doesn't require an additional call. - internal::Address* table = - IsSharedExternalPointerType(tag) - ? GetSharedExternalPointerTableBase(isolate) - : GetExternalPointerTableBase(isolate); - internal::ExternalPointerHandle handle = - ReadRawField(heap_object_ptr, offset); - uint32_t index = handle >> kExternalPointerIndexShift; - std::atomic* ptr = - reinterpret_cast*>(&table[index]); - internal::Address entry = - std::atomic_load_explicit(ptr, std::memory_order_relaxed); - return entry & ~tag; - } -#endif + static_assert(tag != kExternalPointerNullTag); + // See src/sandbox/external-pointer-table-inl.h. Logic duplicated here so + // it can be inlined and doesn't require an additional call. + internal::Address* table = IsSharedExternalPointerType(tag) + ? GetSharedExternalPointerTableBase(isolate) + : GetExternalPointerTableBase(isolate); + internal::ExternalPointerHandle handle = + ReadRawField(heap_object_ptr, offset); + uint32_t index = handle >> kExternalPointerIndexShift; + std::atomic* ptr = + reinterpret_cast*>(&table[index]); + internal::Address entry = + std::atomic_load_explicit(ptr, std::memory_order_relaxed); + return entry & ~tag; +#else return ReadRawField
(heap_object_ptr, offset); +#endif // V8_ENABLE_SANDBOX } #ifdef V8_COMPRESS_POINTERS diff --git a/deps/include/v8-isolate.h b/deps/include/v8-isolate.h index e9f53197..96593007 100644 --- a/deps/include/v8-isolate.h +++ b/deps/include/v8-isolate.h @@ -233,7 +233,7 @@ class V8_EXPORT Isolate { * Explicitly specify a startup snapshot blob. The embedder owns the blob. * The embedder *must* ensure that the snapshot is from a trusted source. */ - StartupData* snapshot_blob = nullptr; + const StartupData* snapshot_blob = nullptr; /** * Enables the host application to provide a mechanism for recording diff --git a/deps/include/v8-metrics.h b/deps/include/v8-metrics.h index 887012ac..fc21239f 100644 --- a/deps/include/v8-metrics.h +++ b/deps/include/v8-metrics.h @@ -12,6 +12,7 @@ #include "v8-internal.h" // NOLINT(build/include_directory) #include "v8-local-handle.h" // NOLINT(build/include_directory) +#include "v8config.h" // NOLINT(build/include_directory) namespace v8 { @@ -96,16 +97,88 @@ struct GarbageCollectionYoungCycle { }; struct WasmModuleDecoded { + WasmModuleDecoded() = default; + WasmModuleDecoded(bool async, bool streamed, bool success, + size_t module_size_in_bytes, size_t function_count, + int64_t wall_clock_duration_in_us) + : async(async), + streamed(streamed), + success(success), + module_size_in_bytes(module_size_in_bytes), + function_count(function_count), + wall_clock_duration_in_us(wall_clock_duration_in_us) {} + + V8_DEPRECATE_SOON("Use the version without cpu_duration_in_us") + WasmModuleDecoded(bool async, bool streamed, bool success, + size_t module_size_in_bytes, size_t function_count, + int64_t wall_clock_duration_in_us, + int64_t cpu_duration_in_us) + : async(async), + streamed(streamed), + success(success), + module_size_in_bytes(module_size_in_bytes), + function_count(function_count), + wall_clock_duration_in_us(wall_clock_duration_in_us), + cpu_duration_in_us(cpu_duration_in_us) {} + + START_ALLOW_USE_DEPRECATED() + // Copy constructor and copy assignment operator are allowed to copy the + // {cpu_duration_in_us} field. + WasmModuleDecoded(const WasmModuleDecoded&) = default; + WasmModuleDecoded& operator=(const WasmModuleDecoded&) = default; + END_ALLOW_USE_DEPRECATED() + bool async = false; bool streamed = false; bool success = false; size_t module_size_in_bytes = 0; size_t function_count = 0; int64_t wall_clock_duration_in_us = -1; + V8_DEPRECATE_SOON("We do not collect cpu times any more") int64_t cpu_duration_in_us = -1; }; struct WasmModuleCompiled { + WasmModuleCompiled() = default; + + WasmModuleCompiled(bool async, bool streamed, bool cached, bool deserialized, + bool lazy, bool success, size_t code_size_in_bytes, + size_t liftoff_bailout_count, + int64_t wall_clock_duration_in_us) + : async(async), + streamed(streamed), + cached(cached), + deserialized(deserialized), + lazy(lazy), + success(success), + code_size_in_bytes(code_size_in_bytes), + liftoff_bailout_count(liftoff_bailout_count), + wall_clock_duration_in_us(wall_clock_duration_in_us) {} + + V8_DEPRECATE_SOON("Use the version without cpu_duration_in_us") + WasmModuleCompiled(bool async, bool streamed, bool cached, bool deserialized, + bool lazy, bool success, size_t code_size_in_bytes, + size_t liftoff_bailout_count, + int64_t wall_clock_duration_in_us, + int64_t cpu_duration_in_us) + : async(async), + streamed(streamed), + cached(cached), + deserialized(deserialized), + lazy(lazy), + success(success), + code_size_in_bytes(code_size_in_bytes), + liftoff_bailout_count(liftoff_bailout_count), + wall_clock_duration_in_us(wall_clock_duration_in_us), + cpu_duration_in_us(cpu_duration_in_us) {} + + START_ALLOW_USE_DEPRECATED() + // Copy constructor and copy assignment operator are allowed to copy the + // {cpu_duration_in_us} field. + WasmModuleCompiled(const WasmModuleCompiled&) = default; + WasmModuleCompiled& operator=(const WasmModuleCompiled&) = default; + END_ALLOW_USE_DEPRECATED() + bool async = false; bool streamed = false; bool cached = false; @@ -115,6 +188,7 @@ struct WasmModuleCompiled { size_t code_size_in_bytes = 0; size_t liftoff_bailout_count = 0; int64_t wall_clock_duration_in_us = -1; + V8_DEPRECATE_SOON("We do not collect cpu times any more") int64_t cpu_duration_in_us = -1; }; diff --git a/deps/include/v8-platform.h b/deps/include/v8-platform.h index 32a82f88..32898e7e 100644 --- a/deps/include/v8-platform.h +++ b/deps/include/v8-platform.h @@ -285,6 +285,8 @@ class ConvertableToTraceFormat { * V8 Tracing controller. * * Can be implemented by an embedder to record trace events from V8. + * + * Will become obsolete in Perfetto SDK build (v8_use_perfetto = true). */ class TracingController { public: @@ -348,10 +350,16 @@ class TracingController { virtual void OnTraceDisabled() = 0; }; - /** Adds tracing state change observer. */ + /** + * Adds tracing state change observer. + * Does nothing in Perfetto SDK build (v8_use_perfetto = true). + */ virtual void AddTraceStateObserver(TraceStateObserver*) {} - /** Removes tracing state change observer. */ + /** + * Removes tracing state change observer. + * Does nothing in Perfetto SDK build (v8_use_perfetto = true). + */ virtual void RemoveTraceStateObserver(TraceStateObserver*) {} }; diff --git a/deps/include/v8-snapshot.h b/deps/include/v8-snapshot.h index 2400357c..b15a2b19 100644 --- a/deps/include/v8-snapshot.h +++ b/deps/include/v8-snapshot.h @@ -91,7 +91,7 @@ class V8_EXPORT SnapshotCreator { */ SnapshotCreator(Isolate* isolate, const intptr_t* external_references = nullptr, - StartupData* existing_blob = nullptr); + const StartupData* existing_blob = nullptr); /** * Create and enter an isolate, and set it up for serialization. @@ -102,7 +102,7 @@ class V8_EXPORT SnapshotCreator { * that must be equivalent to CreateParams::external_references. */ SnapshotCreator(const intptr_t* external_references = nullptr, - StartupData* existing_blob = nullptr); + const StartupData* existing_blob = nullptr); /** * Destroy the snapshot creator, and exit and dispose of the Isolate diff --git a/deps/include/v8-template.h b/deps/include/v8-template.h index 669012a9..11296cd4 100644 --- a/deps/include/v8-template.h +++ b/deps/include/v8-template.h @@ -30,7 +30,9 @@ class Signature; F(AsyncIteratorPrototype, initial_async_iterator_prototype) \ F(ErrorPrototype, initial_error_prototype) \ F(IteratorPrototype, initial_iterator_prototype) \ - F(ObjProto_valueOf, object_value_of_function) + F(MapIteratorPrototype, initial_map_iterator_prototype) \ + F(ObjProto_valueOf, object_value_of_function) \ + F(SetIteratorPrototype, initial_set_iterator_prototype) enum Intrinsic { #define V8_DECL_INTRINSIC(name, iname) k##name, diff --git a/deps/include/v8-version.h b/deps/include/v8-version.h index a9d6f92a..c087efe9 100644 --- a/deps/include/v8-version.h +++ b/deps/include/v8-version.h @@ -8,10 +8,10 @@ // These macros define the version number for the current version. // NOTE these macros are used by some of the tool scripts and the build // system so their names cannot be changed without changing the scripts. -#define V8_MAJOR_VERSION 10 -#define V8_MINOR_VERSION 9 -#define V8_BUILD_NUMBER 194 -#define V8_PATCH_LEVEL 9 +#define V8_MAJOR_VERSION 11 +#define V8_MINOR_VERSION 0 +#define V8_BUILD_NUMBER 226 +#define V8_PATCH_LEVEL 16 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/include/v8config.h b/deps/include/v8config.h index 2ac27b36..c79cd04e 100644 --- a/deps/include/v8config.h +++ b/deps/include/v8config.h @@ -308,6 +308,9 @@ path. Add it with -I to the command line // V8_HAS_BUILTIN_EXPECT - __builtin_expect() supported // V8_HAS_BUILTIN_FRAME_ADDRESS - __builtin_frame_address() supported // V8_HAS_BUILTIN_POPCOUNT - __builtin_popcount() supported +// V8_HAS_BUILTIN_ADD_OVERFLOW - __builtin_add_overflow() supported +// V8_HAS_BUILTIN_SUB_OVERFLOW - __builtin_sub_overflow() supported +// V8_HAS_BUILTIN_MUL_OVERFLOW - __builtin_mul_overflow() supported // V8_HAS_BUILTIN_SADD_OVERFLOW - __builtin_sadd_overflow() supported // V8_HAS_BUILTIN_SSUB_OVERFLOW - __builtin_ssub_overflow() supported // V8_HAS_BUILTIN_UADD_OVERFLOW - __builtin_uadd_overflow() supported @@ -339,6 +342,7 @@ path. Add it with -I to the command line # define V8_HAS_ATTRIBUTE_ALWAYS_INLINE (__has_attribute(always_inline)) # define V8_HAS_ATTRIBUTE_CONSTINIT \ (__has_attribute(require_constant_initialization)) +# define V8_HAS_ATTRIBUTE_CONST (__has_attribute(const)) # define V8_HAS_ATTRIBUTE_NONNULL (__has_attribute(nonnull)) # define V8_HAS_ATTRIBUTE_NOINLINE (__has_attribute(noinline)) # define V8_HAS_ATTRIBUTE_UNUSED (__has_attribute(unused)) @@ -360,6 +364,9 @@ path. Add it with -I to the command line # define V8_HAS_BUILTIN_EXPECT (__has_builtin(__builtin_expect)) # define V8_HAS_BUILTIN_FRAME_ADDRESS (__has_builtin(__builtin_frame_address)) # define V8_HAS_BUILTIN_POPCOUNT (__has_builtin(__builtin_popcount)) +# define V8_HAS_BUILTIN_ADD_OVERFLOW (__has_builtin(__builtin_add_overflow)) +# define V8_HAS_BUILTIN_SUB_OVERFLOW (__has_builtin(__builtin_sub_overflow)) +# define V8_HAS_BUILTIN_MUL_OVERFLOW (__has_builtin(__builtin_mul_overflow)) # define V8_HAS_BUILTIN_SADD_OVERFLOW (__has_builtin(__builtin_sadd_overflow)) # define V8_HAS_BUILTIN_SSUB_OVERFLOW (__has_builtin(__builtin_ssub_overflow)) # define V8_HAS_BUILTIN_UADD_OVERFLOW (__has_builtin(__builtin_uadd_overflow)) @@ -455,6 +462,16 @@ path. Add it with -I to the command line #endif +// A macro to mark functions whose values don't change (e.g. across calls) +// and thereby compiler is free to hoist and fold multiple calls together. +// Use like: +// V8_CONST int foo() { ... } +#if V8_HAS_ATTRIBUTE_CONST +# define V8_CONST __attribute__((const)) +#else +# define V8_CONST +#endif + // A macro to mark a declaration as requiring constant initialization. // Use like: // int* foo V8_CONSTINIT; diff --git a/deps/v8 b/deps/v8 index 4b4e4733..7999223c 160000 --- a/deps/v8 +++ b/deps/v8 @@ -1 +1 @@ -Subproject commit 4b4e473387ed62f7fcbc95a3bf05244ea0e76a0a +Subproject commit 7999223ca1644726339aae43d9435c721c8a4bb0 diff --git a/deps/v8_version b/deps/v8_version index ff8f5c65..7a495ae6 100644 --- a/deps/v8_version +++ b/deps/v8_version @@ -1 +1 @@ -10.9.194.9 \ No newline at end of file +11.0.226.16 \ No newline at end of file