Skip to content

Conversation

@targos
Copy link
Member

@targos targos commented Oct 25, 2025

I did what I could but there are still a bunch of patches that I don't know how to revert (or adapt) safely:

Current diff on `deps/v8/include`
diff --git a/deps/v8/include/js_protocol.pdl b/deps/v8/include/js_protocol.pdl
index 73da9149b5d..bc86332d869 100644
--- a/deps/v8/include/js_protocol.pdl
+++ b/deps/v8/include/js_protocol.pdl
@@ -794,6 +794,8 @@ experimental domain HeapProfiler
       # Average sample interval in bytes. Poisson distribution is used for the intervals. The
       # default value is 32768 bytes.
       optional number samplingInterval
+      # Maximum stack depth. The default value is 128.
+      optional number stackDepth
       # By default, the sampling heap profiler reports only objects which are
       # still alive when the profile is returned via getSamplingProfile or
       # stopSampling, which is useful for determining what functions contribute
@@ -1140,6 +1142,8 @@ domain Runtime
         dataview
         webassemblymemory
         wasmvalue
+        # blink's subtypes.
+        trustedtype
       # Object class (constructor) name. Specified for `object` type values only.
       optional string className
       # Remote object value in case of primitive values or JSON values (if it was requested).
@@ -1201,6 +1205,8 @@ domain Runtime
         dataview
         webassemblymemory
         wasmvalue
+        # blink's subtypes.
+        trustedtype
       # String representation of the object.
       optional string description
       # True iff some of the properties or entries of the original object did not fit.
@@ -1250,6 +1256,8 @@ domain Runtime
         dataview
         webassemblymemory
         wasmvalue
+        # blink's subtypes.
+        trustedtype
 
   experimental type EntryPreview extends object
     properties
diff --git a/deps/v8/include/v8-context.h b/deps/v8/include/v8-context.h
index c93c5652c50..521f0c0f93e 100644
--- a/deps/v8/include/v8-context.h
+++ b/deps/v8/include/v8-context.h
@@ -305,9 +305,30 @@ class V8_EXPORT Context : public Data {
    * SetAlignedPointerInEmbedderData with the same index. Note that index 0
    * currently has a special meaning for Chrome's debugger.
    */
+  V8_INLINE void* GetAlignedPointerFromEmbedderData(Isolate* isolate, int index,
+                                                    EmbedderDataTypeTag tag);
+  V8_INLINE void* GetAlignedPointerFromEmbedderData(int index,
+                                                    EmbedderDataTypeTag tag);
+
+  V8_DEPRECATE_SOON(
+      "Use GetAlignedPointerFromEmbedderData with EmbedderDataTypeTag "
+      "parameter instead.")
   V8_INLINE void* GetAlignedPointerFromEmbedderData(Isolate* isolate,
-                                                    int index);
-  V8_INLINE void* GetAlignedPointerFromEmbedderData(int index);
+                                                    int index) {
+    return GetAlignedPointerFromEmbedderData(isolate, index,
+                                             kEmbedderDataTypeTagDefault);
+  }
+
+  V8_DEPRECATE_SOON(
+      "Use GetAlignedPointerFromEmbedderData with EmbedderDataTypeTag "
+      "parameter instead.")
+  V8_INLINE void* GetAlignedPointerFromEmbedderData(int index) {
+    return GetAlignedPointerFromEmbedderData(index,
+                                             kEmbedderDataTypeTagDefault);
+  }
+
+  void SetAlignedPointerInEmbedderData(int index, void* value,
+                                       EmbedderDataTypeTag tag);
 
   /**
    * Sets a 2-byte-aligned native pointer in the embedder data with the given
@@ -317,10 +338,9 @@ class V8_EXPORT Context : public Data {
   V8_DEPRECATE_SOON(
       "Use SetAlignedPointerInEmbedderData with EmbedderDataTypeTag parameter "
       "instead.")
-  void SetAlignedPointerInEmbedderData(int index, void* value);
-
-  void SetAlignedPointerInEmbedderData(int index, void* value,
-                                       EmbedderDataTypeTag slot);
+  void SetAlignedPointerInEmbedderData(int index, void* value) {
+    SetAlignedPointerInEmbedderData(index, value, kEmbedderDataTypeTagDefault);
+  }
 
   /**
    * Control whether code generation from strings is allowed. Calling
@@ -439,7 +459,8 @@ class V8_EXPORT Context : public Data {
   internal::ValueHelper::InternalRepresentationType GetDataFromSnapshotOnce(
       size_t index);
   Local<Value> SlowGetEmbedderData(int index);
-  void* SlowGetAlignedPointerFromEmbedderData(int index);
+  void* SlowGetAlignedPointerFromEmbedderData(int index,
+                                              EmbedderDataTypeTag tag);
 };
 
 // --- Implementation ---
@@ -467,7 +488,8 @@ Local<Value> Context::GetEmbedderData(int index) {
 #endif
 }
 
-void* Context::GetAlignedPointerFromEmbedderData(Isolate* isolate, int index) {
+void* Context::GetAlignedPointerFromEmbedderData(Isolate* isolate, int index,
+                                                 EmbedderDataTypeTag tag) {
 #if !defined(V8_ENABLE_CHECKS)
   using A = internal::Address;
   using I = internal::Internals;
@@ -477,16 +499,15 @@ void* Context::GetAlignedPointerFromEmbedderData(Isolate* isolate, int index) {
   int value_offset = I::kEmbedderDataArrayHeaderSize +
                      (I::kEmbedderDataSlotSize * index) +
                      I::kEmbedderDataSlotExternalPointerOffset;
-  return reinterpret_cast<void*>(
-      I::ReadExternalPointerField<{internal::kFirstEmbedderDataTag,
-                                   internal::kLastEmbedderDataTag}>(
-          isolate, embedder_data, value_offset));
+  return reinterpret_cast<void*>(I::ReadExternalPointerField(
+      isolate, embedder_data, value_offset, ToExternalPointerTag(tag)));
 #else
-  return SlowGetAlignedPointerFromEmbedderData(index);
+  return SlowGetAlignedPointerFromEmbedderData(index, tag);
 #endif
 }
 
-void* Context::GetAlignedPointerFromEmbedderData(int index) {
+void* Context::GetAlignedPointerFromEmbedderData(int index,
+                                                 EmbedderDataTypeTag tag) {
 #if !defined(V8_ENABLE_CHECKS)
   using A = internal::Address;
   using I = internal::Internals;
@@ -497,12 +518,10 @@ void* Context::GetAlignedPointerFromEmbedderData(int index) {
                      (I::kEmbedderDataSlotSize * index) +
                      I::kEmbedderDataSlotExternalPointerOffset;
   Isolate* isolate = I::GetCurrentIsolateForSandbox();
-  return reinterpret_cast<void*>(
-      I::ReadExternalPointerField<{internal::kFirstEmbedderDataTag,
-                                   internal::kLastEmbedderDataTag}>(
-          isolate, embedder_data, value_offset));
+  return reinterpret_cast<void*>(I::ReadExternalPointerField(
+      isolate, embedder_data, value_offset, ToExternalPointerTag(tag)));
 #else
-  return SlowGetAlignedPointerFromEmbedderData(index);
+  return SlowGetAlignedPointerFromEmbedderData(index, tag);
 #endif
 }
 
diff --git a/deps/v8/include/v8-internal.h b/deps/v8/include/v8-internal.h
index 5f006948716..c649ac60554 100644
--- a/deps/v8/include/v8-internal.h
+++ b/deps/v8/include/v8-internal.h
@@ -421,9 +421,9 @@ constexpr size_t kMaxCppHeapPointers = 0;
 
 #endif  // V8_COMPRESS_POINTERS
 
-// The number of tags reserved for embedder data. The value is picked
-// arbitrarily. In Chrome there are 4 embedders, so at least 4 tags are needed.
-// A generic tag was used for embedder data before, so one tag is used for that.
+// The number of tags reserved for embedder data stored in internal fields. The
+// value is picked arbitrarily, and is slightly larger than the number of tags
+// currently used in Chrome.
 #define V8_EMBEDDER_DATA_TAG_COUNT 5
 
 // Generic tag range struct to represent ranges of type tags.
@@ -566,7 +566,6 @@ enum ExternalPointerTag : uint16_t {
   // Placeholders for embedder data.
   kFirstEmbedderDataTag,
   kLastEmbedderDataTag = kFirstEmbedderDataTag + V8_EMBEDDER_DATA_TAG_COUNT - 1,
-  kEmbedderDataSlotPayloadTag = kLastEmbedderDataTag,
   // 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.
@@ -1025,16 +1024,12 @@ class Internals {
   using Tagged_t = uint32_t;
   struct StaticReadOnlyRoot {
 #ifdef V8_ENABLE_WEBASSEMBLY
-#ifdef V8_INTL_SUPPORT
-    static constexpr Tagged_t kBuildDependentTheHoleValue = 0x67b9;
-#else
-    static constexpr Tagged_t kBuildDependentTheHoleValue = 0x5b1d;
-#endif
+    static constexpr Tagged_t kBuildDependentTheHoleValue = 0x20001;
 #else
 #ifdef V8_INTL_SUPPORT
-    static constexpr Tagged_t kBuildDependentTheHoleValue = 0x6511;
+    static constexpr Tagged_t kBuildDependentTheHoleValue = 0x6559;
 #else
-    static constexpr Tagged_t kBuildDependentTheHoleValue = 0x5875;
+    static constexpr Tagged_t kBuildDependentTheHoleValue = 0x58bd;
 #endif
 #endif
 
@@ -1383,6 +1378,34 @@ class Internals {
 #endif  // V8_ENABLE_SANDBOX
   }
 
+  V8_INLINE static Address ReadExternalPointerField(
+      v8::Isolate* isolate, Address heap_object_ptr, int offset,
+      ExternalPointerTagRange tag_range) {
+#ifdef V8_ENABLE_SANDBOX
+    // See src/sandbox/external-pointer-table.h. Logic duplicated here so
+    // it can be inlined and doesn't require an additional call.
+    Address* table = IsSharedExternalPointerType(tag_range)
+                         ? GetSharedExternalPointerTableBase(isolate)
+                         : GetExternalPointerTableBase(isolate);
+    internal::ExternalPointerHandle handle =
+        ReadRawField<ExternalPointerHandle>(heap_object_ptr, offset);
+    uint32_t index = handle >> kExternalPointerIndexShift;
+    std::atomic<Address>* ptr =
+        reinterpret_cast<std::atomic<Address>*>(&table[index]);
+    Address entry = std::atomic_load_explicit(ptr, std::memory_order_relaxed);
+    ExternalPointerTag actual_tag = static_cast<ExternalPointerTag>(
+        (entry & kExternalPointerTagMask) >> kExternalPointerTagShift);
+    if (V8_LIKELY(tag_range.Contains(actual_tag))) {
+      return entry & kExternalPointerPayloadMask;
+    } else {
+      return 0;
+    }
+    return entry;
+#else
+    return ReadRawField<Address>(heap_object_ptr, offset);
+#endif  // V8_ENABLE_SANDBOX
+  }
+
 #ifdef V8_COMPRESS_POINTERS
   V8_INLINE static Address GetPtrComprCageBaseFromOnHeapAddress(Address addr) {
     return addr & -static_cast<intptr_t>(kPtrComprCageBaseAlignment);
diff --git a/deps/v8/include/v8-isolate.h b/deps/v8/include/v8-isolate.h
index 16c61f605f9..f8c17e23fce 100644
--- a/deps/v8/include/v8-isolate.h
+++ b/deps/v8/include/v8-isolate.h
@@ -1709,7 +1709,7 @@ class V8_EXPORT Isolate {
   void SetWasmLoadSourceMapCallback(WasmLoadSourceMapCallback callback);
 
   void SetWasmImportedStringsEnabledCallback(
-      WasmImportedStringsEnabledCallback callback);
+      WasmImportedStringsEnabledCallback callback) {}
 
   void SetWasmCustomDescriptorsEnabledCallback(
       WasmCustomDescriptorsEnabledCallback callback);
@@ -1717,7 +1717,7 @@ class V8_EXPORT Isolate {
   void SetSharedArrayBufferConstructorEnabledCallback(
       SharedArrayBufferConstructorEnabledCallback callback);
 
-  void SetWasmJSPIEnabledCallback(WasmJSPIEnabledCallback callback);
+  void SetWasmJSPIEnabledCallback(WasmJSPIEnabledCallback callback) {}
 
   /**
    * This function can be called by the embedder to signal V8 that the dynamic
diff --git a/deps/v8/include/v8-object.h b/deps/v8/include/v8-object.h
index 860cecaadc3..5d25b069438 100644
--- a/deps/v8/include/v8-object.h
+++ b/deps/v8/include/v8-object.h
@@ -33,6 +33,11 @@ class PropertyCallbackInfo;
  */
 using EmbedderDataTypeTag = uint16_t;
 
+constexpr EmbedderDataTypeTag kEmbedderDataTypeTagDefault = 0;
+
+V8_EXPORT internal::ExternalPointerTag ToExternalPointerTag(
+    v8::EmbedderDataTypeTag api_tag);
+
 /**
  * A private symbol
  *
@@ -177,10 +182,10 @@ using AccessorNameSetterCallback =
  * the kind of cross-context access that should be allowed.
  *
  */
-enum V8_DEPRECATE_SOON(
-    "This enum is no longer used and will be removed in V8 12.9.")
+enum V8_DEPRECATED(
+    "This enum is no longer used and will be removed in V8 14.3.")
     AccessControl {
-      DEFAULT V8_ENUM_DEPRECATE_SOON("not used") = 0,
+      DEFAULT V8_ENUM_DEPRECATED("not used") = 0,
     };
 
 /**
@@ -466,8 +471,7 @@ class V8_EXPORT Object : public Value {
   /**
    * Set the prototype object (same as calling Object.setPrototypeOf(..)).
    * This does not consult the security handler.
-   * TODO(333672197): rename back to SetPrototype() once the old version goes
-   * through the deprecation process and is removed.
+   * TODO(http://crbug.com/333672197): rename back to SetPrototype().
    */
   V8_WARN_UNUSED_RESULT Maybe<bool> SetPrototypeV2(Local<Context> context,
                                                    Local<Value> prototype);
@@ -531,11 +535,40 @@ class V8_EXPORT Object : public Value {
    * must have been set by SetAlignedPointerInInternalField, everything else
    * leads to undefined behavior.
    */
-  V8_INLINE void* GetAlignedPointerFromInternalField(int index);
+  V8_INLINE void* GetAlignedPointerFromInternalField(int index,
+                                                     EmbedderDataTypeTag tag);
   V8_INLINE void* GetAlignedPointerFromInternalField(v8::Isolate* isolate,
-                                                     int index);
+                                                     int index,
+                                                     EmbedderDataTypeTag tag);
+
+  V8_DEPRECATE_SOON(
+      "Use GetAlignedPointerFromInternalField with EmbedderDataTypeTag "
+      "parameter instead.")
+  V8_INLINE void* GetAlignedPointerFromInternalField(int index) {
+    return GetAlignedPointerFromInternalField(index,
+                                              kEmbedderDataTypeTagDefault);
+  }
+
+  V8_DEPRECATE_SOON(
+      "Use GetAlignedPointerFromInternalField with EmbedderDataTypeTag "
+      "parameter instead.")
+  V8_INLINE void* GetAlignedPointerFromInternalField(v8::Isolate* isolate,
+                                                     int index) {
+    return GetAlignedPointerFromInternalField(isolate, index,
+                                              kEmbedderDataTypeTagDefault);
+  }
 
   /** Same as above, but works for PersistentBase. */
+  V8_INLINE static void* GetAlignedPointerFromInternalField(
+      const PersistentBase<Object>& object, int index,
+      EmbedderDataTypeTag tag) {
+    return object.template value<Object>()->GetAlignedPointerFromInternalField(
+        index, tag);
+  }
+
+  V8_DEPRECATE_SOON(
+      "Use GetAlignedPointerFromInternalField with EmbedderDataTypeTag "
+      "parameter instead.")
   V8_INLINE static void* GetAlignedPointerFromInternalField(
       const PersistentBase<Object>& object, int index) {
     return object.template value<Object>()->GetAlignedPointerFromInternalField(
@@ -543,6 +576,16 @@ class V8_EXPORT Object : public Value {
   }
 
   /** Same as above, but works for TracedReference. */
+  V8_INLINE static void* GetAlignedPointerFromInternalField(
+      const BasicTracedReference<Object>& object, int index,
+      EmbedderDataTypeTag tag) {
+    return object.template value<Object>()->GetAlignedPointerFromInternalField(
+        index, tag);
+  }
+
+  V8_DEPRECATE_SOON(
+      "Use GetAlignedPointerFromInternalField with EmbedderDataTypeTag "
+      "parameter instead.")
   V8_INLINE static void* GetAlignedPointerFromInternalField(
       const BasicTracedReference<Object>& object, int index) {
     return object.template value<Object>()->GetAlignedPointerFromInternalField(
@@ -554,13 +597,15 @@ class V8_EXPORT Object : public Value {
    * a field, GetAlignedPointerFromInternalField must be used, everything else
    * leads to undefined behavior.
    */
+  void SetAlignedPointerInInternalField(int index, void* value,
+                                        EmbedderDataTypeTag tag);
+
   V8_DEPRECATE_SOON(
       "Use SetAlignedPointerInInternalField with EmbedderDataTypeTag parameter "
       "instead.")
-  void SetAlignedPointerInInternalField(int index, void* value);
-
-  void SetAlignedPointerInInternalField(int index, void* value,
-                                        EmbedderDataTypeTag tag);
+  void SetAlignedPointerInInternalField(int index, void* value) {
+    SetAlignedPointerInInternalField(index, value, kEmbedderDataTypeTagDefault);
+  }
 
   V8_DEPRECATE_SOON(
       "Use SetAlignedPointerInInternalField with EmbedderDataTypeTag "
@@ -795,9 +840,27 @@ class V8_EXPORT Object : public Value {
    * Prefer using version with Isolate parameter if you have an Isolate,
    * otherwise use the other one.
    */
+  void* GetAlignedPointerFromEmbedderDataInCreationContext(
+      v8::Isolate* isolate, int index, EmbedderDataTypeTag tag);
+  void* GetAlignedPointerFromEmbedderDataInCreationContext(
+      int index, EmbedderDataTypeTag tag);
+
+  V8_DEPRECATE_SOON(
+      "Use GetAlignedPointerFromEmbedderDataInCreationContext with "
+      "EmbedderDataTypeTag parameter instead.")
   void* GetAlignedPointerFromEmbedderDataInCreationContext(v8::Isolate* isolate,
-                                                           int index);
-  void* GetAlignedPointerFromEmbedderDataInCreationContext(int index);
+                                                           int index) {
+    return GetAlignedPointerFromEmbedderDataInCreationContext(
+        isolate, index, kEmbedderDataTypeTagDefault);
+  }
+
+  V8_DEPRECATE_SOON(
+      "Use GetAlignedPointerFromEmbedderDataInCreationContext with "
+      "EmbedderDataTypeTag parameter instead.")
+  void* GetAlignedPointerFromEmbedderDataInCreationContext(int index) {
+    return GetAlignedPointerFromEmbedderDataInCreationContext(
+        index, kEmbedderDataTypeTagDefault);
+  }
 
   /**
    * Checks whether a callback is set by the
@@ -909,8 +972,10 @@ class V8_EXPORT Object : public Value {
   Object();
   static void CheckCast(Value* obj);
   Local<Data> SlowGetInternalField(int index);
-  void* SlowGetAlignedPointerFromInternalField(int index);
-  void* SlowGetAlignedPointerFromInternalField(v8::Isolate* isolate, int index);
+  void* SlowGetAlignedPointerFromInternalField(int index,
+                                               EmbedderDataTypeTag tag);
+  void* SlowGetAlignedPointerFromInternalField(v8::Isolate* isolate, int index,
+                                               EmbedderDataTypeTag tag);
 };
 
 // --- Implementation ---
@@ -929,7 +994,7 @@ Local<Data> Object::GetInternalField(int index) {
     A value = I::ReadRawField<A>(obj, offset);
 #ifdef V8_COMPRESS_POINTERS
     // We read the full pointer value and then decompress it in order to avoid
-    // dealing with potential endiannes issues.
+    // dealing with potential endianness issues.
     value = I::DecompressTaggedField(obj, static_cast<uint32_t>(value));
 #endif
 
@@ -941,7 +1006,8 @@ Local<Data> Object::GetInternalField(int index) {
 }
 
 void* Object::GetAlignedPointerFromInternalField(v8::Isolate* isolate,
-                                                 int index) {
+                                                 int index,
+                                                 EmbedderDataTypeTag tag) {
 #if !defined(V8_ENABLE_CHECKS)
   using A = internal::Address;
   using I = internal::Internals;
@@ -953,17 +1019,16 @@ void* Object::GetAlignedPointerFromInternalField(v8::Isolate* isolate,
     int offset = I::kJSAPIObjectWithEmbedderSlotsHeaderSize +
                  (I::kEmbedderDataSlotSize * index) +
                  I::kEmbedderDataSlotExternalPointerOffset;
-    A value =
-        I::ReadExternalPointerField<{internal::kFirstEmbedderDataTag,
-                                     internal::kLastEmbedderDataTag}>(
-            isolate, obj, offset);
+    A value = I::ReadExternalPointerField(isolate, obj, offset,
+                                          ToExternalPointerTag(tag));
     return reinterpret_cast<void*>(value);
   }
 #endif
-  return SlowGetAlignedPointerFromInternalField(isolate, index);
+  return SlowGetAlignedPointerFromInternalField(isolate, index, tag);
 }
 
-void* Object::GetAlignedPointerFromInternalField(int index) {
+void* Object::GetAlignedPointerFromInternalField(int index,
+                                                 EmbedderDataTypeTag tag) {
 #if !defined(V8_ENABLE_CHECKS)
   using A = internal::Address;
   using I = internal::Internals;
@@ -976,14 +1041,12 @@ void* Object::GetAlignedPointerFromInternalField(int index) {
                  (I::kEmbedderDataSlotSize * index) +
                  I::kEmbedderDataSlotExternalPointerOffset;
     Isolate* isolate = I::GetCurrentIsolateForSandbox();
-    A value =
-        I::ReadExternalPointerField<{internal::kFirstEmbedderDataTag,
-                                     internal::kLastEmbedderDataTag}>(
-            isolate, obj, offset);
+    A value = I::ReadExternalPointerField(isolate, obj, offset,
+                                          ToExternalPointerTag(tag));
     return reinterpret_cast<void*>(value);
   }
 #endif
-  return SlowGetAlignedPointerFromInternalField(index);
+  return SlowGetAlignedPointerFromInternalField(index, tag);
 }
 
 // static
diff --git a/deps/v8/include/v8-profiler.h b/deps/v8/include/v8-profiler.h
index f7f88ba6c74..61f427ea47c 100644
--- a/deps/v8/include/v8-profiler.h
+++ b/deps/v8/include/v8-profiler.h
@@ -1041,6 +1041,8 @@ class V8_EXPORT HeapProfiler {
 
   /**
    * Callback interface for retrieving user friendly names of global objects.
+   *
+   * This interface will soon be deprecated in favour of ContextNameResolver.
    */
   class ObjectNameResolver {
    public:
@@ -1054,6 +1056,23 @@ class V8_EXPORT HeapProfiler {
     virtual ~ObjectNameResolver() = default;
   };
 
+  /**
+   * Callback interface for retrieving user friendly names of a V8::Context
+   * objects.
+   */
+  class ContextNameResolver {
+   public:
+    /**
+     * Returns name to be used in the heap snapshot for given node. Returned
+     * string must stay alive until snapshot collection is completed.
+     * If no user friendly name is available return nullptr.
+     */
+    virtual const char* GetName(Local<Context> context) = 0;
+
+   protected:
+    virtual ~ContextNameResolver() = default;
+  };
+
   enum class HeapSnapshotMode {
     /**
      * Heap snapshot for regular developers.
@@ -1083,6 +1102,10 @@ class V8_EXPORT HeapProfiler {
     // NOLINTNEXTLINE
     HeapSnapshotOptions() {}
 
+    // TODO(https://crbug.com/333672197): remove once ObjectNameResolver is
+    // removed.
+    ALLOW_COPY_AND_MOVE_WITH_DEPRECATED_FIELDS(HeapSnapshotOptions)
+
     /**
      * The control used to report intermediate progress to.
      */
@@ -1090,7 +1113,15 @@ class V8_EXPORT HeapProfiler {
     /**
      * The resolver used by the snapshot generator to get names for V8 objects.
      */
+    V8_DEPRECATE_SOON("Use context_name_resolver callback instead.")
     ObjectNameResolver* global_object_name_resolver = nullptr;
+    /**
+     * The resolver used by the snapshot generator to get names for v8::Context
+     * objects.
+     * In case both this and |global_object_name_resolver| callbacks are
+     * provided, this one will be used.
+     */
+    ContextNameResolver* context_name_resolver = nullptr;
     /**
      * Mode for taking the snapshot, see `HeapSnapshotMode`.
      */
@@ -1120,10 +1151,20 @@ class V8_EXPORT HeapProfiler {
    *
    * \returns the snapshot.
    */
+  V8_DEPRECATE_SOON("Use overload with ContextNameResolver* resolver instead.")
   const HeapSnapshot* TakeHeapSnapshot(
-      ActivityControl* control,
-      ObjectNameResolver* global_object_name_resolver = nullptr,
+      ActivityControl* control, ObjectNameResolver* global_object_name_resolver,
       bool hide_internals = true, bool capture_numeric_value = false);
+  const HeapSnapshot* TakeHeapSnapshot(ActivityControl* control,
+                                       ContextNameResolver* resolver,
+                                       bool hide_internals = true,
+                                       bool capture_numeric_value = false);
+  // TODO(333672197): remove this version once ObjectNameResolver* overload
+  // is removed.
+  const HeapSnapshot* TakeHeapSnapshot(ActivityControl* control,
+                                       std::nullptr_t resolver = nullptr,
+                                       bool hide_internals = true,
+                                       bool capture_numeric_value = false);
 
   /**
    * Obtains list of Detached JS Wrapper Objects. This functon calls garbage
diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h
index 9ef4d60891d..1f55ca3c03c 100644
--- a/deps/v8/include/v8-version.h
+++ b/deps/v8/include/v8-version.h
@@ -9,9 +9,9 @@
 // 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 14
-#define V8_MINOR_VERSION 1
-#define V8_BUILD_NUMBER 146
-#define V8_PATCH_LEVEL 11
+#define V8_MINOR_VERSION 2
+#define V8_BUILD_NUMBER 231
+#define V8_PATCH_LEVEL 14
 
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
diff --git a/deps/v8/include/v8config.h b/deps/v8/include/v8config.h
index d03363ac019..6dbda2b1b40 100644
--- a/deps/v8/include/v8config.h
+++ b/deps/v8/include/v8config.h
@@ -335,7 +335,6 @@ path. Add it with -I<path> to the command line
 //                                      - [[no_unique_address]] supported
 //  V8_HAS_CPP_ATTRIBUTE_LIFETIME_BOUND - [[clang::lifetimebound]] supported
 //  V8_HAS_BUILTIN_ADD_OVERFLOW         - __builtin_add_overflow() supported
-//  V8_HAS_BUILTIN_BIT_CAST             - __builtin_bit_cast() supported
 //  V8_HAS_BUILTIN_BSWAP16              - __builtin_bswap16() supported
 //  V8_HAS_BUILTIN_BSWAP32              - __builtin_bswap32() supported
 //  V8_HAS_BUILTIN_BSWAP64              - __builtin_bswap64() supported
@@ -418,7 +417,6 @@ path. Add it with -I<path> to the command line
 # define V8_HAS_BUILTIN_ADD_OVERFLOW (__has_builtin(__builtin_add_overflow))
 # define V8_HAS_BUILTIN_ASSUME (__has_builtin(__builtin_assume))
 # define V8_HAS_BUILTIN_ASSUME_ALIGNED (__has_builtin(__builtin_assume_aligned))
-# define V8_HAS_BUILTIN_BIT_CAST (__has_builtin(__builtin_bit_cast))
 # define V8_HAS_BUILTIN_BSWAP16 (__has_builtin(__builtin_bswap16))
 # define V8_HAS_BUILTIN_BSWAP32 (__has_builtin(__builtin_bswap32))
 # define V8_HAS_BUILTIN_BSWAP64 (__has_builtin(__builtin_bswap64))
@@ -473,9 +471,6 @@ path. Add it with -I<path> to the command line
 // for V8_HAS_CPP_ATTRIBUTE_NODISCARD. See https://crbug.com/v8/11707.
 
 # define V8_HAS_BUILTIN_ASSUME_ALIGNED 1
-# if __GNUC__ >= 11
-#  define V8_HAS_BUILTIN_BIT_CAST 1
-# endif
 # define V8_HAS_BUILTIN_CLZ 1
 # define V8_HAS_BUILTIN_CTZ 1
 # define V8_HAS_BUILTIN_EXPECT 1

targos and others added 19 commits October 25, 2025 09:51
PR-URL: nodejs#54077
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Paolo Insogna <[email protected]>
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
It's causing linker errors with node.lib in node-gyp and potentially
breaks other 3rd party tools

PR-URL: nodejs#56238
Refs: nodejs#55784
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
Reviewed-By: Paolo Insogna <[email protected]>
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
GCC emits warnings because of the trailing backslashes.

PR-URL: nodejs#58070
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
Reviewed-By: Paolo Insogna <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
PR-URL: nodejs#58070
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
Reviewed-By: Paolo Insogna <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
illumos pointers are VA48, can allocate from the top of the 64-bit range
as well.

PR-URL: nodejs#59805
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
In illumos, madvise(3C) now takes `void *` for its first argument
post-illumos#14418, but uses `caddr_t` pre-illumos#14418. This fix will
detect if the illumos mman.h file in use is pre-or-post-illumos#14418 so
builds can work either way.

PR-URL: nodejs#58237
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Original commit message:

    [runtime] Fastcase for empty getOwnPropertySymbols()

    Since symbols are not enumerable we can rule them out in case all
    properties are in the enum cache.

    Bug: 447154198
    Change-Id: Ib2d58b67e5058d98323fcebaef3daba88c6304b5
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6983286
    Commit-Queue: Olivier Flückiger <[email protected]>
    Reviewed-by: Toon Verwaest <[email protected]>
    Auto-Submit: Olivier Flückiger <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#102878}

Refs: v8/v8@f93055f
PR-URL: nodejs#60105
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Original commit message:

    Fix build on gcc

    This commit fixes two issues

    1.

    ```
    In file included from ../../src/compiler/turboshaft/assembler.h:37,
                     from ../../src/wasm/turboshaft-graph-interface.h:13,
                     from ../../src/wasm/function-compiler.cc:20:
    ../../src/compiler/turboshaft/builtin-call-descriptors.h:26:55: error: declaration of 'static constexpr v8::internal::compiler::turboshaft::detail::IndexTag<1> v8::internal::compiler::turboshaft::builtin::BigIntAdd::Arguments::index_counter(v8::internal::compiler::turboshaft::detail::IndexTag<1>)' changes meaning of 'index_counter' [-fpermissive]
    ```

    GCC is more strict on accessing the fields from a inner struct. The fix
    was to wrap the base declarations in a struct and have Arguments struct
    inheirt from the base.

    2. In maglev-ir.h and maglev-range-analysis.h fixed up `error: call to
    non-'constexpr'` issues.

    Change-Id: I175700665c7bbb4f07588e9cac3d55d9afce44d0
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6987408
    Reviewed-by: Jakob Linke <[email protected]>
    Commit-Queue: Jakob Linke <[email protected]>
    Reviewed-by: Milad Farazmand <[email protected]>
    Reviewed-by: Nico Hartmann <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#103041}

Refs: v8/v8@fed4744
Co-authored-by: Michaël Zasso <[email protected]>
PR-URL: nodejs#60111
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Original commit message:

    [objects] improve module linked status DCHECKs

    Improve DCHECKs that requires a module to be linked. This includes
    kLinked, kEvaluated, kEvaluatingAsync, kErrored and the missing
    kEvaluating. kEvaluating can be found when a cyclic module is been
    evaluated synchronously.

    Refs: nodejs#60111 (comment)
    Change-Id: Ie0b9be22f2d3b8208571d8b419da3505b9f57b65
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7031498
    Reviewed-by: Camillo Bruni <[email protected]>
    Commit-Queue: Chengzhong Wu <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#103203}

Refs: v8/v8@ff34ae2
PR-URL: nodejs#60111
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
- Remove `kGCCallbackFlagLastResort` GC callback flag
  Refs: v8/v8@2baf973
- Reintroduce `WasmImportedStringsEnabledCallback` as noop
  Refs: v8/v8@17e54fe
- Reintroduce `WasmJSPIEnabledCallback` as noop
  Refs: v8/v8@613c043
- Revert inheritance from `Data` in `DictionaryTemplate`
  Refs: v8/v8@a6bb35d
- Revert adding `contextId` to `V8InspectorClient::consoleAPIMessage` function
  Refs: v8/v8@f4d337d
- Revert increase of `V8_EMBEDDER_DATA_TAG_COUNT`
  Refs: v8/v8@ef4972e
- Reintroduce `v8::Object::SetPrototype`
  Refs: v8/v8@156d4e7
@targos targos added the help wanted Issues that need assistance from volunteers or PRs that need help to proceed. label Oct 25, 2025
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/gyp
  • @nodejs/security-wg
  • @nodejs/v8-update

@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. needs-ci PRs that need a full CI run. v25.x Issues that can be reproduced on v25.x or PRs targeting the v25.x-staging branch. v8 engine Issues and PRs related to the V8 dependency. labels Oct 25, 2025
@targos targos marked this pull request as draft October 25, 2025 08:57
@targos
Copy link
Member Author

targos commented Oct 25, 2025

To be clear: I'm not going to work more on this. I opened the PR in case someone else wants to try and finish it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Issues and PRs related to build files or the CI. help wanted Issues that need assistance from volunteers or PRs that need help to proceed. needs-ci PRs that need a full CI run. v8 engine Issues and PRs related to the V8 dependency. v25.x Issues that can be reproduced on v25.x or PRs targeting the v25.x-staging branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants