node-linux-arm64 24.9.0 → 25.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/CHANGELOG.md +177 -1729
  2. package/README.md +2 -2
  3. package/bin/node +0 -0
  4. package/include/node/common.gypi +1 -13
  5. package/include/node/config.gypi +10 -9
  6. package/include/node/cppgc/allocation.h +3 -3
  7. package/include/node/cppgc/cross-thread-persistent.h +25 -29
  8. package/include/node/cppgc/internal/finalizer-trait.h +1 -1
  9. package/include/node/cppgc/internal/gc-info.h +3 -3
  10. package/include/node/cppgc/internal/logging.h +2 -2
  11. package/include/node/cppgc/internal/name-trait.h +1 -1
  12. package/include/node/cppgc/internal/pointer-policies.h +3 -3
  13. package/include/node/cppgc/member.h +10 -4
  14. package/include/node/cppgc/persistent.h +14 -15
  15. package/include/node/cppgc/platform.h +1 -1
  16. package/include/node/cppgc/trace-trait.h +1 -2
  17. package/include/node/cppgc/visitor.h +14 -9
  18. package/include/node/js_native_api.h +12 -0
  19. package/include/node/node.h +34 -78
  20. package/include/node/node_version.h +3 -3
  21. package/include/node/openssl/archs/BSD-x86/asm/crypto/buildinf.h +1 -1
  22. package/include/node/openssl/archs/BSD-x86/asm/include/openssl/opensslv.h +7 -7
  23. package/include/node/openssl/archs/BSD-x86/asm_avx2/crypto/buildinf.h +1 -1
  24. package/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/opensslv.h +7 -7
  25. package/include/node/openssl/archs/BSD-x86/no-asm/crypto/buildinf.h +1 -1
  26. package/include/node/openssl/archs/BSD-x86/no-asm/include/openssl/opensslv.h +7 -7
  27. package/include/node/openssl/archs/BSD-x86_64/asm/crypto/buildinf.h +1 -1
  28. package/include/node/openssl/archs/BSD-x86_64/asm/include/openssl/opensslv.h +7 -7
  29. package/include/node/openssl/archs/BSD-x86_64/asm_avx2/crypto/buildinf.h +1 -1
  30. package/include/node/openssl/archs/BSD-x86_64/asm_avx2/include/openssl/opensslv.h +7 -7
  31. package/include/node/openssl/archs/BSD-x86_64/no-asm/crypto/buildinf.h +1 -1
  32. package/include/node/openssl/archs/BSD-x86_64/no-asm/include/openssl/opensslv.h +7 -7
  33. package/include/node/openssl/archs/VC-WIN32/asm/crypto/buildinf.h +1 -1
  34. package/include/node/openssl/archs/VC-WIN32/asm/include/openssl/opensslv.h +7 -7
  35. package/include/node/openssl/archs/VC-WIN32/asm_avx2/crypto/buildinf.h +1 -1
  36. package/include/node/openssl/archs/VC-WIN32/asm_avx2/include/openssl/opensslv.h +7 -7
  37. package/include/node/openssl/archs/VC-WIN32/no-asm/crypto/buildinf.h +1 -1
  38. package/include/node/openssl/archs/VC-WIN32/no-asm/include/openssl/opensslv.h +7 -7
  39. package/include/node/openssl/archs/VC-WIN64-ARM/no-asm/crypto/buildinf.h +1 -1
  40. package/include/node/openssl/archs/VC-WIN64-ARM/no-asm/include/openssl/opensslv.h +7 -7
  41. package/include/node/openssl/archs/VC-WIN64A/asm/crypto/buildinf.h +1 -1
  42. package/include/node/openssl/archs/VC-WIN64A/asm/include/openssl/opensslv.h +7 -7
  43. package/include/node/openssl/archs/VC-WIN64A/asm_avx2/crypto/buildinf.h +1 -1
  44. package/include/node/openssl/archs/VC-WIN64A/asm_avx2/include/openssl/opensslv.h +7 -7
  45. package/include/node/openssl/archs/VC-WIN64A/no-asm/crypto/buildinf.h +1 -1
  46. package/include/node/openssl/archs/VC-WIN64A/no-asm/include/openssl/opensslv.h +7 -7
  47. package/include/node/openssl/archs/aix64-gcc-as/asm/crypto/buildinf.h +1 -1
  48. package/include/node/openssl/archs/aix64-gcc-as/asm/include/openssl/opensslv.h +7 -7
  49. package/include/node/openssl/archs/aix64-gcc-as/asm_avx2/crypto/buildinf.h +1 -1
  50. package/include/node/openssl/archs/aix64-gcc-as/asm_avx2/include/openssl/opensslv.h +7 -7
  51. package/include/node/openssl/archs/aix64-gcc-as/no-asm/crypto/buildinf.h +1 -1
  52. package/include/node/openssl/archs/aix64-gcc-as/no-asm/include/openssl/opensslv.h +7 -7
  53. package/include/node/openssl/archs/darwin-i386-cc/asm/crypto/buildinf.h +1 -1
  54. package/include/node/openssl/archs/darwin-i386-cc/asm/include/openssl/opensslv.h +7 -7
  55. package/include/node/openssl/archs/darwin-i386-cc/asm_avx2/crypto/buildinf.h +1 -1
  56. package/include/node/openssl/archs/darwin-i386-cc/asm_avx2/include/openssl/opensslv.h +7 -7
  57. package/include/node/openssl/archs/darwin-i386-cc/no-asm/crypto/buildinf.h +1 -1
  58. package/include/node/openssl/archs/darwin-i386-cc/no-asm/include/openssl/opensslv.h +7 -7
  59. package/include/node/openssl/archs/darwin64-arm64-cc/asm/crypto/buildinf.h +1 -1
  60. package/include/node/openssl/archs/darwin64-arm64-cc/asm/include/openssl/opensslv.h +7 -7
  61. package/include/node/openssl/archs/darwin64-arm64-cc/asm_avx2/crypto/buildinf.h +1 -1
  62. package/include/node/openssl/archs/darwin64-arm64-cc/asm_avx2/include/openssl/opensslv.h +7 -7
  63. package/include/node/openssl/archs/darwin64-arm64-cc/no-asm/crypto/buildinf.h +1 -1
  64. package/include/node/openssl/archs/darwin64-arm64-cc/no-asm/include/openssl/opensslv.h +7 -7
  65. package/include/node/openssl/archs/darwin64-x86_64-cc/asm/crypto/buildinf.h +1 -1
  66. package/include/node/openssl/archs/darwin64-x86_64-cc/asm/include/openssl/opensslv.h +7 -7
  67. package/include/node/openssl/archs/darwin64-x86_64-cc/asm_avx2/crypto/buildinf.h +1 -1
  68. package/include/node/openssl/archs/darwin64-x86_64-cc/asm_avx2/include/openssl/opensslv.h +7 -7
  69. package/include/node/openssl/archs/darwin64-x86_64-cc/no-asm/crypto/buildinf.h +1 -1
  70. package/include/node/openssl/archs/darwin64-x86_64-cc/no-asm/include/openssl/opensslv.h +7 -7
  71. package/include/node/openssl/archs/linux-aarch64/asm/crypto/buildinf.h +1 -1
  72. package/include/node/openssl/archs/linux-aarch64/asm/include/openssl/opensslv.h +7 -7
  73. package/include/node/openssl/archs/linux-aarch64/asm_avx2/crypto/buildinf.h +1 -1
  74. package/include/node/openssl/archs/linux-aarch64/asm_avx2/include/openssl/opensslv.h +7 -7
  75. package/include/node/openssl/archs/linux-aarch64/no-asm/crypto/buildinf.h +1 -1
  76. package/include/node/openssl/archs/linux-aarch64/no-asm/include/openssl/opensslv.h +7 -7
  77. package/include/node/openssl/archs/linux-armv4/asm/crypto/buildinf.h +1 -1
  78. package/include/node/openssl/archs/linux-armv4/asm/include/openssl/opensslv.h +7 -7
  79. package/include/node/openssl/archs/linux-armv4/asm_avx2/crypto/buildinf.h +1 -1
  80. package/include/node/openssl/archs/linux-armv4/asm_avx2/include/openssl/opensslv.h +7 -7
  81. package/include/node/openssl/archs/linux-armv4/no-asm/crypto/buildinf.h +1 -1
  82. package/include/node/openssl/archs/linux-armv4/no-asm/include/openssl/opensslv.h +7 -7
  83. package/include/node/openssl/archs/linux-elf/asm/crypto/buildinf.h +1 -1
  84. package/include/node/openssl/archs/linux-elf/asm/include/openssl/opensslv.h +7 -7
  85. package/include/node/openssl/archs/linux-elf/asm_avx2/crypto/buildinf.h +1 -1
  86. package/include/node/openssl/archs/linux-elf/asm_avx2/include/openssl/opensslv.h +7 -7
  87. package/include/node/openssl/archs/linux-elf/no-asm/crypto/buildinf.h +1 -1
  88. package/include/node/openssl/archs/linux-elf/no-asm/include/openssl/opensslv.h +7 -7
  89. package/include/node/openssl/archs/linux-ppc64le/asm/crypto/buildinf.h +1 -1
  90. package/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/opensslv.h +7 -7
  91. package/include/node/openssl/archs/linux-ppc64le/asm_avx2/crypto/buildinf.h +1 -1
  92. package/include/node/openssl/archs/linux-ppc64le/asm_avx2/include/openssl/opensslv.h +7 -7
  93. package/include/node/openssl/archs/linux-ppc64le/no-asm/crypto/buildinf.h +1 -1
  94. package/include/node/openssl/archs/linux-ppc64le/no-asm/include/openssl/opensslv.h +7 -7
  95. package/include/node/openssl/archs/linux-x86_64/asm/crypto/buildinf.h +1 -1
  96. package/include/node/openssl/archs/linux-x86_64/asm/include/openssl/opensslv.h +7 -7
  97. package/include/node/openssl/archs/linux-x86_64/asm_avx2/crypto/buildinf.h +1 -1
  98. package/include/node/openssl/archs/linux-x86_64/asm_avx2/include/openssl/opensslv.h +7 -7
  99. package/include/node/openssl/archs/linux-x86_64/no-asm/crypto/buildinf.h +1 -1
  100. package/include/node/openssl/archs/linux-x86_64/no-asm/include/openssl/opensslv.h +7 -7
  101. package/include/node/openssl/archs/linux32-s390x/asm/crypto/buildinf.h +1 -1
  102. package/include/node/openssl/archs/linux32-s390x/asm/include/openssl/opensslv.h +7 -7
  103. package/include/node/openssl/archs/linux32-s390x/asm_avx2/crypto/buildinf.h +1 -1
  104. package/include/node/openssl/archs/linux32-s390x/asm_avx2/include/openssl/opensslv.h +7 -7
  105. package/include/node/openssl/archs/linux32-s390x/no-asm/crypto/buildinf.h +1 -1
  106. package/include/node/openssl/archs/linux32-s390x/no-asm/include/openssl/opensslv.h +7 -7
  107. package/include/node/openssl/archs/linux64-loongarch64/no-asm/crypto/buildinf.h +1 -1
  108. package/include/node/openssl/archs/linux64-loongarch64/no-asm/include/openssl/opensslv.h +7 -7
  109. package/include/node/openssl/archs/linux64-mips64/asm/crypto/buildinf.h +1 -1
  110. package/include/node/openssl/archs/linux64-mips64/asm/include/openssl/opensslv.h +7 -7
  111. package/include/node/openssl/archs/linux64-mips64/asm_avx2/crypto/buildinf.h +1 -1
  112. package/include/node/openssl/archs/linux64-mips64/asm_avx2/include/openssl/opensslv.h +7 -7
  113. package/include/node/openssl/archs/linux64-mips64/no-asm/crypto/buildinf.h +1 -1
  114. package/include/node/openssl/archs/linux64-mips64/no-asm/include/openssl/opensslv.h +7 -7
  115. package/include/node/openssl/archs/linux64-riscv64/no-asm/crypto/buildinf.h +1 -1
  116. package/include/node/openssl/archs/linux64-riscv64/no-asm/include/openssl/opensslv.h +7 -7
  117. package/include/node/openssl/archs/linux64-s390x/asm/crypto/buildinf.h +1 -1
  118. package/include/node/openssl/archs/linux64-s390x/asm/include/openssl/opensslv.h +7 -7
  119. package/include/node/openssl/archs/linux64-s390x/asm_avx2/crypto/buildinf.h +1 -1
  120. package/include/node/openssl/archs/linux64-s390x/asm_avx2/include/openssl/opensslv.h +7 -7
  121. package/include/node/openssl/archs/linux64-s390x/no-asm/crypto/buildinf.h +1 -1
  122. package/include/node/openssl/archs/linux64-s390x/no-asm/include/openssl/opensslv.h +7 -7
  123. package/include/node/openssl/archs/solaris-x86-gcc/asm/crypto/buildinf.h +1 -1
  124. package/include/node/openssl/archs/solaris-x86-gcc/asm/include/openssl/opensslv.h +7 -7
  125. package/include/node/openssl/archs/solaris-x86-gcc/asm_avx2/crypto/buildinf.h +1 -1
  126. package/include/node/openssl/archs/solaris-x86-gcc/asm_avx2/include/openssl/opensslv.h +7 -7
  127. package/include/node/openssl/archs/solaris-x86-gcc/no-asm/crypto/buildinf.h +1 -1
  128. package/include/node/openssl/archs/solaris-x86-gcc/no-asm/include/openssl/opensslv.h +7 -7
  129. package/include/node/openssl/archs/solaris64-x86_64-gcc/asm/crypto/buildinf.h +1 -1
  130. package/include/node/openssl/archs/solaris64-x86_64-gcc/asm/include/openssl/opensslv.h +7 -7
  131. package/include/node/openssl/archs/solaris64-x86_64-gcc/asm_avx2/crypto/buildinf.h +1 -1
  132. package/include/node/openssl/archs/solaris64-x86_64-gcc/asm_avx2/include/openssl/opensslv.h +7 -7
  133. package/include/node/openssl/archs/solaris64-x86_64-gcc/no-asm/crypto/buildinf.h +1 -1
  134. package/include/node/openssl/archs/solaris64-x86_64-gcc/no-asm/include/openssl/opensslv.h +7 -7
  135. package/include/node/v8-array-buffer.h +1 -1
  136. package/include/node/v8-callbacks.h +3 -4
  137. package/include/node/v8-context.h +15 -5
  138. package/include/node/v8-data.h +5 -0
  139. package/include/node/v8-debug.h +11 -0
  140. package/include/node/v8-function-callback.h +26 -26
  141. package/include/node/v8-internal.h +136 -36
  142. package/include/node/v8-isolate.h +75 -16
  143. package/include/node/v8-json.h +8 -1
  144. package/include/node/v8-local-handle.h +112 -13
  145. package/include/node/v8-maybe.h +34 -10
  146. package/include/node/v8-memory-span.h +9 -4
  147. package/include/node/v8-message.h +3 -0
  148. package/include/node/v8-object.h +87 -24
  149. package/include/node/v8-persistent-handle.h +4 -4
  150. package/include/node/v8-platform.h +92 -28
  151. package/include/node/v8-primitive.h +22 -9
  152. package/include/node/v8-profiler.h +4 -0
  153. package/include/node/v8-sandbox.h +16 -0
  154. package/include/node/v8-source-location.h +19 -26
  155. package/include/node/v8-template.h +37 -15
  156. package/include/node/v8-traced-handle.h +6 -6
  157. package/include/node/v8-unwinder.h +13 -0
  158. package/include/node/v8-version.h +4 -4
  159. package/include/node/v8config.h +65 -5
  160. package/package.json +5 -1
  161. package/share/doc/node/gdbinit +221 -4
  162. package/share/man/man1/node.1 +21 -4
@@ -237,6 +237,12 @@ using SandboxedPointer_t = Address;
237
237
  // virtual address space for userspace. As such, limit the sandbox to 128GB (a
238
238
  // quarter of the total available address space).
239
239
  constexpr size_t kSandboxSizeLog2 = 37; // 128 GB
240
+ #elif defined(V8_TARGET_OS_IOS)
241
+ // On iOS, we only get 64 GB of usable virtual address space even with the
242
+ // "jumbo" extended virtual addressing entitlement. Limit the sandbox size to
243
+ // 16 GB so that the base address + size for the emulated virtual address space
244
+ // lies within the 64 GB total virtual address space.
245
+ constexpr size_t kSandboxSizeLog2 = 34; // 16 GB
240
246
  #else
241
247
  // Everywhere else use a 1TB sandbox.
242
248
  constexpr size_t kSandboxSizeLog2 = 40; // 1 TB
@@ -415,6 +421,11 @@ constexpr size_t kMaxCppHeapPointers = 0;
415
421
 
416
422
  #endif // V8_COMPRESS_POINTERS
417
423
 
424
+ // The number of tags reserved for embedder data. The value is picked
425
+ // arbitrarily. In Chrome there are 4 embedders, so at least 4 tags are needed.
426
+ // A generic tag was used for embedder data before, so one tag is used for that.
427
+ #define V8_EMBEDDER_DATA_TAG_COUNT 5
428
+
418
429
  // Generic tag range struct to represent ranges of type tags.
419
430
  //
420
431
  // When referencing external objects via pointer tables, type tags are
@@ -551,7 +562,11 @@ enum ExternalPointerTag : uint16_t {
551
562
  // External pointers using these tags are kept in a per-Isolate external
552
563
  // pointer table and can only be accessed when this Isolate is active.
553
564
  kNativeContextMicrotaskQueueTag,
554
- kEmbedderDataSlotPayloadTag,
565
+
566
+ // Placeholders for embedder data.
567
+ kFirstEmbedderDataTag,
568
+ kLastEmbedderDataTag = kFirstEmbedderDataTag + V8_EMBEDDER_DATA_TAG_COUNT - 1,
569
+ kEmbedderDataSlotPayloadTag = kLastEmbedderDataTag,
555
570
  // This tag essentially stands for a `void*` pointer in the V8 API, and it is
556
571
  // the Embedder's responsibility to ensure type safety (against substitution)
557
572
  // and lifetime validity of these objects.
@@ -560,22 +575,16 @@ enum ExternalPointerTag : uint16_t {
560
575
  kFunctionTemplateInfoCallbackTag = kFirstMaybeReadOnlyExternalPointerTag,
561
576
  kAccessorInfoGetterTag,
562
577
  kAccessorInfoSetterTag,
563
- kLastMaybeReadOnlyExternalPointerTag = kAccessorInfoSetterTag,
564
- kWasmInternalFunctionCallTargetTag,
565
- kWasmTypeInfoNativeTypeTag,
566
- kWasmExportedFunctionDataSignatureTag,
567
- kWasmStackMemoryTag,
568
- kWasmIndirectFunctionTargetTag,
569
578
 
570
- // Foreigns
571
- kFirstForeignExternalPointerTag,
572
- kGenericForeignTag = kFirstForeignExternalPointerTag,
573
- kApiNamedPropertyQueryCallbackTag,
579
+ // InterceptorInfo external pointers.
580
+ kFirstInterceptorInfoExternalPointerTag,
581
+ kApiNamedPropertyQueryCallbackTag = kFirstInterceptorInfoExternalPointerTag,
574
582
  kApiNamedPropertyGetterCallbackTag,
575
583
  kApiNamedPropertySetterCallbackTag,
576
584
  kApiNamedPropertyDescriptorCallbackTag,
577
585
  kApiNamedPropertyDefinerCallbackTag,
578
586
  kApiNamedPropertyDeleterCallbackTag,
587
+ kApiNamedPropertyEnumeratorCallbackTag,
579
588
  kApiIndexedPropertyQueryCallbackTag,
580
589
  kApiIndexedPropertyGetterCallbackTag,
581
590
  kApiIndexedPropertySetterCallbackTag,
@@ -583,6 +592,17 @@ enum ExternalPointerTag : uint16_t {
583
592
  kApiIndexedPropertyDefinerCallbackTag,
584
593
  kApiIndexedPropertyDeleterCallbackTag,
585
594
  kApiIndexedPropertyEnumeratorCallbackTag,
595
+ kLastInterceptorInfoExternalPointerTag =
596
+ kApiIndexedPropertyEnumeratorCallbackTag,
597
+
598
+ kLastMaybeReadOnlyExternalPointerTag = kLastInterceptorInfoExternalPointerTag,
599
+
600
+ kWasmStackMemoryTag,
601
+
602
+ // Foreigns
603
+ kFirstForeignExternalPointerTag,
604
+ kGenericForeignTag = kFirstForeignExternalPointerTag,
605
+
586
606
  kApiAccessCheckCallbackTag,
587
607
  kApiAbortScriptExecutionCallbackTag,
588
608
  kSyntheticModuleTag,
@@ -611,6 +631,14 @@ enum ExternalPointerTag : uint16_t {
611
631
  kIcuLocalizedNumberFormatterTag,
612
632
  kIcuPluralRulesTag,
613
633
  kIcuCollatorTag,
634
+ kTemporalDurationTag,
635
+ kTemporalInstantTag,
636
+ kTemporalPlainDateTag,
637
+ kTemporalPlainTimeTag,
638
+ kTemporalPlainDateTimeTag,
639
+ kTemporalPlainYearMonthTag,
640
+ kTemporalPlainMonthDayTag,
641
+ kTemporalZonedDateTimeTag,
614
642
  kDisplayNamesInternalTag,
615
643
  kD8WorkerTag,
616
644
  kD8ModuleEmbedderDataTag,
@@ -636,6 +664,9 @@ constexpr ExternalPointerTagRange kAnySharedExternalPointerTagRange(
636
664
  kFirstSharedExternalPointerTag, kLastSharedExternalPointerTag);
637
665
  constexpr ExternalPointerTagRange kAnyForeignExternalPointerTagRange(
638
666
  kFirstForeignExternalPointerTag, kLastForeignExternalPointerTag);
667
+ constexpr ExternalPointerTagRange kAnyInterceptorInfoExternalPointerTagRange(
668
+ kFirstInterceptorInfoExternalPointerTag,
669
+ kLastInterceptorInfoExternalPointerTag);
639
670
  constexpr ExternalPointerTagRange kAnyManagedExternalPointerTagRange(
640
671
  kFirstManagedExternalPointerTag, kLastManagedExternalPointerTag);
641
672
  constexpr ExternalPointerTagRange kAnyMaybeReadOnlyExternalPointerTagRange(
@@ -678,7 +709,9 @@ V8_INLINE static constexpr bool IsManagedExternalPointerType(
678
709
  V8_INLINE static constexpr bool ExternalPointerCanBeEmpty(
679
710
  ExternalPointerTagRange tag_range) {
680
711
  return tag_range.Contains(kArrayBufferExtensionTag) ||
681
- tag_range.Contains(kEmbedderDataSlotPayloadTag);
712
+ (tag_range.first <= kLastEmbedderDataTag &&
713
+ kFirstEmbedderDataTag <= tag_range.last) ||
714
+ kAnyInterceptorInfoExternalPointerTagRange.Contains(tag_range);
682
715
  }
683
716
 
684
717
  // Indirect Pointers.
@@ -802,12 +835,33 @@ constexpr bool kAllCodeObjectsLiveInTrustedSpace =
802
835
 
803
836
  // {obj} must be the raw tagged pointer representation of a HeapObject
804
837
  // that's guaranteed to never be in ReadOnlySpace.
838
+ V8_DEPRECATE_SOON(
839
+ "Use GetCurrentIsolate() instead, which is guaranteed to return the same "
840
+ "isolate since https://crrev.com/c/6458560.")
805
841
  V8_EXPORT internal::Isolate* IsolateFromNeverReadOnlySpaceObject(Address obj);
806
842
 
807
843
  // Returns if we need to throw when an error occurs. This infers the language
808
844
  // mode based on the current context and the closure. This returns true if the
809
845
  // language mode is strict.
810
846
  V8_EXPORT bool ShouldThrowOnError(internal::Isolate* isolate);
847
+
848
+ struct HandleScopeData final {
849
+ static constexpr uint32_t kSizeInBytes =
850
+ 2 * kApiSystemPointerSize + 2 * kApiInt32Size;
851
+
852
+ Address* next;
853
+ Address* limit;
854
+ int level;
855
+ int sealed_level;
856
+
857
+ void Initialize() {
858
+ next = limit = nullptr;
859
+ sealed_level = level = 0;
860
+ }
861
+ };
862
+
863
+ static_assert(HandleScopeData::kSizeInBytes == sizeof(HandleScopeData));
864
+
811
865
  /**
812
866
  * This class exports constants and functionality from within v8 that
813
867
  * is necessary to implement inline functions in the v8 api. Don't
@@ -861,14 +915,19 @@ class Internals {
861
915
  static const int kBuiltinTier0EntryTableSize = 7 * kApiSystemPointerSize;
862
916
  static const int kBuiltinTier0TableSize = 7 * kApiSystemPointerSize;
863
917
  static const int kLinearAllocationAreaSize = 3 * kApiSystemPointerSize;
864
- static const int kThreadLocalTopSize = 30 * kApiSystemPointerSize;
918
+ static const int kThreadLocalTopSize = 29 * kApiSystemPointerSize;
865
919
  static const int kHandleScopeDataSize =
866
920
  2 * kApiSystemPointerSize + 2 * kApiInt32Size;
867
921
 
868
922
  // ExternalPointerTable and TrustedPointerTable layout guarantees.
869
923
  static const int kExternalPointerTableBasePointerOffset = 0;
870
- static const int kExternalPointerTableSize = 2 * kApiSystemPointerSize;
871
- static const int kTrustedPointerTableSize = 2 * kApiSystemPointerSize;
924
+ static const int kSegmentedTableSegmentPoolSize = 4;
925
+ static const int kExternalPointerTableSize =
926
+ 4 * kApiSystemPointerSize +
927
+ kSegmentedTableSegmentPoolSize * sizeof(uint32_t);
928
+ static const int kTrustedPointerTableSize =
929
+ 4 * kApiSystemPointerSize +
930
+ kSegmentedTableSegmentPoolSize * sizeof(uint32_t);
872
931
  static const int kTrustedPointerTableBasePointerOffset = 0;
873
932
 
874
933
  // IsolateData layout guarantees.
@@ -888,12 +947,14 @@ class Internals {
888
947
  kBuiltinTier0TableOffset + kBuiltinTier0TableSize;
889
948
  static const int kOldAllocationInfoOffset =
890
949
  kNewAllocationInfoOffset + kLinearAllocationAreaSize;
950
+ static const int kLastYoungAllocationOffset =
951
+ kOldAllocationInfoOffset + kApiSystemPointerSize;
891
952
 
892
953
  static const int kFastCCallAlignmentPaddingSize =
893
954
  kApiSystemPointerSize == 8 ? 5 * kApiSystemPointerSize
894
955
  : 1 * kApiSystemPointerSize;
895
956
  static const int kIsolateFastCCallCallerPcOffset =
896
- kOldAllocationInfoOffset + kLinearAllocationAreaSize +
957
+ kLastYoungAllocationOffset + kLinearAllocationAreaSize +
897
958
  kFastCCallAlignmentPaddingSize;
898
959
  static const int kIsolateFastCCallCallerFpOffset =
899
960
  kIsolateFastCCallCallerPcOffset + kApiSystemPointerSize;
@@ -935,8 +996,10 @@ class Internals {
935
996
  static const int kIsolateApiCallbackThunkArgumentOffset =
936
997
  kIsolateEmbedderDataOffset + kNumIsolateDataSlots * kApiSystemPointerSize;
937
998
  #endif // V8_COMPRESS_POINTERS
938
- static const int kIsolateRegexpExecVectorArgumentOffset =
999
+ static const int kJSDispatchTableOffset =
939
1000
  kIsolateApiCallbackThunkArgumentOffset + kApiSystemPointerSize;
1001
+ static const int kIsolateRegexpExecVectorArgumentOffset =
1002
+ kJSDispatchTableOffset + kApiSystemPointerSize;
940
1003
  static const int kContinuationPreservedEmbedderDataOffset =
941
1004
  kIsolateRegexpExecVectorArgumentOffset + kApiSystemPointerSize;
942
1005
  static const int kIsolateRootsOffset =
@@ -949,16 +1012,32 @@ class Internals {
949
1012
  #if V8_STATIC_ROOTS_BOOL
950
1013
 
951
1014
  // These constants are copied from static-roots.h and guarded by static asserts.
952
- #define EXPORTED_STATIC_ROOTS_PTR_LIST(V) \
953
- V(UndefinedValue, 0x11) \
954
- V(NullValue, 0x2d) \
955
- V(TrueValue, 0x71) \
956
- V(FalseValue, 0x55) \
957
- V(EmptyString, 0x49) \
958
- V(TheHoleValue, 0x761)
1015
+ #define EXPORTED_STATIC_ROOTS_PTR_LIST(V) \
1016
+ V(UndefinedValue, 0x11) \
1017
+ V(NullValue, 0x2d) \
1018
+ V(TrueValue, 0x71) \
1019
+ V(FalseValue, 0x55) \
1020
+ V(EmptyString, 0x49) \
1021
+ /* The Hole moves around depending on build flags, so define it */ \
1022
+ /* separately inside StaticReadOnlyRoot using build macros */ \
1023
+ V(TheHoleValue, kBuildDependentTheHoleValue)
959
1024
 
960
1025
  using Tagged_t = uint32_t;
961
1026
  struct StaticReadOnlyRoot {
1027
+ #ifdef V8_ENABLE_WEBASSEMBLY
1028
+ #ifdef V8_INTL_SUPPORT
1029
+ static constexpr Tagged_t kBuildDependentTheHoleValue = 0x67b9;
1030
+ #else
1031
+ static constexpr Tagged_t kBuildDependentTheHoleValue = 0x5b1d;
1032
+ #endif
1033
+ #else
1034
+ #ifdef V8_INTL_SUPPORT
1035
+ static constexpr Tagged_t kBuildDependentTheHoleValue = 0x6511;
1036
+ #else
1037
+ static constexpr Tagged_t kBuildDependentTheHoleValue = 0x5875;
1038
+ #endif
1039
+ #endif
1040
+
962
1041
  #define DEF_ROOT(name, value) static constexpr Tagged_t k##name = value;
963
1042
  EXPORTED_STATIC_ROOTS_PTR_LIST(DEF_ROOT)
964
1043
  #undef DEF_ROOT
@@ -975,12 +1054,12 @@ class Internals {
975
1054
 
976
1055
  #endif // V8_STATIC_ROOTS_BOOL
977
1056
 
978
- static const int kUndefinedValueRootIndex = 4;
979
- static const int kTheHoleValueRootIndex = 5;
980
- static const int kNullValueRootIndex = 6;
981
- static const int kTrueValueRootIndex = 7;
982
- static const int kFalseValueRootIndex = 8;
983
- static const int kEmptyStringRootIndex = 9;
1057
+ static const int kUndefinedValueRootIndex = 0;
1058
+ static const int kTheHoleValueRootIndex = 1;
1059
+ static const int kNullValueRootIndex = 2;
1060
+ static const int kTrueValueRootIndex = 3;
1061
+ static const int kFalseValueRootIndex = 4;
1062
+ static const int kEmptyStringRootIndex = 5;
984
1063
 
985
1064
  static const int kNodeClassIdOffset = 1 * kApiSystemPointerSize;
986
1065
  static const int kNodeFlagsOffset = 1 * kApiSystemPointerSize + 3;
@@ -1157,6 +1236,12 @@ class Internals {
1157
1236
  return *reinterpret_cast<void* const*>(addr);
1158
1237
  }
1159
1238
 
1239
+ V8_INLINE static HandleScopeData* GetHandleScopeData(v8::Isolate* isolate) {
1240
+ Address addr =
1241
+ reinterpret_cast<Address>(isolate) + kIsolateHandleScopeDataOffset;
1242
+ return reinterpret_cast<HandleScopeData*>(addr);
1243
+ }
1244
+
1160
1245
  V8_INLINE static void IncrementLongTasksStatsCounter(v8::Isolate* isolate) {
1161
1246
  Address addr =
1162
1247
  reinterpret_cast<Address>(isolate) + kIsolateLongTaskStatsCounterOffset;
@@ -1209,7 +1294,7 @@ class Internals {
1209
1294
  V8_INLINE static T ReadRawField(Address heap_object_ptr, int offset) {
1210
1295
  Address addr = heap_object_ptr + offset - kHeapObjectTag;
1211
1296
  #ifdef V8_COMPRESS_POINTERS
1212
- if (sizeof(T) > kApiTaggedSize) {
1297
+ if constexpr (sizeof(T) > kApiTaggedSize) {
1213
1298
  // TODO(ishell, v8:8875): When pointer compression is enabled 8-byte size
1214
1299
  // fields (external pointers, doubles and BigInt data) are only
1215
1300
  // kTaggedSize aligned so we have to use unaligned pointer friendly way of
@@ -1243,10 +1328,25 @@ class Internals {
1243
1328
  #endif
1244
1329
  }
1245
1330
 
1331
+ V8_DEPRECATED(
1332
+ "Use GetCurrentIsolateForSandbox() instead, which is guaranteed to "
1333
+ "return the same isolate since https://crrev.com/c/6458560.")
1246
1334
  V8_INLINE static v8::Isolate* GetIsolateForSandbox(Address obj) {
1247
1335
  #ifdef V8_ENABLE_SANDBOX
1248
- return reinterpret_cast<v8::Isolate*>(
1249
- internal::IsolateFromNeverReadOnlySpaceObject(obj));
1336
+ return GetCurrentIsolate();
1337
+ #else
1338
+ // Not used in non-sandbox mode.
1339
+ return nullptr;
1340
+ #endif
1341
+ }
1342
+
1343
+ // Returns v8::Isolate::Current(), but without needing to include the
1344
+ // v8-isolate.h header.
1345
+ V8_EXPORT static v8::Isolate* GetCurrentIsolate();
1346
+
1347
+ V8_INLINE static v8::Isolate* GetCurrentIsolateForSandbox() {
1348
+ #ifdef V8_ENABLE_SANDBOX
1349
+ return GetCurrentIsolate();
1250
1350
  #else
1251
1351
  // Not used in non-sandbox mode.
1252
1352
  return nullptr;
@@ -1321,8 +1421,8 @@ void CastCheck<false>::Perform(T* data) {}
1321
1421
 
1322
1422
  template <class T>
1323
1423
  V8_INLINE void PerformCastCheck(T* data) {
1324
- CastCheck<std::is_base_of<Data, T>::value &&
1325
- !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
1424
+ CastCheck<std::is_base_of_v<Data, T> &&
1425
+ !std::is_same_v<Data, std::remove_cv_t<T>>>::Perform(data);
1326
1426
  }
1327
1427
 
1328
1428
  // A base class for backing stores, which is needed due to vagaries of
@@ -1331,7 +1431,7 @@ class BackingStoreBase {};
1331
1431
 
1332
1432
  // The maximum value in enum GarbageCollectionReason, defined in heap.h.
1333
1433
  // This is needed for histograms sampling garbage collection reasons.
1334
- constexpr int kGarbageCollectionReasonMaxValue = 29;
1434
+ constexpr int kGarbageCollectionReasonMaxValue = 30;
1335
1435
 
1336
1436
  // Base class for the address block allocator compatible with standard
1337
1437
  // containers, which registers its allocated range as strong roots.
@@ -154,6 +154,10 @@ class V8_EXPORT ResourceConstraints {
154
154
  initial_young_generation_size_ = initial_size;
155
155
  }
156
156
 
157
+ uint64_t physical_memory_size_in_bytes() const {
158
+ return physical_memory_size_;
159
+ }
160
+
157
161
  private:
158
162
  static constexpr size_t kMB = 1048576u;
159
163
  size_t code_range_size_ = 0;
@@ -161,6 +165,7 @@ class V8_EXPORT ResourceConstraints {
161
165
  size_t max_young_generation_size_ = 0;
162
166
  size_t initial_old_generation_size_ = 0;
163
167
  size_t initial_young_generation_size_ = 0;
168
+ uint64_t physical_memory_size_ = 0;
164
169
  uint32_t* stack_limit_ = nullptr;
165
170
  };
166
171
 
@@ -253,6 +258,17 @@ class V8_EXPORT IsolateGroup {
253
258
  return !operator==(other);
254
259
  }
255
260
 
261
+ #ifdef V8_ENABLE_SANDBOX
262
+ /**
263
+ * Whether the sandbox of the isolate group contains a given pointer.
264
+ * Will always return true if the sandbox is not enabled.
265
+ */
266
+ bool SandboxContains(void* pointer) const;
267
+ VirtualAddressSpace* GetSandboxAddressSpace();
268
+ #else
269
+ V8_INLINE bool SandboxContains(void* pointer) const { return true; }
270
+ #endif
271
+
256
272
  private:
257
273
  friend class Isolate;
258
274
  friend class ArrayBuffer::Allocator;
@@ -345,7 +361,9 @@ class V8_EXPORT Isolate {
345
361
  * for wrapped API objects and are used by the fast C API
346
362
  * (for details see v8-fast-api-calls.h).
347
363
  */
364
+ V8_DEPRECATE_SOON("This field is unused.")
348
365
  int embedder_wrapper_type_index = -1;
366
+ V8_DEPRECATE_SOON("This field is unused.")
349
367
  int embedder_wrapper_object_index = -1;
350
368
 
351
369
  /**
@@ -557,7 +575,8 @@ class V8_EXPORT Isolate {
557
575
  kBreakIteratorTypeWord = 88,
558
576
  kBreakIteratorTypeLine = 89,
559
577
  kInvalidatedArrayBufferDetachingProtector = 90,
560
- kInvalidatedArrayConstructorProtector = 91,
578
+ kInvalidatedArrayConstructorProtector V8_DEPRECATE_SOON(
579
+ "The ArrayConstructorProtector has been removed") = 91,
561
580
  kInvalidatedArrayIteratorLookupChainProtector = 92,
562
581
  kInvalidatedArraySpeciesLookupChainProtector = 93,
563
582
  kInvalidatedIsConcatSpreadableLookupChainProtector = 94,
@@ -575,8 +594,8 @@ class V8_EXPORT Isolate {
575
594
  kWasmSimdOpcodes = 106,
576
595
  kVarRedeclaredCatchBinding = 107,
577
596
  kWasmRefTypes = 108,
578
- kOBSOLETE_WasmBulkMemory = 109,
579
- kOBSOLETE_WasmMultiValue = 110,
597
+ kWasmBulkMemory = 109,
598
+ kWasmMultiValue = 110,
580
599
  kWasmExceptionHandling = 111,
581
600
  kInvalidatedMegaDOMProtector = 112,
582
601
  kFunctionPrototypeArguments = 113,
@@ -634,6 +653,21 @@ class V8_EXPORT Isolate {
634
653
  kFloat16Array = 165,
635
654
  kExplicitResourceManagement = 166,
636
655
  kWasmBranchHinting = 167,
656
+ kWasmMutableGlobals = 168,
657
+ kUint8ArrayToFromBase64AndHex = 169,
658
+ kAtomicsPause = 170,
659
+ kTopLevelAwait = 171,
660
+ kLogicalAssignment = 172,
661
+ kNullishCoalescing = 173,
662
+ kInvalidatedNoDateTimeConfigurationChangeProtector = 174,
663
+ kWasmNonTrappingFloatToInt = 175,
664
+ kWasmSignExtensionOps = 176,
665
+ kRegExpCompile = 177,
666
+ kRegExpStaticProperties = 178,
667
+ kRegExpStaticPropertiesWithLastMatch = 179,
668
+ kWithStatement = 180,
669
+ kHtmlWrapperMethods = 181,
670
+ kWasmCustomDescriptors = 182,
637
671
 
638
672
  // If you add new values here, you'll also need to update Chromium's:
639
673
  // web_feature.mojom, use_counter_callback.cc, and enums.xml. V8 changes to
@@ -937,14 +971,31 @@ class V8_EXPORT Isolate {
937
971
  * Returns the value that was set or restored by
938
972
  * SetContinuationPreservedEmbedderData(), if any.
939
973
  */
974
+ V8_DEPRECATED("Use GetContinuationPreservedEmbedderDataV2 instead")
940
975
  Local<Value> GetContinuationPreservedEmbedderData();
941
976
 
942
977
  /**
943
978
  * Sets a value that will be stored on continuations and reset while the
944
979
  * continuation runs.
945
980
  */
981
+ V8_DEPRECATED("Use SetContinuationPreservedEmbedderDataV2 instead")
946
982
  void SetContinuationPreservedEmbedderData(Local<Value> data);
947
983
 
984
+ /**
985
+ * Returns the value set by `SetContinuationPreservedEmbedderDataV2()` or
986
+ * restored during microtask execution for the currently running continuation,
987
+ * if any. Returns undefiend if no continuation preserved embedder data was
988
+ * set.
989
+ */
990
+ Local<Data> GetContinuationPreservedEmbedderDataV2();
991
+
992
+ /**
993
+ * Sets a value that will be stored on continuations and restored while the
994
+ * continuation runs. If `data` is empty, the continuation preserved embedder
995
+ * data is set to undefined.
996
+ */
997
+ void SetContinuationPreservedEmbedderDataV2(Local<Data> data);
998
+
948
999
  /**
949
1000
  * Get statistics about the heap memory usage.
950
1001
  */
@@ -1660,21 +1711,14 @@ class V8_EXPORT Isolate {
1660
1711
  void SetWasmImportedStringsEnabledCallback(
1661
1712
  WasmImportedStringsEnabledCallback callback);
1662
1713
 
1714
+ void SetWasmCustomDescriptorsEnabledCallback(
1715
+ WasmCustomDescriptorsEnabledCallback callback);
1716
+
1663
1717
  void SetSharedArrayBufferConstructorEnabledCallback(
1664
1718
  SharedArrayBufferConstructorEnabledCallback callback);
1665
1719
 
1666
1720
  void SetWasmJSPIEnabledCallback(WasmJSPIEnabledCallback callback);
1667
1721
 
1668
- /**
1669
- * Register callback to control whether compile hints magic comments are
1670
- * enabled.
1671
- */
1672
- V8_DEPRECATED(
1673
- "Will be removed, use ScriptCompiler::CompileOptions for enabling the "
1674
- "compile hints magic comments")
1675
- void SetJavaScriptCompileHintsMagicEnabledCallback(
1676
- JavaScriptCompileHintsMagicEnabledCallback callback);
1677
-
1678
1722
  /**
1679
1723
  * This function can be called by the embedder to signal V8 that the dynamic
1680
1724
  * enabling of features has finished. V8 can now set up dynamically added
@@ -1697,7 +1741,7 @@ class V8_EXPORT Isolate {
1697
1741
  * If data is specified, it will be passed to the callback when it is called.
1698
1742
  * Otherwise, the exception object will be passed to the callback instead.
1699
1743
  */
1700
- bool AddMessageListener(MessageCallback that,
1744
+ bool AddMessageListener(MessageCallback callback,
1701
1745
  Local<Value> data = Local<Value>());
1702
1746
 
1703
1747
  /**
@@ -1711,14 +1755,14 @@ class V8_EXPORT Isolate {
1711
1755
  *
1712
1756
  * A listener can listen for particular error levels by providing a mask.
1713
1757
  */
1714
- bool AddMessageListenerWithErrorLevel(MessageCallback that,
1758
+ bool AddMessageListenerWithErrorLevel(MessageCallback callback,
1715
1759
  int message_levels,
1716
1760
  Local<Value> data = Local<Value>());
1717
1761
 
1718
1762
  /**
1719
1763
  * Remove all message listeners from the specified callback function.
1720
1764
  */
1721
- void RemoveMessageListeners(MessageCallback that);
1765
+ void RemoveMessageListeners(MessageCallback callback);
1722
1766
 
1723
1767
  /** Callback function for reporting failed access checks.*/
1724
1768
  void SetFailedAccessCheckCallbackFunction(FailedAccessCheckCallback);
@@ -1789,6 +1833,21 @@ class V8_EXPORT Isolate {
1789
1833
  */
1790
1834
  std::string GetDefaultLocale();
1791
1835
 
1836
+ /**
1837
+ * Returns a canonical and case-regularized form of locale if Intl support is
1838
+ * enabled. If the locale is not syntactically well-formed, throws a
1839
+ * RangeError.
1840
+ *
1841
+ * If Intl support is not enabled, returns Nothing<std::string>().
1842
+ *
1843
+ * Corresponds to the combination of the abstract operations
1844
+ * IsStructurallyValidLanguageTag and CanonicalizeUnicodeLocaleId. See:
1845
+ * https://tc39.es/ecma402/#sec-isstructurallyvalidlanguagetag
1846
+ * https://tc39.es/ecma402/#sec-canonicalizeunicodelocaleid
1847
+ */
1848
+ V8_WARN_UNUSED_RESULT Maybe<std::string>
1849
+ ValidateAndCanonicalizeUnicodeLocaleId(std::string_view locale);
1850
+
1792
1851
  /**
1793
1852
  * Returns the hash seed for that isolate, for testing purposes.
1794
1853
  */
@@ -5,7 +5,10 @@
5
5
  #ifndef INCLUDE_V8_JSON_H_
6
6
  #define INCLUDE_V8_JSON_H_
7
7
 
8
+ #include <optional>
9
+
8
10
  #include "v8-local-handle.h" // NOLINT(build/include_directory)
11
+ #include "v8-message.h" // NOLINT(build/include_directory)
9
12
  #include "v8config.h" // NOLINT(build/include_directory)
10
13
 
11
14
  namespace v8 {
@@ -25,10 +28,14 @@ class V8_EXPORT JSON {
25
28
  *
26
29
  * \param the context in which to parse and create the value.
27
30
  * \param json_string The string to parse.
31
+ * \param origin Optional script origin to use for error reporting.
32
+ * If not provided, error reporting will use default origin options
33
+ * or attempt to infer origin from the current stack.
28
34
  * \return The corresponding value if successfully parsed.
29
35
  */
30
36
  static V8_WARN_UNUSED_RESULT MaybeLocal<Value> Parse(
31
- Local<Context> context, Local<String> json_string);
37
+ Local<Context> context, Local<String> json_string,
38
+ std::optional<ScriptOrigin> origin = std::nullopt);
32
39
 
33
40
  /**
34
41
  * Tries to stringify the JSON-serializable object |json_object| and returns