node-linux-arm64 17.9.1 → 18.2.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 (211) hide show
  1. package/CHANGELOG.md +418 -1554
  2. package/LICENSE +111 -9
  3. package/README.md +20 -11
  4. package/bin/node +0 -0
  5. package/include/node/common.gypi +2 -2
  6. package/include/node/config.gypi +15 -5
  7. package/include/node/js_native_api.h +367 -363
  8. package/include/node/js_native_api_types.h +13 -4
  9. package/include/node/libplatform/libplatform.h +0 -11
  10. package/include/node/libplatform/v8-tracing.h +0 -1
  11. package/include/node/node.h +17 -3
  12. package/include/node/node_api.h +110 -90
  13. package/include/node/node_api_types.h +8 -10
  14. package/include/node/node_version.h +4 -4
  15. package/include/node/openssl/archs/BSD-x86/asm/crypto/buildinf.h +1 -1
  16. package/include/node/openssl/archs/BSD-x86/asm_avx2/crypto/buildinf.h +1 -1
  17. package/include/node/openssl/archs/BSD-x86/no-asm/crypto/buildinf.h +1 -1
  18. package/include/node/openssl/archs/BSD-x86_64/asm/crypto/buildinf.h +1 -1
  19. package/include/node/openssl/archs/BSD-x86_64/asm_avx2/crypto/buildinf.h +1 -1
  20. package/include/node/openssl/archs/BSD-x86_64/no-asm/crypto/buildinf.h +1 -1
  21. package/include/node/openssl/archs/VC-WIN32/asm/crypto/buildinf.h +1 -1
  22. package/include/node/openssl/archs/VC-WIN32/asm_avx2/crypto/buildinf.h +1 -1
  23. package/include/node/openssl/archs/VC-WIN32/no-asm/crypto/buildinf.h +1 -1
  24. package/include/node/openssl/archs/VC-WIN64-ARM/no-asm/crypto/buildinf.h +1 -1
  25. package/include/node/openssl/archs/VC-WIN64A/asm/crypto/buildinf.h +1 -1
  26. package/include/node/openssl/archs/VC-WIN64A/asm_avx2/crypto/buildinf.h +1 -1
  27. package/include/node/openssl/archs/VC-WIN64A/no-asm/crypto/buildinf.h +1 -1
  28. package/include/node/openssl/archs/aix-gcc/asm/crypto/buildinf.h +1 -1
  29. package/include/node/openssl/archs/aix-gcc/asm/include/openssl/crypto.h +0 -2
  30. package/include/node/openssl/archs/aix-gcc/asm/include/openssl/opensslv.h +5 -5
  31. package/include/node/openssl/archs/aix-gcc/asm/include/openssl/ssl.h +0 -11
  32. package/include/node/openssl/archs/aix-gcc/asm/include/openssl/x509.h +4 -4
  33. package/include/node/openssl/archs/aix-gcc/asm_avx2/crypto/buildinf.h +1 -1
  34. package/include/node/openssl/archs/aix-gcc/asm_avx2/include/openssl/crypto.h +0 -2
  35. package/include/node/openssl/archs/aix-gcc/asm_avx2/include/openssl/opensslv.h +5 -5
  36. package/include/node/openssl/archs/aix-gcc/asm_avx2/include/openssl/ssl.h +0 -11
  37. package/include/node/openssl/archs/aix-gcc/asm_avx2/include/openssl/x509.h +4 -4
  38. package/include/node/openssl/archs/aix-gcc/no-asm/crypto/buildinf.h +1 -1
  39. package/include/node/openssl/archs/aix-gcc/no-asm/include/openssl/crypto.h +0 -2
  40. package/include/node/openssl/archs/aix-gcc/no-asm/include/openssl/opensslv.h +5 -5
  41. package/include/node/openssl/archs/aix-gcc/no-asm/include/openssl/ssl.h +0 -11
  42. package/include/node/openssl/archs/aix-gcc/no-asm/include/openssl/x509.h +4 -4
  43. package/include/node/openssl/archs/aix64-gcc-as/asm/crypto/buildinf.h +1 -1
  44. package/include/node/openssl/archs/aix64-gcc-as/asm_avx2/crypto/buildinf.h +1 -1
  45. package/include/node/openssl/archs/aix64-gcc-as/no-asm/crypto/buildinf.h +1 -1
  46. package/include/node/openssl/archs/darwin-i386-cc/asm/crypto/buildinf.h +1 -1
  47. package/include/node/openssl/archs/darwin-i386-cc/asm_avx2/crypto/buildinf.h +1 -1
  48. package/include/node/openssl/archs/darwin-i386-cc/no-asm/crypto/buildinf.h +1 -1
  49. package/include/node/openssl/archs/darwin64-arm64-cc/asm/crypto/buildinf.h +1 -1
  50. package/include/node/openssl/archs/darwin64-arm64-cc/asm_avx2/crypto/buildinf.h +1 -1
  51. package/include/node/openssl/archs/darwin64-arm64-cc/no-asm/crypto/buildinf.h +1 -1
  52. package/include/node/openssl/archs/darwin64-x86_64-cc/asm/crypto/buildinf.h +1 -1
  53. package/include/node/openssl/archs/darwin64-x86_64-cc/asm_avx2/crypto/buildinf.h +1 -1
  54. package/include/node/openssl/archs/darwin64-x86_64-cc/no-asm/crypto/buildinf.h +1 -1
  55. package/include/node/openssl/archs/linux-aarch64/asm/crypto/buildinf.h +1 -1
  56. package/include/node/openssl/archs/linux-aarch64/asm_avx2/crypto/buildinf.h +1 -1
  57. package/include/node/openssl/archs/linux-aarch64/no-asm/crypto/buildinf.h +1 -1
  58. package/include/node/openssl/archs/linux-armv4/asm/crypto/buildinf.h +1 -1
  59. package/include/node/openssl/archs/linux-armv4/asm_avx2/crypto/buildinf.h +1 -1
  60. package/include/node/openssl/archs/linux-armv4/no-asm/crypto/buildinf.h +1 -1
  61. package/include/node/openssl/archs/linux-elf/asm/crypto/buildinf.h +1 -1
  62. package/include/node/openssl/archs/linux-elf/asm_avx2/crypto/buildinf.h +1 -1
  63. package/include/node/openssl/archs/linux-elf/no-asm/crypto/buildinf.h +1 -1
  64. package/include/node/openssl/archs/linux-ppc/asm/crypto/buildinf.h +1 -1
  65. package/include/node/openssl/archs/linux-ppc/asm/include/openssl/crypto.h +0 -2
  66. package/include/node/openssl/archs/linux-ppc/asm/include/openssl/opensslv.h +5 -5
  67. package/include/node/openssl/archs/linux-ppc/asm/include/openssl/ssl.h +0 -11
  68. package/include/node/openssl/archs/linux-ppc/asm/include/openssl/x509.h +4 -4
  69. package/include/node/openssl/archs/linux-ppc/asm_avx2/crypto/buildinf.h +1 -1
  70. package/include/node/openssl/archs/linux-ppc/asm_avx2/include/openssl/crypto.h +0 -2
  71. package/include/node/openssl/archs/linux-ppc/asm_avx2/include/openssl/opensslv.h +5 -5
  72. package/include/node/openssl/archs/linux-ppc/asm_avx2/include/openssl/ssl.h +0 -11
  73. package/include/node/openssl/archs/linux-ppc/asm_avx2/include/openssl/x509.h +4 -4
  74. package/include/node/openssl/archs/linux-ppc/no-asm/crypto/buildinf.h +1 -1
  75. package/include/node/openssl/archs/linux-ppc/no-asm/include/openssl/crypto.h +0 -2
  76. package/include/node/openssl/archs/linux-ppc/no-asm/include/openssl/opensslv.h +5 -5
  77. package/include/node/openssl/archs/linux-ppc/no-asm/include/openssl/ssl.h +0 -11
  78. package/include/node/openssl/archs/linux-ppc/no-asm/include/openssl/x509.h +4 -4
  79. package/include/node/openssl/archs/linux-ppc64/asm/crypto/buildinf.h +1 -1
  80. package/include/node/openssl/archs/linux-ppc64/asm/include/openssl/crypto.h +0 -2
  81. package/include/node/openssl/archs/linux-ppc64/asm/include/openssl/opensslv.h +5 -5
  82. package/include/node/openssl/archs/linux-ppc64/asm/include/openssl/ssl.h +0 -11
  83. package/include/node/openssl/archs/linux-ppc64/asm/include/openssl/x509.h +4 -4
  84. package/include/node/openssl/archs/linux-ppc64/asm_avx2/crypto/buildinf.h +1 -1
  85. package/include/node/openssl/archs/linux-ppc64/asm_avx2/include/openssl/crypto.h +0 -2
  86. package/include/node/openssl/archs/linux-ppc64/asm_avx2/include/openssl/opensslv.h +5 -5
  87. package/include/node/openssl/archs/linux-ppc64/asm_avx2/include/openssl/ssl.h +0 -11
  88. package/include/node/openssl/archs/linux-ppc64/asm_avx2/include/openssl/x509.h +4 -4
  89. package/include/node/openssl/archs/linux-ppc64/no-asm/crypto/buildinf.h +1 -1
  90. package/include/node/openssl/archs/linux-ppc64/no-asm/include/openssl/crypto.h +0 -2
  91. package/include/node/openssl/archs/linux-ppc64/no-asm/include/openssl/opensslv.h +5 -5
  92. package/include/node/openssl/archs/linux-ppc64/no-asm/include/openssl/ssl.h +0 -11
  93. package/include/node/openssl/archs/linux-ppc64/no-asm/include/openssl/x509.h +4 -4
  94. package/include/node/openssl/archs/linux-ppc64le/asm/crypto/buildinf.h +1 -1
  95. package/include/node/openssl/archs/linux-ppc64le/asm_avx2/crypto/buildinf.h +1 -1
  96. package/include/node/openssl/archs/linux-ppc64le/no-asm/crypto/buildinf.h +1 -1
  97. package/include/node/openssl/archs/linux-x86_64/asm/crypto/buildinf.h +1 -1
  98. package/include/node/openssl/archs/linux-x86_64/asm_avx2/crypto/buildinf.h +1 -1
  99. package/include/node/openssl/archs/linux-x86_64/no-asm/crypto/buildinf.h +1 -1
  100. package/include/node/openssl/archs/linux32-s390x/asm/crypto/buildinf.h +1 -1
  101. package/include/node/openssl/archs/linux32-s390x/asm_avx2/crypto/buildinf.h +1 -1
  102. package/include/node/openssl/archs/linux32-s390x/no-asm/crypto/buildinf.h +1 -1
  103. package/include/node/openssl/archs/linux64-mips64/asm/crypto/buildinf.h +1 -1
  104. package/include/node/openssl/archs/linux64-mips64/asm_avx2/crypto/buildinf.h +1 -1
  105. package/include/node/openssl/archs/linux64-mips64/no-asm/crypto/buildinf.h +1 -1
  106. package/include/node/openssl/archs/linux64-riscv64/no-asm/crypto/buildinf.h +1 -1
  107. package/include/node/openssl/archs/linux64-s390x/asm/crypto/buildinf.h +1 -1
  108. package/include/node/openssl/archs/linux64-s390x/asm_avx2/crypto/buildinf.h +1 -1
  109. package/include/node/openssl/archs/linux64-s390x/no-asm/crypto/buildinf.h +1 -1
  110. package/include/node/openssl/archs/solaris-x86-gcc/asm/crypto/buildinf.h +1 -1
  111. package/include/node/openssl/archs/solaris-x86-gcc/asm_avx2/crypto/buildinf.h +1 -1
  112. package/include/node/openssl/archs/solaris-x86-gcc/no-asm/crypto/buildinf.h +1 -1
  113. package/include/node/openssl/archs/solaris64-x86_64-gcc/asm/crypto/buildinf.h +1 -1
  114. package/include/node/openssl/archs/solaris64-x86_64-gcc/asm_avx2/crypto/buildinf.h +1 -1
  115. package/include/node/openssl/archs/solaris64-x86_64-gcc/no-asm/crypto/buildinf.h +1 -1
  116. package/include/node/openssl/asn1_asm.h +0 -6
  117. package/include/node/openssl/asn1_no-asm.h +0 -6
  118. package/include/node/openssl/asn1t_asm.h +0 -6
  119. package/include/node/openssl/asn1t_no-asm.h +0 -6
  120. package/include/node/openssl/bio_asm.h +0 -6
  121. package/include/node/openssl/bio_no-asm.h +0 -6
  122. package/include/node/openssl/bn_conf_asm.h +0 -6
  123. package/include/node/openssl/bn_conf_no-asm.h +0 -6
  124. package/include/node/openssl/cmp_asm.h +0 -6
  125. package/include/node/openssl/cmp_no-asm.h +0 -6
  126. package/include/node/openssl/cms_asm.h +0 -6
  127. package/include/node/openssl/cms_no-asm.h +0 -6
  128. package/include/node/openssl/conf_asm.h +0 -6
  129. package/include/node/openssl/conf_no-asm.h +0 -6
  130. package/include/node/openssl/configuration_asm.h +0 -6
  131. package/include/node/openssl/configuration_no-asm.h +0 -6
  132. package/include/node/openssl/crmf_asm.h +0 -6
  133. package/include/node/openssl/crmf_no-asm.h +0 -6
  134. package/include/node/openssl/crypto_asm.h +0 -6
  135. package/include/node/openssl/crypto_no-asm.h +0 -6
  136. package/include/node/openssl/ct_asm.h +0 -6
  137. package/include/node/openssl/ct_no-asm.h +0 -6
  138. package/include/node/openssl/dso_conf_asm.h +0 -6
  139. package/include/node/openssl/dso_conf_no-asm.h +0 -6
  140. package/include/node/openssl/err_asm.h +0 -6
  141. package/include/node/openssl/err_no-asm.h +0 -6
  142. package/include/node/openssl/ess_asm.h +0 -6
  143. package/include/node/openssl/ess_no-asm.h +0 -6
  144. package/include/node/openssl/fipskey_asm.h +0 -6
  145. package/include/node/openssl/fipskey_no-asm.h +0 -6
  146. package/include/node/openssl/lhash_asm.h +0 -6
  147. package/include/node/openssl/lhash_no-asm.h +0 -6
  148. package/include/node/openssl/ocsp_asm.h +0 -6
  149. package/include/node/openssl/ocsp_no-asm.h +0 -6
  150. package/include/node/openssl/opensslconf.h +15 -21
  151. package/include/node/openssl/opensslv_asm.h +0 -6
  152. package/include/node/openssl/opensslv_no-asm.h +0 -6
  153. package/include/node/openssl/pkcs12_asm.h +0 -6
  154. package/include/node/openssl/pkcs12_no-asm.h +0 -6
  155. package/include/node/openssl/pkcs7_asm.h +0 -6
  156. package/include/node/openssl/pkcs7_no-asm.h +0 -6
  157. package/include/node/openssl/safestack_asm.h +0 -6
  158. package/include/node/openssl/safestack_no-asm.h +0 -6
  159. package/include/node/openssl/srp_asm.h +0 -6
  160. package/include/node/openssl/srp_no-asm.h +0 -6
  161. package/include/node/openssl/ssl_asm.h +0 -6
  162. package/include/node/openssl/ssl_no-asm.h +0 -6
  163. package/include/node/openssl/ui_asm.h +0 -6
  164. package/include/node/openssl/ui_no-asm.h +0 -6
  165. package/include/node/openssl/x509_asm.h +0 -6
  166. package/include/node/openssl/x509_no-asm.h +0 -6
  167. package/include/node/openssl/x509_vfy_asm.h +0 -6
  168. package/include/node/openssl/x509_vfy_no-asm.h +0 -6
  169. package/include/node/openssl/x509v3_asm.h +0 -6
  170. package/include/node/openssl/x509v3_no-asm.h +0 -6
  171. package/include/node/v8-array-buffer.h +2 -2
  172. package/include/node/v8-callbacks.h +26 -6
  173. package/include/node/v8-context.h +3 -14
  174. package/include/node/v8-data.h +15 -0
  175. package/include/node/v8-debug.h +21 -4
  176. package/include/node/v8-embedder-heap.h +10 -30
  177. package/include/node/v8-embedder-state-scope.h +51 -0
  178. package/include/node/v8-exception.h +0 -7
  179. package/include/node/v8-function.h +3 -0
  180. package/include/node/v8-initialization.h +64 -31
  181. package/include/node/v8-internal.h +189 -102
  182. package/include/node/v8-isolate.h +49 -2
  183. package/include/node/v8-local-handle.h +0 -4
  184. package/include/node/v8-locker.h +2 -1
  185. package/include/node/v8-message.h +19 -44
  186. package/include/node/v8-object.h +11 -6
  187. package/include/node/v8-platform.h +365 -6
  188. package/include/node/v8-primitive.h +14 -6
  189. package/include/node/v8-profiler.h +78 -2
  190. package/include/node/v8-script.h +27 -51
  191. package/include/node/v8-snapshot.h +0 -2
  192. package/include/node/v8-statistics.h +2 -0
  193. package/include/node/v8-template.h +31 -4
  194. package/include/node/v8-traced-handle.h +39 -224
  195. package/include/node/v8-unwinder.h +10 -7
  196. package/include/node/v8-value-serializer.h +32 -2
  197. package/include/node/v8-version.h +4 -4
  198. package/include/node/v8-wasm.h +13 -1
  199. package/include/node/v8-weak-callback-info.h +20 -6
  200. package/include/node/v8.h +0 -1
  201. package/include/node/v8config.h +56 -11
  202. package/package.json +1 -1
  203. package/share/doc/node/gdbinit +14 -6
  204. package/share/man/man1/node.1 +11 -4
  205. package/include/node/openssl/archs/aix64-gcc/asm/crypto/buildinf.h +0 -38
  206. package/include/node/openssl/archs/aix64-gcc/asm/include/progs.h +0 -507
  207. package/include/node/openssl/archs/aix64-gcc/asm_avx2/crypto/buildinf.h +0 -39
  208. package/include/node/openssl/archs/aix64-gcc/asm_avx2/include/progs.h +0 -507
  209. package/include/node/openssl/archs/aix64-gcc/no-asm/crypto/buildinf.h +0 -27
  210. package/include/node/openssl/archs/aix64-gcc/no-asm/include/progs.h +0 -507
  211. package/include/node/openssl/opensslconf_no-asm.h +0 -47
@@ -29,6 +29,13 @@ class Isolate;
29
29
  typedef uintptr_t Address;
30
30
  static const Address kNullAddress = 0;
31
31
 
32
+ constexpr int KB = 1024;
33
+ constexpr int MB = KB * 1024;
34
+ constexpr int GB = MB * 1024;
35
+ #ifdef V8_TARGET_ARCH_X64
36
+ constexpr size_t TB = size_t{GB} * 1024;
37
+ #endif
38
+
32
39
  /**
33
40
  * Configuration of tagging scheme.
34
41
  */
@@ -109,6 +116,11 @@ struct SmiTagging<8> {
109
116
  };
110
117
 
111
118
  #ifdef V8_COMPRESS_POINTERS
119
+ // See v8:7703 or src/common/ptr-compr-inl.h for details about pointer
120
+ // compression.
121
+ constexpr size_t kPtrComprCageReservationSize = size_t{1} << 32;
122
+ constexpr size_t kPtrComprCageBaseAlignment = size_t{1} << 32;
123
+
112
124
  static_assert(
113
125
  kApiSystemPointerSize == kApiInt64Size,
114
126
  "Pointer compression can be enabled only for 64-bit architectures");
@@ -121,36 +133,6 @@ constexpr bool PointerCompressionIsEnabled() {
121
133
  return kApiTaggedSize != kApiSystemPointerSize;
122
134
  }
123
135
 
124
- constexpr bool HeapSandboxIsEnabled() {
125
- #ifdef V8_HEAP_SANDBOX
126
- return true;
127
- #else
128
- return false;
129
- #endif
130
- }
131
-
132
- using ExternalPointer_t = Address;
133
-
134
- // If the heap sandbox is enabled, these tag values will be ORed with the
135
- // external pointers in the external pointer table to prevent use of pointers of
136
- // the wrong type. When a pointer is loaded, it is ANDed with the inverse of the
137
- // expected type's tag. The tags are constructed in a way that guarantees that a
138
- // failed type check will result in one or more of the top bits of the pointer
139
- // to be set, rendering the pointer inacessible. This construction allows
140
- // performing the type check and removing GC marking bits from the pointer at
141
- // the same time.
142
- enum ExternalPointerTag : uint64_t {
143
- kExternalPointerNullTag = 0x0000000000000000,
144
- kExternalStringResourceTag = 0x00ff000000000000, // 0b000000011111111
145
- kExternalStringResourceDataTag = 0x017f000000000000, // 0b000000101111111
146
- kForeignForeignAddressTag = 0x01bf000000000000, // 0b000000110111111
147
- kNativeContextMicrotaskQueueTag = 0x01df000000000000, // 0b000000111011111
148
- kEmbedderDataSlotPayloadTag = 0x01ef000000000000, // 0b000000111101111
149
- kCodeEntryPointTag = 0x01f7000000000000, // 0b000000111110111
150
- };
151
-
152
- constexpr uint64_t kExternalPointerTagMask = 0xffff000000000000;
153
-
154
136
  #ifdef V8_31BIT_SMIS_ON_64BIT_ARCH
155
137
  using PlatformSmiTagging = SmiTagging<kApiInt32Size>;
156
138
  #else
@@ -171,6 +153,164 @@ V8_INLINE static constexpr internal::Address IntToSmi(int value) {
171
153
  kSmiTag;
172
154
  }
173
155
 
156
+ /*
157
+ * Sandbox related types, constants, and functions.
158
+ */
159
+ constexpr bool SandboxIsEnabled() {
160
+ #ifdef V8_SANDBOX
161
+ return true;
162
+ #else
163
+ return false;
164
+ #endif
165
+ }
166
+
167
+ constexpr bool SandboxedExternalPointersAreEnabled() {
168
+ #ifdef V8_SANDBOXED_EXTERNAL_POINTERS
169
+ return true;
170
+ #else
171
+ return false;
172
+ #endif
173
+ }
174
+
175
+ // SandboxedPointers are guaranteed to point into the sandbox. This is achieved
176
+ // for example by storing them as offset rather than as raw pointers.
177
+ using SandboxedPointer_t = Address;
178
+
179
+ // ExternalPointers point to objects located outside the sandbox. When sandboxed
180
+ // external pointers are enabled, these are stored in an external pointer table
181
+ // and referenced from HeapObjects through indices.
182
+ #ifdef V8_SANDBOXED_EXTERNAL_POINTERS
183
+ using ExternalPointer_t = uint32_t;
184
+ #else
185
+ using ExternalPointer_t = Address;
186
+ #endif
187
+
188
+ #ifdef V8_SANDBOX_IS_AVAILABLE
189
+
190
+ // Size of the sandbox, excluding the guard regions surrounding it.
191
+ constexpr size_t kSandboxSizeLog2 = 40; // 1 TB
192
+ constexpr size_t kSandboxSize = 1ULL << kSandboxSizeLog2;
193
+
194
+ // Required alignment of the sandbox. For simplicity, we require the
195
+ // size of the guard regions to be a multiple of this, so that this specifies
196
+ // the alignment of the sandbox including and excluding surrounding guard
197
+ // regions. The alignment requirement is due to the pointer compression cage
198
+ // being located at the start of the sandbox.
199
+ constexpr size_t kSandboxAlignment = kPtrComprCageBaseAlignment;
200
+
201
+ // Sandboxed pointers are stored inside the heap as offset from the sandbox
202
+ // base shifted to the left. This way, it is guaranteed that the offset is
203
+ // smaller than the sandbox size after shifting it to the right again. This
204
+ // constant specifies the shift amount.
205
+ constexpr uint64_t kSandboxedPointerShift = 64 - kSandboxSizeLog2;
206
+
207
+ // Size of the guard regions surrounding the sandbox. This assumes a worst-case
208
+ // scenario of a 32-bit unsigned index used to access an array of 64-bit
209
+ // values.
210
+ constexpr size_t kSandboxGuardRegionSize = 32ULL * GB;
211
+
212
+ static_assert((kSandboxGuardRegionSize % kSandboxAlignment) == 0,
213
+ "The size of the guard regions around the sandbox must be a "
214
+ "multiple of its required alignment.");
215
+
216
+ // Minimum size of the sandbox, excluding the guard regions surrounding it. If
217
+ // the virtual memory reservation for the sandbox fails, its size is currently
218
+ // halved until either the reservation succeeds or the minimum size is reached.
219
+ // A minimum of 32GB allows the 4GB pointer compression region as well as the
220
+ // ArrayBuffer partition and two 10GB Wasm memory cages to fit into the
221
+ // sandbox. 32GB should also be the minimum possible size of the userspace
222
+ // address space as there are some machine configurations with only 36 virtual
223
+ // address bits.
224
+ constexpr size_t kSandboxMinimumSize = 32ULL * GB;
225
+
226
+ static_assert(kSandboxMinimumSize <= kSandboxSize,
227
+ "The minimal size of the sandbox must be smaller or equal to the "
228
+ "regular size.");
229
+
230
+ // On OSes where reserving virtual memory is too expensive to reserve the
231
+ // entire address space backing the sandbox, notably Windows pre 8.1, we create
232
+ // a partially reserved sandbox that doesn't actually reserve most of the
233
+ // memory, and so doesn't have the desired security properties as unrelated
234
+ // memory allocations could end up inside of it, but which still ensures that
235
+ // objects that should be located inside the sandbox are allocated within
236
+ // kSandboxSize bytes from the start of the sandbox. The minimum size of the
237
+ // region that is actually reserved for such a sandbox is specified by this
238
+ // constant and should be big enough to contain the pointer compression cage as
239
+ // well as the ArrayBuffer partition.
240
+ constexpr size_t kSandboxMinimumReservationSize = 8ULL * GB;
241
+
242
+ static_assert(kSandboxMinimumSize > kPtrComprCageReservationSize,
243
+ "The sandbox must be larger than the pointer compression cage "
244
+ "contained within it.");
245
+ static_assert(kSandboxMinimumReservationSize > kPtrComprCageReservationSize,
246
+ "The minimum reservation size for a sandbox must be larger than "
247
+ "the pointer compression cage contained within it.");
248
+
249
+ // For now, even if the sandbox is enabled, we still allow backing stores to be
250
+ // allocated outside of it as fallback. This will simplify the initial rollout.
251
+ // However, if sandboxed pointers are also enabled, we must always place
252
+ // backing stores inside the sandbox as they will be referenced though them.
253
+ #ifdef V8_SANDBOXED_POINTERS
254
+ constexpr bool kAllowBackingStoresOutsideSandbox = false;
255
+ #else
256
+ constexpr bool kAllowBackingStoresOutsideSandbox = true;
257
+ #endif // V8_SANDBOXED_POINTERS
258
+
259
+ // The size of the virtual memory reservation for an external pointer table.
260
+ // This determines the maximum number of entries in a table. Using a maximum
261
+ // size allows omitting bounds checks on table accesses if the indices are
262
+ // guaranteed (e.g. through shifting) to be below the maximum index. This
263
+ // value must be a power of two.
264
+ static const size_t kExternalPointerTableReservationSize = 128 * MB;
265
+
266
+ // The maximum number of entries in an external pointer table.
267
+ static const size_t kMaxSandboxedExternalPointers =
268
+ kExternalPointerTableReservationSize / kApiSystemPointerSize;
269
+
270
+ // The external pointer table indices stored in HeapObjects as external
271
+ // pointers are shifted to the left by this amount to guarantee that they are
272
+ // smaller than the maximum table size.
273
+ static const uint32_t kExternalPointerIndexShift = 8;
274
+ static_assert((1 << (32 - kExternalPointerIndexShift)) ==
275
+ kMaxSandboxedExternalPointers,
276
+ "kExternalPointerTableReservationSize and "
277
+ "kExternalPointerIndexShift don't match");
278
+
279
+ #endif // V8_SANDBOX_IS_AVAILABLE
280
+
281
+ // If sandboxed external pointers are enabled, these tag values will be ORed
282
+ // with the external pointers in the external pointer table to prevent use of
283
+ // pointers of the wrong type. When a pointer is loaded, it is ANDed with the
284
+ // inverse of the expected type's tag. The tags are constructed in a way that
285
+ // guarantees that a failed type check will result in one or more of the top
286
+ // bits of the pointer to be set, rendering the pointer inacessible. Besides
287
+ // the type tag bits (48 through 62), the tags also have the GC mark bit (63)
288
+ // set, so that the mark bit is automatically set when a pointer is written
289
+ // into the external pointer table (in which case it is clearly alive) and is
290
+ // cleared when the pointer is loaded. The exception to this is the free entry
291
+ // tag, which doesn't have the mark bit set, as the entry is not alive. This
292
+ // construction allows performing the type check and removing GC marking bits
293
+ // (the MSB) from the pointer at the same time.
294
+ // Note: this scheme assumes a 48-bit address space and will likely break if
295
+ // more virtual address bits are used.
296
+ constexpr uint64_t kExternalPointerTagMask = 0xffff000000000000;
297
+ constexpr uint64_t kExternalPointerTagShift = 48;
298
+ #define MAKE_TAG(v) (static_cast<uint64_t>(v) << kExternalPointerTagShift)
299
+ // clang-format off
300
+ enum ExternalPointerTag : uint64_t {
301
+ kExternalPointerNullTag = MAKE_TAG(0b0000000000000000),
302
+ kExternalPointerFreeEntryTag = MAKE_TAG(0b0111111110000000),
303
+ kExternalStringResourceTag = MAKE_TAG(0b1000000011111111),
304
+ kExternalStringResourceDataTag = MAKE_TAG(0b1000000101111111),
305
+ kForeignForeignAddressTag = MAKE_TAG(0b1000000110111111),
306
+ kNativeContextMicrotaskQueueTag = MAKE_TAG(0b1000000111011111),
307
+ kEmbedderDataSlotPayloadTag = MAKE_TAG(0b1000000111101111),
308
+ kCodeEntryPointTag = MAKE_TAG(0b1000000111110111),
309
+ kExternalObjectValueTag = MAKE_TAG(0b1000000111111011),
310
+ };
311
+ // clang-format on
312
+ #undef MAKE_TAG
313
+
174
314
  // Converts encoded external pointer to address.
175
315
  V8_EXPORT Address DecodeExternalPointerImpl(const Isolate* isolate,
176
316
  ExternalPointer_t pointer,
@@ -214,19 +354,19 @@ class Internals {
214
354
  static const int kFixedArrayHeaderSize = 2 * kApiTaggedSize;
215
355
  static const int kEmbedderDataArrayHeaderSize = 2 * kApiTaggedSize;
216
356
  static const int kEmbedderDataSlotSize = kApiSystemPointerSize;
217
- #ifdef V8_HEAP_SANDBOX
357
+ #ifdef V8_SANDBOXED_EXTERNAL_POINTERS
218
358
  static const int kEmbedderDataSlotRawPayloadOffset = kApiTaggedSize;
219
359
  #endif
220
360
  static const int kNativeContextEmbedderDataOffset = 6 * kApiTaggedSize;
221
- static const int kFullStringRepresentationMask = 0x0f;
361
+ static const int kStringRepresentationAndEncodingMask = 0x0f;
222
362
  static const int kStringEncodingMask = 0x8;
223
363
  static const int kExternalTwoByteRepresentationTag = 0x02;
224
364
  static const int kExternalOneByteRepresentationTag = 0x0a;
225
365
 
226
366
  static const uint32_t kNumIsolateDataSlots = 4;
227
367
  static const int kStackGuardSize = 7 * kApiSystemPointerSize;
228
- static const int kBuiltinTier0EntryTableSize = 13 * kApiSystemPointerSize;
229
- static const int kBuiltinTier0TableSize = 13 * kApiSystemPointerSize;
368
+ static const int kBuiltinTier0EntryTableSize = 10 * kApiSystemPointerSize;
369
+ static const int kBuiltinTier0TableSize = 10 * kApiSystemPointerSize;
230
370
 
231
371
  // IsolateData layout guarantees.
232
372
  static const int kIsolateCageBaseOffset = 0;
@@ -250,10 +390,10 @@ class Internals {
250
390
  kIsolateLongTaskStatsCounterOffset + kApiSizetSize;
251
391
 
252
392
  static const int kExternalPointerTableBufferOffset = 0;
253
- static const int kExternalPointerTableLengthOffset =
254
- kExternalPointerTableBufferOffset + kApiSystemPointerSize;
255
393
  static const int kExternalPointerTableCapacityOffset =
256
- kExternalPointerTableLengthOffset + kApiInt32Size;
394
+ kExternalPointerTableBufferOffset + kApiSystemPointerSize;
395
+ static const int kExternalPointerTableFreelistHeadOffset =
396
+ kExternalPointerTableCapacityOffset + kApiInt32Size;
257
397
 
258
398
  static const int kUndefinedValueRootIndex = 4;
259
399
  static const int kTheHoleValueRootIndex = 5;
@@ -268,9 +408,9 @@ class Internals {
268
408
  static const int kNodeStateIsWeakValue = 2;
269
409
  static const int kNodeStateIsPendingValue = 3;
270
410
 
271
- static const int kFirstNonstringType = 0x40;
272
- static const int kOddballType = 0x43;
273
- static const int kForeignType = 0x46;
411
+ static const int kFirstNonstringType = 0x80;
412
+ static const int kOddballType = 0x83;
413
+ static const int kForeignType = 0xcc;
274
414
  static const int kJSSpecialApiObjectType = 0x410;
275
415
  static const int kJSObjectType = 0x421;
276
416
  static const int kFirstJSApiObjectType = 0x422;
@@ -337,7 +477,7 @@ class Internals {
337
477
  }
338
478
 
339
479
  V8_INLINE static bool IsExternalTwoByteString(int instance_type) {
340
- int representation = (instance_type & kFullStringRepresentationMask);
480
+ int representation = (instance_type & kStringRepresentationAndEncodingMask);
341
481
  return representation == kExternalTwoByteRepresentationTag;
342
482
  }
343
483
 
@@ -432,9 +572,9 @@ class Internals {
432
572
  #endif
433
573
  }
434
574
 
435
- V8_INLINE static internal::Isolate* GetIsolateForHeapSandbox(
575
+ V8_INLINE static internal::Isolate* GetIsolateForSandbox(
436
576
  internal::Address obj) {
437
- #ifdef V8_HEAP_SANDBOX
577
+ #ifdef V8_SANDBOXED_EXTERNAL_POINTERS
438
578
  return internal::IsolateFromNeverReadOnlySpaceObject(obj);
439
579
  #else
440
580
  // Not used in non-sandbox mode.
@@ -445,7 +585,7 @@ class Internals {
445
585
  V8_INLINE static Address DecodeExternalPointer(
446
586
  const Isolate* isolate, ExternalPointer_t encoded_pointer,
447
587
  ExternalPointerTag tag) {
448
- #ifdef V8_HEAP_SANDBOX
588
+ #ifdef V8_SANDBOXED_EXTERNAL_POINTERS
449
589
  return internal::DecodeExternalPointerImpl(isolate, encoded_pointer, tag);
450
590
  #else
451
591
  return encoded_pointer;
@@ -455,7 +595,7 @@ class Internals {
455
595
  V8_INLINE static internal::Address ReadExternalPointerField(
456
596
  internal::Isolate* isolate, internal::Address heap_object_ptr, int offset,
457
597
  ExternalPointerTag tag) {
458
- #ifdef V8_HEAP_SANDBOX
598
+ #ifdef V8_SANDBOXED_EXTERNAL_POINTERS
459
599
  internal::ExternalPointer_t encoded_value =
460
600
  ReadRawField<uint32_t>(heap_object_ptr, offset);
461
601
  // We currently have to treat zero as nullptr in embedder slots.
@@ -467,10 +607,6 @@ class Internals {
467
607
  }
468
608
 
469
609
  #ifdef V8_COMPRESS_POINTERS
470
- // See v8:7703 or src/ptr-compr.* for details about pointer compression.
471
- static constexpr size_t kPtrComprCageReservationSize = size_t{1} << 32;
472
- static constexpr size_t kPtrComprCageBaseAlignment = size_t{1} << 32;
473
-
474
610
  V8_INLINE static internal::Address GetPtrComprCageBaseFromOnHeapAddress(
475
611
  internal::Address addr) {
476
612
  return addr & -static_cast<intptr_t>(kPtrComprCageBaseAlignment);
@@ -486,59 +622,6 @@ class Internals {
486
622
  #endif // V8_COMPRESS_POINTERS
487
623
  };
488
624
 
489
- constexpr bool VirtualMemoryCageIsEnabled() {
490
- #ifdef V8_VIRTUAL_MEMORY_CAGE
491
- return true;
492
- #else
493
- return false;
494
- #endif
495
- }
496
-
497
- #ifdef V8_VIRTUAL_MEMORY_CAGE
498
- // Size of the virtual memory cage, excluding the guard regions surrounding it.
499
- constexpr size_t kVirtualMemoryCageSize = size_t{1} << 40; // 1 TB
500
-
501
- static_assert(kVirtualMemoryCageSize > Internals::kPtrComprCageReservationSize,
502
- "The virtual memory cage must be larger than the pointer "
503
- "compression cage contained within it.");
504
-
505
- // Required alignment of the virtual memory cage. For simplicity, we require the
506
- // size of the guard regions to be a multiple of this, so that this specifies
507
- // the alignment of the cage including and excluding surrounding guard regions.
508
- // The alignment requirement is due to the pointer compression cage being
509
- // located at the start of the virtual memory cage.
510
- constexpr size_t kVirtualMemoryCageAlignment =
511
- Internals::kPtrComprCageBaseAlignment;
512
-
513
- // Size of the guard regions surrounding the virtual memory cage. This assumes a
514
- // worst-case scenario of a 32-bit unsigned index being used to access an array
515
- // of 64-bit values.
516
- constexpr size_t kVirtualMemoryCageGuardRegionSize = size_t{32} << 30; // 32 GB
517
-
518
- static_assert((kVirtualMemoryCageGuardRegionSize %
519
- kVirtualMemoryCageAlignment) == 0,
520
- "The size of the virtual memory cage guard region must be a "
521
- "multiple of its required alignment.");
522
-
523
- // Minimum size of the virtual memory cage, excluding the guard regions
524
- // surrounding it. If the cage reservation fails, its size is currently halved
525
- // until either the reservation succeeds or the minimum size is reached. A
526
- // minimum of 32GB allows the 4GB pointer compression region as well as the
527
- // ArrayBuffer partition and two 10GB WASM memory cages to fit into the cage.
528
- constexpr size_t kVirtualMemoryCageMinimumSize = size_t{32} << 30; // 32 GB
529
-
530
- // For now, even if the virtual memory cage is enabled, we still allow backing
531
- // stores to be allocated outside of it as fallback. This will simplify the
532
- // initial rollout. However, if the heap sandbox is also enabled, we already use
533
- // the "enforcing mode" of the virtual memory cage. This is useful for testing.
534
- #ifdef V8_HEAP_SANDBOX
535
- constexpr bool kAllowBackingStoresOutsideCage = false;
536
- #else
537
- constexpr bool kAllowBackingStoresOutsideCage = true;
538
- #endif // V8_HEAP_SANDBOX
539
-
540
- #endif // V8_VIRTUAL_MEMORY_CAGE
541
-
542
625
  // Only perform cast check for types derived from v8::Data since
543
626
  // other types do not implement the Cast method.
544
627
  template <bool PerformCheck>
@@ -567,6 +650,10 @@ V8_INLINE void PerformCastCheck(T* data) {
567
650
  // how static casts work with std::shared_ptr.
568
651
  class BackingStoreBase {};
569
652
 
653
+ // The maximum value in enum GarbageCollectionReason, defined in heap.h.
654
+ // This is needed for histograms sampling garbage collection reasons.
655
+ constexpr int kGarbageCollectionReasonMaxValue = 25;
656
+
570
657
  } // namespace internal
571
658
 
572
659
  } // namespace v8
@@ -10,7 +10,6 @@
10
10
 
11
11
  #include <memory>
12
12
  #include <utility>
13
- #include <vector>
14
13
 
15
14
  #include "cppgc/common.h"
16
15
  #include "v8-array-buffer.h" // NOLINT(build/include_directory)
@@ -225,6 +224,7 @@ class V8_EXPORT Isolate {
225
224
 
226
225
  /**
227
226
  * Explicitly specify a startup snapshot blob. The embedder owns the blob.
227
+ * The embedder *must* ensure that the snapshot is from a trusted source.
228
228
  */
229
229
  StartupData* snapshot_blob = nullptr;
230
230
 
@@ -281,6 +281,18 @@ class V8_EXPORT Isolate {
281
281
  */
282
282
  int embedder_wrapper_type_index = -1;
283
283
  int embedder_wrapper_object_index = -1;
284
+
285
+ /**
286
+ * Callbacks to invoke in case of fatal or OOM errors.
287
+ */
288
+ FatalErrorCallback fatal_error_callback = nullptr;
289
+ OOMErrorCallback oom_error_callback = nullptr;
290
+
291
+ /**
292
+ * The following parameter is experimental and may change significantly.
293
+ * This is currently for internal testing.
294
+ */
295
+ Isolate* experimental_attach_to_shared_isolate = nullptr;
284
296
  };
285
297
 
286
298
  /**
@@ -517,6 +529,8 @@ class V8_EXPORT Isolate {
517
529
  kWasmMultiValue = 110,
518
530
  kWasmExceptionHandling = 111,
519
531
  kInvalidatedMegaDOMProtector = 112,
532
+ kFunctionPrototypeArguments = 113,
533
+ kFunctionPrototypeCaller = 114,
520
534
 
521
535
  // If you add new values here, you'll also need to update Chromium's:
522
536
  // web_feature.mojom, use_counter_callback.cc, and enums.xml. V8 changes to
@@ -585,6 +599,11 @@ class V8_EXPORT Isolate {
585
599
  */
586
600
  static Isolate* TryGetCurrent();
587
601
 
602
+ /**
603
+ * Return true if this isolate is currently active.
604
+ **/
605
+ bool IsCurrent() const;
606
+
588
607
  /**
589
608
  * Clears the set of objects held strongly by the heap. This set of
590
609
  * objects are originally built when a WeakRef is created or
@@ -617,8 +636,11 @@ class V8_EXPORT Isolate {
617
636
  * This specifies the callback called by the upcoming dynamic
618
637
  * import() language feature to load modules.
619
638
  */
639
+ V8_DEPRECATED("Use HostImportModuleDynamicallyCallback")
620
640
  void SetHostImportModuleDynamicallyCallback(
621
641
  HostImportModuleDynamicallyWithImportAssertionsCallback callback);
642
+ void SetHostImportModuleDynamicallyCallback(
643
+ HostImportModuleDynamicallyCallback callback);
622
644
 
623
645
  /**
624
646
  * This specifies the callback called by the upcoming import.meta
@@ -627,6 +649,13 @@ class V8_EXPORT Isolate {
627
649
  void SetHostInitializeImportMetaObjectCallback(
628
650
  HostInitializeImportMetaObjectCallback callback);
629
651
 
652
+ /**
653
+ * This specifies the callback called by the upcoming ShadowRealm
654
+ * construction language feature to retrieve host created globals.
655
+ */
656
+ void SetHostCreateShadowRealmContextCallback(
657
+ HostCreateShadowRealmContextCallback callback);
658
+
630
659
  /**
631
660
  * This specifies the callback called when the stack property of Error
632
661
  * is accessed.
@@ -900,11 +929,13 @@ class V8_EXPORT Isolate {
900
929
 
901
930
  /**
902
931
  * Sets the embedder heap tracer for the isolate.
932
+ * SetEmbedderHeapTracer cannot be used simultaneously with AttachCppHeap.
903
933
  */
904
934
  void SetEmbedderHeapTracer(EmbedderHeapTracer* tracer);
905
935
 
906
936
  /*
907
- * Gets the currently active heap tracer for the isolate.
937
+ * Gets the currently active heap tracer for the isolate that was set with
938
+ * SetEmbedderHeapTracer.
908
939
  */
909
940
  EmbedderHeapTracer* GetEmbedderHeapTracer();
910
941
 
@@ -924,6 +955,7 @@ class V8_EXPORT Isolate {
924
955
  * Attaches a managed C++ heap as an extension to the JavaScript heap. The
925
956
  * embedder maintains ownership of the CppHeap. At most one C++ heap can be
926
957
  * attached to V8.
958
+ * AttachCppHeap cannot be used simultaneously with SetEmbedderHeapTracer.
927
959
  *
928
960
  * This is an experimental feature and may still change significantly.
929
961
  */
@@ -1120,6 +1152,21 @@ class V8_EXPORT Isolate {
1120
1152
  */
1121
1153
  void RequestGarbageCollectionForTesting(GarbageCollectionType type);
1122
1154
 
1155
+ /**
1156
+ * Request garbage collection with a specific embedderstack state in this
1157
+ * Isolate. It is only valid to call this function if --expose_gc was
1158
+ * specified.
1159
+ *
1160
+ * This should only be used for testing purposes and not to enforce a garbage
1161
+ * collection schedule. It has strong negative impact on the garbage
1162
+ * collection performance. Use IdleNotificationDeadline() or
1163
+ * LowMemoryNotification() instead to influence the garbage collection
1164
+ * schedule.
1165
+ */
1166
+ void RequestGarbageCollectionForTesting(
1167
+ GarbageCollectionType type,
1168
+ EmbedderHeapTracer::EmbedderStackState stack_state);
1169
+
1123
1170
  /**
1124
1171
  * Set the callback to invoke for logging event.
1125
1172
  */
@@ -46,8 +46,6 @@ class String;
46
46
  template <class F>
47
47
  class Traced;
48
48
  template <class F>
49
- class TracedGlobal;
50
- template <class F>
51
49
  class TracedReference;
52
50
  class TracedReferenceBase;
53
51
  class Utils;
@@ -312,8 +310,6 @@ class Local {
312
310
  template <class F>
313
311
  friend class Traced;
314
312
  template <class F>
315
- friend class TracedGlobal;
316
- template <class F>
317
313
  friend class BasicTracedReference;
318
314
  template <class F>
319
315
  friend class TracedReference;
@@ -127,8 +127,9 @@ class V8_EXPORT Locker {
127
127
  * The current implementation is quite confusing and leads to unexpected
128
128
  * results if anybody uses v8::Locker in the current process.
129
129
  */
130
+ V8_DEPRECATE_SOON("This method will be removed.")
130
131
  static bool WasEverUsed();
131
- V8_DEPRECATE_SOON("Use WasEverUsed instead")
132
+ V8_DEPRECATED("Use WasEverUsed instead")
132
133
  static bool IsActive();
133
134
 
134
135
  // Disallow copying and assigning.
@@ -11,6 +11,7 @@
11
11
 
12
12
  #include "v8-local-handle.h" // NOLINT(build/include_directory)
13
13
  #include "v8-maybe.h" // NOLINT(build/include_directory)
14
+ #include "v8-primitive.h" // NOLINT(build/include_directory)
14
15
  #include "v8config.h" // NOLINT(build/include_directory)
15
16
 
16
17
  namespace v8 {
@@ -60,38 +61,15 @@ class ScriptOriginOptions {
60
61
  */
61
62
  class V8_EXPORT ScriptOrigin {
62
63
  public:
63
- #if defined(_MSC_VER) && _MSC_VER >= 1910 /* Disable on VS2015 */
64
- V8_DEPRECATE_SOON("Use constructor with primitive C++ types")
65
- #endif
66
- ScriptOrigin(
67
- Local<Value> resource_name, Local<Integer> resource_line_offset,
68
- Local<Integer> resource_column_offset,
69
- Local<Boolean> resource_is_shared_cross_origin = Local<Boolean>(),
70
- Local<Integer> script_id = Local<Integer>(),
71
- Local<Value> source_map_url = Local<Value>(),
72
- Local<Boolean> resource_is_opaque = Local<Boolean>(),
73
- Local<Boolean> is_wasm = Local<Boolean>(),
74
- Local<Boolean> is_module = Local<Boolean>(),
75
- Local<PrimitiveArray> host_defined_options = Local<PrimitiveArray>());
76
- #if defined(_MSC_VER) && _MSC_VER >= 1910 /* Disable on VS2015 */
77
- V8_DEPRECATE_SOON("Use constructor that takes an isolate")
78
- #endif
79
- explicit ScriptOrigin(
80
- Local<Value> resource_name, int resource_line_offset = 0,
81
- int resource_column_offset = 0,
82
- bool resource_is_shared_cross_origin = false, int script_id = -1,
83
- Local<Value> source_map_url = Local<Value>(),
84
- bool resource_is_opaque = false, bool is_wasm = false,
85
- bool is_module = false,
86
- Local<PrimitiveArray> host_defined_options = Local<PrimitiveArray>());
87
- V8_INLINE ScriptOrigin(
88
- Isolate* isolate, Local<Value> resource_name,
89
- int resource_line_offset = 0, int resource_column_offset = 0,
90
- bool resource_is_shared_cross_origin = false, int script_id = -1,
91
- Local<Value> source_map_url = Local<Value>(),
92
- bool resource_is_opaque = false, bool is_wasm = false,
93
- bool is_module = false,
94
- Local<PrimitiveArray> host_defined_options = Local<PrimitiveArray>())
64
+ V8_INLINE ScriptOrigin(Isolate* isolate, Local<Value> resource_name,
65
+ int resource_line_offset = 0,
66
+ int resource_column_offset = 0,
67
+ bool resource_is_shared_cross_origin = false,
68
+ int script_id = -1,
69
+ Local<Value> source_map_url = Local<Value>(),
70
+ bool resource_is_opaque = false, bool is_wasm = false,
71
+ bool is_module = false,
72
+ Local<Data> host_defined_options = Local<Data>())
95
73
  : isolate_(isolate),
96
74
  resource_name_(resource_name),
97
75
  resource_line_offset_(resource_line_offset),
@@ -100,23 +78,22 @@ class V8_EXPORT ScriptOrigin {
100
78
  is_module),
101
79
  script_id_(script_id),
102
80
  source_map_url_(source_map_url),
103
- host_defined_options_(host_defined_options) {}
81
+ host_defined_options_(host_defined_options) {
82
+ VerifyHostDefinedOptions();
83
+ }
104
84
 
105
85
  V8_INLINE Local<Value> ResourceName() const;
106
- V8_DEPRECATE_SOON("Use getter with primitive C++ types.")
107
- V8_INLINE Local<Integer> ResourceLineOffset() const;
108
- V8_DEPRECATE_SOON("Use getter with primitive C++ types.")
109
- V8_INLINE Local<Integer> ResourceColumnOffset() const;
110
- V8_DEPRECATE_SOON("Use getter with primitive C++ types.")
111
- V8_INLINE Local<Integer> ScriptID() const;
112
86
  V8_INLINE int LineOffset() const;
113
87
  V8_INLINE int ColumnOffset() const;
114
88
  V8_INLINE int ScriptId() const;
115
89
  V8_INLINE Local<Value> SourceMapUrl() const;
116
- V8_INLINE Local<PrimitiveArray> HostDefinedOptions() const;
90
+ V8_DEPRECATE_SOON("Use GetHostDefinedOptions")
91
+ Local<PrimitiveArray> HostDefinedOptions() const;
92
+ V8_INLINE Local<Data> GetHostDefinedOptions() const;
117
93
  V8_INLINE ScriptOriginOptions Options() const { return options_; }
118
94
 
119
95
  private:
96
+ void VerifyHostDefinedOptions() const;
120
97
  Isolate* isolate_;
121
98
  Local<Value> resource_name_;
122
99
  int resource_line_offset_;
@@ -124,7 +101,7 @@ class V8_EXPORT ScriptOrigin {
124
101
  ScriptOriginOptions options_;
125
102
  int script_id_;
126
103
  Local<Value> source_map_url_;
127
- Local<PrimitiveArray> host_defined_options_;
104
+ Local<Data> host_defined_options_;
128
105
  };
129
106
 
130
107
  /**
@@ -212,8 +189,6 @@ class V8_EXPORT Message {
212
189
  bool IsSharedCrossOrigin() const;
213
190
  bool IsOpaque() const;
214
191
 
215
- V8_DEPRECATE_SOON("Use the version that takes a std::ostream&.")
216
- static void PrintCurrentStackTrace(Isolate* isolate, FILE* out);
217
192
  static void PrintCurrentStackTrace(Isolate* isolate, std::ostream& out);
218
193
 
219
194
  static const int kNoLineNumberInfo = 0;
@@ -224,7 +199,7 @@ class V8_EXPORT Message {
224
199
 
225
200
  Local<Value> ScriptOrigin::ResourceName() const { return resource_name_; }
226
201
 
227
- Local<PrimitiveArray> ScriptOrigin::HostDefinedOptions() const {
202
+ Local<Data> ScriptOrigin::GetHostDefinedOptions() const {
228
203
  return host_defined_options_;
229
204
  }
230
205