node-darwin-x64 24.8.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 (221) hide show
  1. package/CHANGELOG.md +177 -1642
  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 +12 -8
  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 +21 -1
  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/crypto.h +4 -4
  23. package/include/node/openssl/archs/BSD-x86/asm/include/openssl/opensslv.h +8 -13
  24. package/include/node/openssl/archs/BSD-x86/asm_avx2/crypto/buildinf.h +1 -1
  25. package/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/crypto.h +4 -4
  26. package/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/opensslv.h +8 -13
  27. package/include/node/openssl/archs/BSD-x86/no-asm/crypto/buildinf.h +1 -1
  28. package/include/node/openssl/archs/BSD-x86/no-asm/include/openssl/crypto.h +4 -4
  29. package/include/node/openssl/archs/BSD-x86/no-asm/include/openssl/opensslv.h +8 -13
  30. package/include/node/openssl/archs/BSD-x86_64/asm/crypto/buildinf.h +1 -1
  31. package/include/node/openssl/archs/BSD-x86_64/asm/include/openssl/crypto.h +4 -4
  32. package/include/node/openssl/archs/BSD-x86_64/asm/include/openssl/opensslv.h +8 -13
  33. package/include/node/openssl/archs/BSD-x86_64/asm_avx2/crypto/buildinf.h +1 -1
  34. package/include/node/openssl/archs/BSD-x86_64/asm_avx2/include/openssl/crypto.h +4 -4
  35. package/include/node/openssl/archs/BSD-x86_64/asm_avx2/include/openssl/opensslv.h +8 -13
  36. package/include/node/openssl/archs/BSD-x86_64/no-asm/crypto/buildinf.h +1 -1
  37. package/include/node/openssl/archs/BSD-x86_64/no-asm/include/openssl/crypto.h +4 -4
  38. package/include/node/openssl/archs/BSD-x86_64/no-asm/include/openssl/opensslv.h +8 -13
  39. package/include/node/openssl/archs/VC-WIN32/asm/crypto/buildinf.h +1 -1
  40. package/include/node/openssl/archs/VC-WIN32/asm/include/openssl/crypto.h +4 -4
  41. package/include/node/openssl/archs/VC-WIN32/asm/include/openssl/opensslv.h +8 -13
  42. package/include/node/openssl/archs/VC-WIN32/asm_avx2/crypto/buildinf.h +1 -1
  43. package/include/node/openssl/archs/VC-WIN32/asm_avx2/include/openssl/crypto.h +4 -4
  44. package/include/node/openssl/archs/VC-WIN32/asm_avx2/include/openssl/opensslv.h +8 -13
  45. package/include/node/openssl/archs/VC-WIN32/no-asm/crypto/buildinf.h +1 -1
  46. package/include/node/openssl/archs/VC-WIN32/no-asm/include/openssl/crypto.h +4 -4
  47. package/include/node/openssl/archs/VC-WIN32/no-asm/include/openssl/opensslv.h +8 -13
  48. package/include/node/openssl/archs/VC-WIN64-ARM/no-asm/crypto/buildinf.h +1 -1
  49. package/include/node/openssl/archs/VC-WIN64-ARM/no-asm/include/openssl/crypto.h +4 -4
  50. package/include/node/openssl/archs/VC-WIN64-ARM/no-asm/include/openssl/opensslv.h +8 -13
  51. package/include/node/openssl/archs/VC-WIN64A/asm/crypto/buildinf.h +1 -1
  52. package/include/node/openssl/archs/VC-WIN64A/asm/include/openssl/crypto.h +4 -4
  53. package/include/node/openssl/archs/VC-WIN64A/asm/include/openssl/opensslv.h +8 -13
  54. package/include/node/openssl/archs/VC-WIN64A/asm_avx2/crypto/buildinf.h +1 -1
  55. package/include/node/openssl/archs/VC-WIN64A/asm_avx2/include/openssl/crypto.h +4 -4
  56. package/include/node/openssl/archs/VC-WIN64A/asm_avx2/include/openssl/opensslv.h +8 -13
  57. package/include/node/openssl/archs/VC-WIN64A/no-asm/crypto/buildinf.h +1 -1
  58. package/include/node/openssl/archs/VC-WIN64A/no-asm/include/openssl/crypto.h +4 -4
  59. package/include/node/openssl/archs/VC-WIN64A/no-asm/include/openssl/opensslv.h +8 -13
  60. package/include/node/openssl/archs/aix64-gcc-as/asm/crypto/buildinf.h +1 -1
  61. package/include/node/openssl/archs/aix64-gcc-as/asm/include/openssl/crypto.h +4 -4
  62. package/include/node/openssl/archs/aix64-gcc-as/asm/include/openssl/opensslv.h +8 -13
  63. package/include/node/openssl/archs/aix64-gcc-as/asm_avx2/crypto/buildinf.h +1 -1
  64. package/include/node/openssl/archs/aix64-gcc-as/asm_avx2/include/openssl/crypto.h +4 -4
  65. package/include/node/openssl/archs/aix64-gcc-as/asm_avx2/include/openssl/opensslv.h +8 -13
  66. package/include/node/openssl/archs/aix64-gcc-as/no-asm/crypto/buildinf.h +1 -1
  67. package/include/node/openssl/archs/aix64-gcc-as/no-asm/include/openssl/crypto.h +4 -4
  68. package/include/node/openssl/archs/aix64-gcc-as/no-asm/include/openssl/opensslv.h +8 -13
  69. package/include/node/openssl/archs/darwin-i386-cc/asm/crypto/buildinf.h +1 -1
  70. package/include/node/openssl/archs/darwin-i386-cc/asm/include/openssl/crypto.h +4 -4
  71. package/include/node/openssl/archs/darwin-i386-cc/asm/include/openssl/opensslv.h +8 -13
  72. package/include/node/openssl/archs/darwin-i386-cc/asm_avx2/crypto/buildinf.h +1 -1
  73. package/include/node/openssl/archs/darwin-i386-cc/asm_avx2/include/openssl/crypto.h +4 -4
  74. package/include/node/openssl/archs/darwin-i386-cc/asm_avx2/include/openssl/opensslv.h +8 -13
  75. package/include/node/openssl/archs/darwin-i386-cc/no-asm/crypto/buildinf.h +1 -1
  76. package/include/node/openssl/archs/darwin-i386-cc/no-asm/include/openssl/crypto.h +4 -4
  77. package/include/node/openssl/archs/darwin-i386-cc/no-asm/include/openssl/opensslv.h +8 -13
  78. package/include/node/openssl/archs/darwin64-arm64-cc/asm/crypto/buildinf.h +1 -1
  79. package/include/node/openssl/archs/darwin64-arm64-cc/asm/include/openssl/crypto.h +4 -4
  80. package/include/node/openssl/archs/darwin64-arm64-cc/asm/include/openssl/opensslv.h +8 -13
  81. package/include/node/openssl/archs/darwin64-arm64-cc/asm_avx2/crypto/buildinf.h +1 -1
  82. package/include/node/openssl/archs/darwin64-arm64-cc/asm_avx2/include/openssl/crypto.h +4 -4
  83. package/include/node/openssl/archs/darwin64-arm64-cc/asm_avx2/include/openssl/opensslv.h +8 -13
  84. package/include/node/openssl/archs/darwin64-arm64-cc/no-asm/crypto/buildinf.h +1 -1
  85. package/include/node/openssl/archs/darwin64-arm64-cc/no-asm/include/openssl/crypto.h +4 -4
  86. package/include/node/openssl/archs/darwin64-arm64-cc/no-asm/include/openssl/opensslv.h +8 -13
  87. package/include/node/openssl/archs/darwin64-x86_64-cc/asm/crypto/buildinf.h +1 -1
  88. package/include/node/openssl/archs/darwin64-x86_64-cc/asm/include/openssl/crypto.h +4 -4
  89. package/include/node/openssl/archs/darwin64-x86_64-cc/asm/include/openssl/opensslv.h +8 -13
  90. package/include/node/openssl/archs/darwin64-x86_64-cc/asm_avx2/crypto/buildinf.h +1 -1
  91. package/include/node/openssl/archs/darwin64-x86_64-cc/asm_avx2/include/openssl/crypto.h +4 -4
  92. package/include/node/openssl/archs/darwin64-x86_64-cc/asm_avx2/include/openssl/opensslv.h +8 -13
  93. package/include/node/openssl/archs/darwin64-x86_64-cc/no-asm/crypto/buildinf.h +1 -1
  94. package/include/node/openssl/archs/darwin64-x86_64-cc/no-asm/include/openssl/crypto.h +4 -4
  95. package/include/node/openssl/archs/darwin64-x86_64-cc/no-asm/include/openssl/opensslv.h +8 -13
  96. package/include/node/openssl/archs/linux-aarch64/asm/crypto/buildinf.h +1 -1
  97. package/include/node/openssl/archs/linux-aarch64/asm/include/openssl/crypto.h +4 -4
  98. package/include/node/openssl/archs/linux-aarch64/asm/include/openssl/opensslv.h +8 -13
  99. package/include/node/openssl/archs/linux-aarch64/asm_avx2/crypto/buildinf.h +1 -1
  100. package/include/node/openssl/archs/linux-aarch64/asm_avx2/include/openssl/crypto.h +4 -4
  101. package/include/node/openssl/archs/linux-aarch64/asm_avx2/include/openssl/opensslv.h +8 -13
  102. package/include/node/openssl/archs/linux-aarch64/no-asm/crypto/buildinf.h +1 -1
  103. package/include/node/openssl/archs/linux-aarch64/no-asm/include/openssl/crypto.h +4 -4
  104. package/include/node/openssl/archs/linux-aarch64/no-asm/include/openssl/opensslv.h +8 -13
  105. package/include/node/openssl/archs/linux-armv4/asm/crypto/buildinf.h +1 -1
  106. package/include/node/openssl/archs/linux-armv4/asm/include/openssl/crypto.h +4 -4
  107. package/include/node/openssl/archs/linux-armv4/asm/include/openssl/opensslv.h +8 -13
  108. package/include/node/openssl/archs/linux-armv4/asm_avx2/crypto/buildinf.h +1 -1
  109. package/include/node/openssl/archs/linux-armv4/asm_avx2/include/openssl/crypto.h +4 -4
  110. package/include/node/openssl/archs/linux-armv4/asm_avx2/include/openssl/opensslv.h +8 -13
  111. package/include/node/openssl/archs/linux-armv4/no-asm/crypto/buildinf.h +1 -1
  112. package/include/node/openssl/archs/linux-armv4/no-asm/include/openssl/crypto.h +4 -4
  113. package/include/node/openssl/archs/linux-armv4/no-asm/include/openssl/opensslv.h +8 -13
  114. package/include/node/openssl/archs/linux-elf/asm/crypto/buildinf.h +1 -1
  115. package/include/node/openssl/archs/linux-elf/asm/include/openssl/crypto.h +4 -4
  116. package/include/node/openssl/archs/linux-elf/asm/include/openssl/opensslv.h +8 -13
  117. package/include/node/openssl/archs/linux-elf/asm_avx2/crypto/buildinf.h +1 -1
  118. package/include/node/openssl/archs/linux-elf/asm_avx2/include/openssl/crypto.h +4 -4
  119. package/include/node/openssl/archs/linux-elf/asm_avx2/include/openssl/opensslv.h +8 -13
  120. package/include/node/openssl/archs/linux-elf/no-asm/crypto/buildinf.h +1 -1
  121. package/include/node/openssl/archs/linux-elf/no-asm/include/openssl/crypto.h +4 -4
  122. package/include/node/openssl/archs/linux-elf/no-asm/include/openssl/opensslv.h +8 -13
  123. package/include/node/openssl/archs/linux-ppc64le/asm/crypto/buildinf.h +1 -1
  124. package/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/crypto.h +4 -4
  125. package/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/opensslv.h +8 -13
  126. package/include/node/openssl/archs/linux-ppc64le/asm_avx2/crypto/buildinf.h +1 -1
  127. package/include/node/openssl/archs/linux-ppc64le/asm_avx2/include/openssl/crypto.h +4 -4
  128. package/include/node/openssl/archs/linux-ppc64le/asm_avx2/include/openssl/opensslv.h +8 -13
  129. package/include/node/openssl/archs/linux-ppc64le/no-asm/crypto/buildinf.h +1 -1
  130. package/include/node/openssl/archs/linux-ppc64le/no-asm/include/openssl/crypto.h +4 -4
  131. package/include/node/openssl/archs/linux-ppc64le/no-asm/include/openssl/opensslv.h +8 -13
  132. package/include/node/openssl/archs/linux-x86_64/asm/crypto/buildinf.h +1 -1
  133. package/include/node/openssl/archs/linux-x86_64/asm/include/openssl/crypto.h +4 -4
  134. package/include/node/openssl/archs/linux-x86_64/asm/include/openssl/opensslv.h +8 -13
  135. package/include/node/openssl/archs/linux-x86_64/asm_avx2/crypto/buildinf.h +1 -1
  136. package/include/node/openssl/archs/linux-x86_64/asm_avx2/include/openssl/crypto.h +4 -4
  137. package/include/node/openssl/archs/linux-x86_64/asm_avx2/include/openssl/opensslv.h +8 -13
  138. package/include/node/openssl/archs/linux-x86_64/no-asm/crypto/buildinf.h +1 -1
  139. package/include/node/openssl/archs/linux-x86_64/no-asm/include/openssl/crypto.h +4 -4
  140. package/include/node/openssl/archs/linux-x86_64/no-asm/include/openssl/opensslv.h +8 -13
  141. package/include/node/openssl/archs/linux32-s390x/asm/crypto/buildinf.h +1 -1
  142. package/include/node/openssl/archs/linux32-s390x/asm/include/openssl/crypto.h +4 -4
  143. package/include/node/openssl/archs/linux32-s390x/asm/include/openssl/opensslv.h +8 -13
  144. package/include/node/openssl/archs/linux32-s390x/asm_avx2/crypto/buildinf.h +1 -1
  145. package/include/node/openssl/archs/linux32-s390x/asm_avx2/include/openssl/crypto.h +4 -4
  146. package/include/node/openssl/archs/linux32-s390x/asm_avx2/include/openssl/opensslv.h +8 -13
  147. package/include/node/openssl/archs/linux32-s390x/no-asm/crypto/buildinf.h +1 -1
  148. package/include/node/openssl/archs/linux32-s390x/no-asm/include/openssl/crypto.h +4 -4
  149. package/include/node/openssl/archs/linux32-s390x/no-asm/include/openssl/opensslv.h +8 -13
  150. package/include/node/openssl/archs/linux64-loongarch64/no-asm/crypto/buildinf.h +1 -1
  151. package/include/node/openssl/archs/linux64-loongarch64/no-asm/include/openssl/crypto.h +4 -4
  152. package/include/node/openssl/archs/linux64-loongarch64/no-asm/include/openssl/opensslv.h +8 -13
  153. package/include/node/openssl/archs/linux64-mips64/asm/crypto/buildinf.h +1 -1
  154. package/include/node/openssl/archs/linux64-mips64/asm/include/openssl/crypto.h +4 -4
  155. package/include/node/openssl/archs/linux64-mips64/asm/include/openssl/opensslv.h +8 -13
  156. package/include/node/openssl/archs/linux64-mips64/asm_avx2/crypto/buildinf.h +1 -1
  157. package/include/node/openssl/archs/linux64-mips64/asm_avx2/include/openssl/crypto.h +4 -4
  158. package/include/node/openssl/archs/linux64-mips64/asm_avx2/include/openssl/opensslv.h +8 -13
  159. package/include/node/openssl/archs/linux64-mips64/no-asm/crypto/buildinf.h +1 -1
  160. package/include/node/openssl/archs/linux64-mips64/no-asm/include/openssl/crypto.h +4 -4
  161. package/include/node/openssl/archs/linux64-mips64/no-asm/include/openssl/opensslv.h +8 -13
  162. package/include/node/openssl/archs/linux64-riscv64/no-asm/crypto/buildinf.h +1 -1
  163. package/include/node/openssl/archs/linux64-riscv64/no-asm/include/openssl/crypto.h +4 -4
  164. package/include/node/openssl/archs/linux64-riscv64/no-asm/include/openssl/opensslv.h +8 -13
  165. package/include/node/openssl/archs/linux64-s390x/asm/crypto/buildinf.h +1 -1
  166. package/include/node/openssl/archs/linux64-s390x/asm/include/openssl/crypto.h +4 -4
  167. package/include/node/openssl/archs/linux64-s390x/asm/include/openssl/opensslv.h +8 -13
  168. package/include/node/openssl/archs/linux64-s390x/asm_avx2/crypto/buildinf.h +1 -1
  169. package/include/node/openssl/archs/linux64-s390x/asm_avx2/include/openssl/crypto.h +4 -4
  170. package/include/node/openssl/archs/linux64-s390x/asm_avx2/include/openssl/opensslv.h +8 -13
  171. package/include/node/openssl/archs/linux64-s390x/no-asm/crypto/buildinf.h +1 -1
  172. package/include/node/openssl/archs/linux64-s390x/no-asm/include/openssl/crypto.h +4 -4
  173. package/include/node/openssl/archs/linux64-s390x/no-asm/include/openssl/opensslv.h +8 -13
  174. package/include/node/openssl/archs/solaris-x86-gcc/asm/crypto/buildinf.h +1 -1
  175. package/include/node/openssl/archs/solaris-x86-gcc/asm/include/openssl/crypto.h +4 -4
  176. package/include/node/openssl/archs/solaris-x86-gcc/asm/include/openssl/opensslv.h +8 -13
  177. package/include/node/openssl/archs/solaris-x86-gcc/asm_avx2/crypto/buildinf.h +1 -1
  178. package/include/node/openssl/archs/solaris-x86-gcc/asm_avx2/include/openssl/crypto.h +4 -4
  179. package/include/node/openssl/archs/solaris-x86-gcc/asm_avx2/include/openssl/opensslv.h +8 -13
  180. package/include/node/openssl/archs/solaris-x86-gcc/no-asm/crypto/buildinf.h +1 -1
  181. package/include/node/openssl/archs/solaris-x86-gcc/no-asm/include/openssl/crypto.h +4 -4
  182. package/include/node/openssl/archs/solaris-x86-gcc/no-asm/include/openssl/opensslv.h +8 -13
  183. package/include/node/openssl/archs/solaris64-x86_64-gcc/asm/crypto/buildinf.h +1 -1
  184. package/include/node/openssl/archs/solaris64-x86_64-gcc/asm/include/openssl/crypto.h +4 -4
  185. package/include/node/openssl/archs/solaris64-x86_64-gcc/asm/include/openssl/opensslv.h +8 -13
  186. package/include/node/openssl/archs/solaris64-x86_64-gcc/asm_avx2/crypto/buildinf.h +1 -1
  187. package/include/node/openssl/archs/solaris64-x86_64-gcc/asm_avx2/include/openssl/crypto.h +4 -4
  188. package/include/node/openssl/archs/solaris64-x86_64-gcc/asm_avx2/include/openssl/opensslv.h +8 -13
  189. package/include/node/openssl/archs/solaris64-x86_64-gcc/no-asm/crypto/buildinf.h +1 -1
  190. package/include/node/openssl/archs/solaris64-x86_64-gcc/no-asm/include/openssl/crypto.h +4 -4
  191. package/include/node/openssl/archs/solaris64-x86_64-gcc/no-asm/include/openssl/opensslv.h +8 -13
  192. package/include/node/openssl/proverr.h +1 -0
  193. package/include/node/openssl/self_test.h +1 -0
  194. package/include/node/v8-array-buffer.h +1 -1
  195. package/include/node/v8-callbacks.h +3 -4
  196. package/include/node/v8-context.h +15 -5
  197. package/include/node/v8-data.h +5 -0
  198. package/include/node/v8-debug.h +11 -0
  199. package/include/node/v8-function-callback.h +26 -26
  200. package/include/node/v8-internal.h +136 -36
  201. package/include/node/v8-isolate.h +75 -16
  202. package/include/node/v8-json.h +8 -1
  203. package/include/node/v8-local-handle.h +112 -13
  204. package/include/node/v8-maybe.h +34 -10
  205. package/include/node/v8-memory-span.h +9 -4
  206. package/include/node/v8-message.h +3 -0
  207. package/include/node/v8-object.h +87 -24
  208. package/include/node/v8-persistent-handle.h +4 -4
  209. package/include/node/v8-platform.h +92 -28
  210. package/include/node/v8-primitive.h +22 -9
  211. package/include/node/v8-profiler.h +4 -0
  212. package/include/node/v8-sandbox.h +16 -0
  213. package/include/node/v8-source-location.h +19 -26
  214. package/include/node/v8-template.h +37 -15
  215. package/include/node/v8-traced-handle.h +6 -6
  216. package/include/node/v8-unwinder.h +13 -0
  217. package/include/node/v8-version.h +4 -4
  218. package/include/node/v8config.h +65 -5
  219. package/package.json +5 -1
  220. package/share/doc/node/gdbinit +221 -4
  221. package/share/man/man1/node.1 +21 -4
@@ -42,7 +42,7 @@ class ReturnValue {
42
42
  public:
43
43
  template <class S>
44
44
  V8_INLINE ReturnValue(const ReturnValue<S>& that) : value_(that.value_) {
45
- static_assert(std::is_base_of<T, S>::value, "type check");
45
+ static_assert(std::is_base_of_v<T, S>, "type check");
46
46
  }
47
47
  // Handle-based setters.
48
48
  template <typename S>
@@ -66,12 +66,12 @@ class ReturnValue {
66
66
  V8_INLINE void Set(uint16_t i);
67
67
  V8_INLINE void Set(uint32_t i);
68
68
  V8_INLINE void Set(uint64_t i);
69
- // Fast JS primitive setters
69
+ // Fast JS primitive setters.
70
70
  V8_INLINE void SetNull();
71
71
  V8_INLINE void SetUndefined();
72
72
  V8_INLINE void SetFalse();
73
73
  V8_INLINE void SetEmptyString();
74
- // Convenience getter for Isolate
74
+ // Convenience getter for the Isolate.
75
75
  V8_INLINE Isolate* GetIsolate() const;
76
76
 
77
77
  // Pointer setter: Uncompilable to prevent inadvertent misuse.
@@ -250,7 +250,7 @@ class PropertyCallbackInfo {
250
250
  *
251
251
  * \note For security reasons, do not pass the object back into the runtime.
252
252
  */
253
- V8_DEPRECATE_SOON(
253
+ V8_DEPRECATED(
254
254
  "V8 will stop providing access to hidden prototype (i.e. "
255
255
  "JSGlobalObject). Use HolderV2() instead. \n"
256
256
  "DO NOT try to workaround this by accessing JSGlobalObject via "
@@ -335,7 +335,7 @@ void ReturnValue<T>::SetInternal(internal::Address value) {
335
335
  template <typename T>
336
336
  template <typename S>
337
337
  void ReturnValue<T>::Set(const Global<S>& handle) {
338
- static_assert(std::is_base_of<T, S>::value, "type check");
338
+ static_assert(std::is_base_of_v<T, S>, "type check");
339
339
  if (V8_UNLIKELY(handle.IsEmpty())) {
340
340
  SetDefaultValue();
341
341
  } else {
@@ -346,7 +346,7 @@ void ReturnValue<T>::Set(const Global<S>& handle) {
346
346
  template <typename T>
347
347
  template <typename S>
348
348
  void ReturnValue<T>::SetNonEmpty(const Global<S>& handle) {
349
- static_assert(std::is_base_of<T, S>::value, "type check");
349
+ static_assert(std::is_base_of_v<T, S>, "type check");
350
350
  #ifdef V8_ENABLE_CHECKS
351
351
  internal::VerifyHandleIsNonEmpty(handle.IsEmpty());
352
352
  #endif // V8_ENABLE_CHECKS
@@ -356,7 +356,7 @@ void ReturnValue<T>::SetNonEmpty(const Global<S>& handle) {
356
356
  template <typename T>
357
357
  template <typename S>
358
358
  void ReturnValue<T>::Set(const BasicTracedReference<S>& handle) {
359
- static_assert(std::is_base_of<T, S>::value, "type check");
359
+ static_assert(std::is_base_of_v<T, S>, "type check");
360
360
  if (V8_UNLIKELY(handle.IsEmpty())) {
361
361
  SetDefaultValue();
362
362
  } else {
@@ -367,7 +367,7 @@ void ReturnValue<T>::Set(const BasicTracedReference<S>& handle) {
367
367
  template <typename T>
368
368
  template <typename S>
369
369
  void ReturnValue<T>::SetNonEmpty(const BasicTracedReference<S>& handle) {
370
- static_assert(std::is_base_of<T, S>::value, "type check");
370
+ static_assert(std::is_base_of_v<T, S>, "type check");
371
371
  #ifdef V8_ENABLE_CHECKS
372
372
  internal::VerifyHandleIsNonEmpty(handle.IsEmpty());
373
373
  #endif // V8_ENABLE_CHECKS
@@ -380,16 +380,16 @@ void ReturnValue<T>::Set(const Local<S> handle) {
380
380
  // "V8_DEPRECATE_SOON" this method if |T| is |void|.
381
381
  #ifdef V8_IMMINENT_DEPRECATION_WARNINGS
382
382
  static constexpr bool is_allowed_void = false;
383
- static_assert(!std::is_void<T>::value,
383
+ static_assert(!std::is_void_v<T>,
384
384
  "ReturnValue<void>::Set(const Local<S>) is deprecated. "
385
385
  "Do nothing to indicate that the operation succeeded or use "
386
386
  "SetFalse() to indicate that the operation failed (don't "
387
387
  "forget to handle info.ShouldThrowOnError()). "
388
388
  "See http://crbug.com/348660658 for details.");
389
389
  #else
390
- static constexpr bool is_allowed_void = std::is_void<T>::value;
390
+ static constexpr bool is_allowed_void = std::is_void_v<T>;
391
391
  #endif // V8_IMMINENT_DEPRECATION_WARNINGS
392
- static_assert(is_allowed_void || std::is_base_of<T, S>::value, "type check");
392
+ static_assert(is_allowed_void || std::is_base_of_v<T, S>, "type check");
393
393
  if (V8_UNLIKELY(handle.IsEmpty())) {
394
394
  SetDefaultValue();
395
395
  } else if constexpr (is_allowed_void) {
@@ -407,16 +407,16 @@ void ReturnValue<T>::SetNonEmpty(const Local<S> handle) {
407
407
  // "V8_DEPRECATE_SOON" this method if |T| is |void|.
408
408
  #ifdef V8_IMMINENT_DEPRECATION_WARNINGS
409
409
  static constexpr bool is_allowed_void = false;
410
- static_assert(!std::is_void<T>::value,
410
+ static_assert(!std::is_void_v<T>,
411
411
  "ReturnValue<void>::SetNonEmpty(const Local<S>) is deprecated. "
412
412
  "Do nothing to indicate that the operation succeeded or use "
413
413
  "SetFalse() to indicate that the operation failed (don't "
414
414
  "forget to handle info.ShouldThrowOnError()). "
415
415
  "See http://crbug.com/348660658 for details.");
416
416
  #else
417
- static constexpr bool is_allowed_void = std::is_void<T>::value;
417
+ static constexpr bool is_allowed_void = std::is_void_v<T>;
418
418
  #endif // V8_IMMINENT_DEPRECATION_WARNINGS
419
- static_assert(is_allowed_void || std::is_base_of<T, S>::value, "type check");
419
+ static_assert(is_allowed_void || std::is_base_of_v<T, S>, "type check");
420
420
  #ifdef V8_ENABLE_CHECKS
421
421
  internal::VerifyHandleIsNonEmpty(handle.IsEmpty());
422
422
  #endif // V8_ENABLE_CHECKS
@@ -431,13 +431,13 @@ void ReturnValue<T>::SetNonEmpty(const Local<S> handle) {
431
431
 
432
432
  template <typename T>
433
433
  void ReturnValue<T>::Set(double i) {
434
- static_assert(std::is_base_of<T, Number>::value, "type check");
434
+ static_assert(std::is_base_of_v<T, Number>, "type check");
435
435
  SetNonEmpty(Number::New(GetIsolate(), i));
436
436
  }
437
437
 
438
438
  template <typename T>
439
439
  void ReturnValue<T>::Set(int16_t i) {
440
- static_assert(std::is_base_of<T, Integer>::value, "type check");
440
+ static_assert(std::is_base_of_v<T, Integer>, "type check");
441
441
  using I = internal::Internals;
442
442
  static_assert(I::IsValidSmi(std::numeric_limits<int16_t>::min()));
443
443
  static_assert(I::IsValidSmi(std::numeric_limits<int16_t>::max()));
@@ -446,7 +446,7 @@ void ReturnValue<T>::Set(int16_t i) {
446
446
 
447
447
  template <typename T>
448
448
  void ReturnValue<T>::Set(int32_t i) {
449
- static_assert(std::is_base_of<T, Integer>::value, "type check");
449
+ static_assert(std::is_base_of_v<T, Integer>, "type check");
450
450
  if (const auto result = internal::Internals::TryIntegralToSmi(i)) {
451
451
  SetInternal(*result);
452
452
  return;
@@ -456,7 +456,7 @@ void ReturnValue<T>::Set(int32_t i) {
456
456
 
457
457
  template <typename T>
458
458
  void ReturnValue<T>::Set(int64_t i) {
459
- static_assert(std::is_base_of<T, Integer>::value, "type check");
459
+ static_assert(std::is_base_of_v<T, Integer>, "type check");
460
460
  if (const auto result = internal::Internals::TryIntegralToSmi(i)) {
461
461
  SetInternal(*result);
462
462
  return;
@@ -466,7 +466,7 @@ void ReturnValue<T>::Set(int64_t i) {
466
466
 
467
467
  template <typename T>
468
468
  void ReturnValue<T>::Set(uint16_t i) {
469
- static_assert(std::is_base_of<T, Integer>::value, "type check");
469
+ static_assert(std::is_base_of_v<T, Integer>, "type check");
470
470
  using I = internal::Internals;
471
471
  static_assert(I::IsValidSmi(std::numeric_limits<uint16_t>::min()));
472
472
  static_assert(I::IsValidSmi(std::numeric_limits<uint16_t>::max()));
@@ -475,7 +475,7 @@ void ReturnValue<T>::Set(uint16_t i) {
475
475
 
476
476
  template <typename T>
477
477
  void ReturnValue<T>::Set(uint32_t i) {
478
- static_assert(std::is_base_of<T, Integer>::value, "type check");
478
+ static_assert(std::is_base_of_v<T, Integer>, "type check");
479
479
  if (const auto result = internal::Internals::TryIntegralToSmi(i)) {
480
480
  SetInternal(*result);
481
481
  return;
@@ -485,7 +485,7 @@ void ReturnValue<T>::Set(uint32_t i) {
485
485
 
486
486
  template <typename T>
487
487
  void ReturnValue<T>::Set(uint64_t i) {
488
- static_assert(std::is_base_of<T, Integer>::value, "type check");
488
+ static_assert(std::is_base_of_v<T, Integer>, "type check");
489
489
  if (const auto result = internal::Internals::TryIntegralToSmi(i)) {
490
490
  SetInternal(*result);
491
491
  return;
@@ -495,7 +495,7 @@ void ReturnValue<T>::Set(uint64_t i) {
495
495
 
496
496
  template <typename T>
497
497
  void ReturnValue<T>::Set(bool value) {
498
- static_assert(std::is_void<T>::value || std::is_base_of<T, Boolean>::value,
498
+ static_assert(std::is_void_v<T> || std::is_base_of_v<T, Boolean>,
499
499
  "type check");
500
500
  using I = internal::Internals;
501
501
  #if V8_STATIC_ROOTS_BOOL
@@ -535,7 +535,7 @@ void ReturnValue<T>::SetDefaultValue() {
535
535
 
536
536
  template <typename T>
537
537
  void ReturnValue<T>::SetNull() {
538
- static_assert(std::is_base_of<T, Primitive>::value, "type check");
538
+ static_assert(std::is_base_of_v<T, Primitive>, "type check");
539
539
  using I = internal::Internals;
540
540
  #if V8_STATIC_ROOTS_BOOL
541
541
  #ifdef V8_ENABLE_CHECKS
@@ -550,7 +550,7 @@ void ReturnValue<T>::SetNull() {
550
550
 
551
551
  template <typename T>
552
552
  void ReturnValue<T>::SetUndefined() {
553
- static_assert(std::is_base_of<T, Primitive>::value, "type check");
553
+ static_assert(std::is_base_of_v<T, Primitive>, "type check");
554
554
  using I = internal::Internals;
555
555
  #if V8_STATIC_ROOTS_BOOL
556
556
  #ifdef V8_ENABLE_CHECKS
@@ -565,7 +565,7 @@ void ReturnValue<T>::SetUndefined() {
565
565
 
566
566
  template <typename T>
567
567
  void ReturnValue<T>::SetFalse() {
568
- static_assert(std::is_void<T>::value || std::is_base_of<T, Boolean>::value,
568
+ static_assert(std::is_void_v<T> || std::is_base_of_v<T, Boolean>,
569
569
  "type check");
570
570
  using I = internal::Internals;
571
571
  #if V8_STATIC_ROOTS_BOOL
@@ -581,7 +581,7 @@ void ReturnValue<T>::SetFalse() {
581
581
 
582
582
  template <typename T>
583
583
  void ReturnValue<T>::SetEmptyString() {
584
- static_assert(std::is_base_of<T, String>::value, "type check");
584
+ static_assert(std::is_base_of_v<T, String>, "type check");
585
585
  using I = internal::Internals;
586
586
  #if V8_STATIC_ROOTS_BOOL
587
587
  #ifdef V8_ENABLE_CHECKS
@@ -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.