node-linux-s390x 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 +238 -228
  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
@@ -27,6 +27,11 @@ class V8_EXPORT Data {
27
27
  */
28
28
  bool IsModule() const;
29
29
 
30
+ /**
31
+ * Returns tru if this data is a |v8::FixedArray|
32
+ */
33
+ bool IsFixedArray() const;
34
+
30
35
  /**
31
36
  * Returns true if this data is a |v8::Private|.
32
37
  */
@@ -58,6 +63,16 @@ class V8_EXPORT FixedArray : public Data {
58
63
  public:
59
64
  int Length() const;
60
65
  Local<Data> Get(Local<Context> context, int i) const;
66
+
67
+ V8_INLINE static FixedArray* Cast(Data* data) {
68
+ #ifdef V8_ENABLE_CHECKS
69
+ CheckCast(data);
70
+ #endif
71
+ return reinterpret_cast<FixedArray*>(data);
72
+ }
73
+
74
+ private:
75
+ static void CheckCast(Data* obj);
61
76
  };
62
77
 
63
78
  } // namespace v8
@@ -7,8 +7,8 @@
7
7
 
8
8
  #include <stdint.h>
9
9
 
10
- #include "v8-local-handle.h" // NOLINT(build/include_directory)
11
- #include "v8config.h" // NOLINT(build/include_directory)
10
+ #include "v8-script.h" // NOLINT(build/include_directory)
11
+ #include "v8config.h" // NOLINT(build/include_directory)
12
12
 
13
13
  namespace v8 {
14
14
 
@@ -20,13 +20,18 @@ class String;
20
20
  */
21
21
  class V8_EXPORT StackFrame {
22
22
  public:
23
+ /**
24
+ * Returns the source location, 0-based, for the associated function call.
25
+ */
26
+ Location GetLocation() const;
27
+
23
28
  /**
24
29
  * Returns the number, 1-based, of the line for the associate function call.
25
30
  * This method will return Message::kNoLineNumberInfo if it is unable to
26
31
  * retrieve the line number, or if kLineNumber was not passed as an option
27
32
  * when capturing the StackTrace.
28
33
  */
29
- int GetLineNumber() const;
34
+ int GetLineNumber() const { return GetLocation().GetLineNumber() + 1; }
30
35
 
31
36
  /**
32
37
  * Returns the 1-based column offset on the line for the associated function
@@ -35,7 +40,7 @@ class V8_EXPORT StackFrame {
35
40
  * the column number, or if kColumnOffset was not passed as an option when
36
41
  * capturing the StackTrace.
37
42
  */
38
- int GetColumn() const;
43
+ int GetColumn() const { return GetLocation().GetColumnNumber() + 1; }
39
44
 
40
45
  /**
41
46
  * Returns the id of the script for the function for this StackFrame.
@@ -144,6 +149,18 @@ class V8_EXPORT StackTrace {
144
149
  */
145
150
  static Local<StackTrace> CurrentStackTrace(
146
151
  Isolate* isolate, int frame_limit, StackTraceOptions options = kDetailed);
152
+
153
+ /**
154
+ * Returns the first valid script name or source URL starting at the top of
155
+ * the JS stack. The returned string is either an empty handle if no script
156
+ * name/url was found or a non-zero-length string.
157
+ *
158
+ * This method is equivalent to calling StackTrace::CurrentStackTrace and
159
+ * walking the resulting frames from the beginning until a non-empty script
160
+ * name/url is found. The difference is that this method won't allocate
161
+ * a stack trace.
162
+ */
163
+ static Local<String> CurrentScriptNameOrSourceURL(Isolate* isolate);
147
164
  };
148
165
 
149
166
  } // namespace v8
@@ -34,24 +34,21 @@ class V8_EXPORT EmbedderRootsHandler {
34
34
  virtual ~EmbedderRootsHandler() = default;
35
35
 
36
36
  /**
37
- * Returns true if the TracedGlobal handle should be considered as root for
38
- * the currently running non-tracing garbage collection and false otherwise.
39
- * The default implementation will keep all TracedGlobal references as roots.
37
+ * Returns true if the |TracedReference| handle should be considered as root
38
+ * for the currently running non-tracing garbage collection and false
39
+ * otherwise. The default implementation will keep all |TracedReference|
40
+ * references as roots.
40
41
  *
41
42
  * If this returns false, then V8 may decide that the object referred to by
42
- * such a handle is reclaimed. In that case:
43
- * - No action is required if handles are used with destructors, i.e., by just
44
- * using |TracedGlobal|.
45
- * - When run without destructors, i.e., by using |TracedReference|, V8 calls
46
- * |ResetRoot|.
43
+ * such a handle is reclaimed. In that case, V8 calls |ResetRoot()| for the
44
+ * |TracedReference|.
47
45
  *
48
- * Note that the |handle| is different from the handle that the embedder holds
46
+ * Note that the `handle` is different from the handle that the embedder holds
49
47
  * for retaining the object. The embedder may use |WrapperClassId()| to
50
48
  * distinguish cases where it wants handles to be treated as roots from not
51
49
  * being treated as roots.
52
50
  */
53
51
  virtual bool IsRoot(const v8::TracedReference<v8::Value>& handle) = 0;
54
- virtual bool IsRoot(const v8::TracedGlobal<v8::Value>& handle) = 0;
55
52
 
56
53
  /**
57
54
  * Used in combination with |IsRoot|. Called by V8 when an
@@ -83,12 +80,11 @@ class V8_EXPORT EmbedderHeapTracer {
83
80
  };
84
81
 
85
82
  /**
86
- * Interface for iterating through TracedGlobal handles.
83
+ * Interface for iterating through |TracedReference| handles.
87
84
  */
88
85
  class V8_EXPORT TracedGlobalHandleVisitor {
89
86
  public:
90
87
  virtual ~TracedGlobalHandleVisitor() = default;
91
- virtual void VisitTracedGlobalHandle(const TracedGlobal<Value>& handle) {}
92
88
  virtual void VisitTracedReference(const TracedReference<Value>& handle) {}
93
89
  };
94
90
 
@@ -113,8 +109,8 @@ class V8_EXPORT EmbedderHeapTracer {
113
109
  virtual ~EmbedderHeapTracer() = default;
114
110
 
115
111
  /**
116
- * Iterates all TracedGlobal handles created for the v8::Isolate the tracer is
117
- * attached to.
112
+ * Iterates all |TracedReference| handles created for the |v8::Isolate| the
113
+ * tracer is attached to.
118
114
  */
119
115
  void IterateTracedGlobalHandles(TracedGlobalHandleVisitor* visitor);
120
116
 
@@ -124,14 +120,6 @@ class V8_EXPORT EmbedderHeapTracer {
124
120
  */
125
121
  void SetStackStart(void* stack_start);
126
122
 
127
- /**
128
- * Called by the embedder to notify V8 of an empty execution stack.
129
- */
130
- V8_DEPRECATE_SOON(
131
- "This call only optimized internal caches which V8 is able to figure out "
132
- "on its own now.")
133
- void NotifyEmptyEmbedderStack();
134
-
135
123
  /**
136
124
  * Called by v8 to register internal fields of found wrappers.
137
125
  *
@@ -197,7 +185,6 @@ class V8_EXPORT EmbedderHeapTracer {
197
185
  */
198
186
  virtual bool IsRootForNonTracingGC(
199
187
  const v8::TracedReference<v8::Value>& handle);
200
- virtual bool IsRootForNonTracingGC(const v8::TracedGlobal<v8::Value>& handle);
201
188
 
202
189
  /**
203
190
  * See documentation on EmbedderRootsHandler.
@@ -205,13 +192,6 @@ class V8_EXPORT EmbedderHeapTracer {
205
192
  virtual void ResetHandleInNonTracingGC(
206
193
  const v8::TracedReference<v8::Value>& handle);
207
194
 
208
- /*
209
- * Called by the embedder to immediately perform a full garbage collection.
210
- *
211
- * Should only be used in testing code.
212
- */
213
- void GarbageCollectionForTesting(EmbedderStackState stack_state);
214
-
215
195
  /*
216
196
  * Called by the embedder to signal newly allocated or freed memory. Not bound
217
197
  * to tracing phases. Embedders should trade off when increments are reported
@@ -0,0 +1,51 @@
1
+ // Copyright 2021 the V8 project authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ #ifndef INCLUDE_V8_EMBEDDER_STATE_SCOPE_H_
6
+ #define INCLUDE_V8_EMBEDDER_STATE_SCOPE_H_
7
+
8
+ #include <memory>
9
+
10
+ #include "v8-context.h" // NOLINT(build/include_directory)
11
+ #include "v8-internal.h" // NOLINT(build/include_directory)
12
+ #include "v8-local-handle.h" // NOLINT(build/include_directory)
13
+
14
+ namespace v8 {
15
+
16
+ namespace internal {
17
+ class EmbedderState;
18
+ } // namespace internal
19
+
20
+ // A StateTag represents a possible state of the embedder.
21
+ enum class EmbedderStateTag : uint8_t {
22
+ // reserved
23
+ EMPTY = 0,
24
+ OTHER = 1,
25
+ // embedder can define any state after
26
+ };
27
+
28
+ // A stack-allocated class that manages an embedder state on the isolate.
29
+ // After an EmbedderState scope has been created, a new embedder state will be
30
+ // pushed on the isolate stack.
31
+ class V8_EXPORT EmbedderStateScope {
32
+ public:
33
+ EmbedderStateScope(Isolate* isolate, Local<v8::Context> context,
34
+ EmbedderStateTag tag);
35
+
36
+ ~EmbedderStateScope();
37
+
38
+ private:
39
+ // Declaring operator new and delete as deleted is not spec compliant.
40
+ // Therefore declare them private instead to disable dynamic alloc
41
+ void* operator new(size_t size);
42
+ void* operator new[](size_t size);
43
+ void operator delete(void*, size_t);
44
+ void operator delete[](void*, size_t);
45
+
46
+ std::unique_ptr<internal::EmbedderState> embedder_state_;
47
+ };
48
+
49
+ } // namespace v8
50
+
51
+ #endif // INCLUDE_V8_EMBEDDER_STATE_SCOPE_H_
@@ -169,13 +169,6 @@ class V8_EXPORT TryCatch {
169
169
  */
170
170
  void SetCaptureMessage(bool value);
171
171
 
172
- V8_DEPRECATE_SOON(
173
- "This is private information that should not be exposed by the API")
174
- static void* JSStackComparableAddress(TryCatch* handler) {
175
- if (handler == nullptr) return nullptr;
176
- return reinterpret_cast<void*>(handler->JSStackComparableAddressPrivate());
177
- }
178
-
179
172
  TryCatch(const TryCatch&) = delete;
180
173
  void operator=(const TryCatch&) = delete;
181
174
 
@@ -18,6 +18,7 @@
18
18
  namespace v8 {
19
19
 
20
20
  class Context;
21
+ class UnboundScript;
21
22
 
22
23
  /**
23
24
  * A JavaScript function object (ECMA-262, 15.3).
@@ -58,6 +59,8 @@ class V8_EXPORT Function : public Object {
58
59
  void SetName(Local<String> name);
59
60
  Local<Value> GetName() const;
60
61
 
62
+ MaybeLocal<UnboundScript> GetUnboundScript() const;
63
+
61
64
  /**
62
65
  * Name inferred from variable or property assignment of this function.
63
66
  * Used to facilitate debugging and profiling of JavaScript code written
@@ -8,10 +8,11 @@
8
8
  #include <stddef.h>
9
9
  #include <stdint.h>
10
10
 
11
- #include "v8-internal.h" // NOLINT(build/include_directory)
12
- #include "v8-isolate.h" // NOLINT(build/include_directory)
13
- #include "v8-platform.h" // NOLINT(build/include_directory)
14
- #include "v8config.h" // NOLINT(build/include_directory)
11
+ #include "v8-callbacks.h" // NOLINT(build/include_directory)
12
+ #include "v8-internal.h" // NOLINT(build/include_directory)
13
+ #include "v8-isolate.h" // NOLINT(build/include_directory)
14
+ #include "v8-platform.h" // NOLINT(build/include_directory)
15
+ #include "v8config.h" // NOLINT(build/include_directory)
15
16
 
16
17
  // We reserve the V8_* prefix for macros defined in V8 public API and
17
18
  // assume there are no name conflicts with the embedder's code.
@@ -99,8 +100,10 @@ class V8_EXPORT V8 {
99
100
  const int kBuildConfiguration =
100
101
  (internal::PointerCompressionIsEnabled() ? kPointerCompression : 0) |
101
102
  (internal::SmiValuesAre31Bits() ? k31BitSmis : 0) |
102
- (internal::HeapSandboxIsEnabled() ? kHeapSandbox : 0) |
103
- (internal::VirtualMemoryCageIsEnabled() ? kVirtualMemoryCage : 0);
103
+ (internal::SandboxedExternalPointersAreEnabled()
104
+ ? kSandboxedExternalPointers
105
+ : 0) |
106
+ (internal::SandboxIsEnabled() ? kSandbox : 0);
104
107
  return Initialize(kBuildConfiguration);
105
108
  }
106
109
 
@@ -180,53 +183,75 @@ class V8_EXPORT V8 {
180
183
  * Clears all references to the v8::Platform. This should be invoked after
181
184
  * V8 was disposed.
182
185
  */
183
- static void ShutdownPlatform();
186
+ static void DisposePlatform();
187
+ V8_DEPRECATED("Use DisposePlatform()")
188
+ static void ShutdownPlatform() { DisposePlatform(); }
184
189
 
185
- #ifdef V8_VIRTUAL_MEMORY_CAGE
190
+ #ifdef V8_SANDBOX
186
191
  //
187
- // Virtual Memory Cage related API.
192
+ // Sandbox related API.
188
193
  //
189
194
  // This API is not yet stable and subject to changes in the future.
190
195
  //
191
196
 
192
197
  /**
193
- * Initializes the virtual memory cage for V8.
198
+ * Initializes the V8 sandbox.
194
199
  *
195
200
  * This must be invoked after the platform was initialized but before V8 is
196
- * initialized. The virtual memory cage is torn down during platform shutdown.
201
+ * initialized. The sandbox is torn down during platform shutdown.
197
202
  * Returns true on success, false otherwise.
198
203
  *
199
- * TODO(saelo) Once it is no longer optional to create the virtual memory
200
- * cage when compiling with V8_VIRTUAL_MEMORY_CAGE, the cage initialization
201
- * will likely happen as part of V8::Initialize, at which point this function
202
- * should be removed.
204
+ * TODO(saelo) Once it is no longer optional to initialize the sandbox when
205
+ * compiling with V8_SANDBOX, the sandbox initialization will likely happen
206
+ * as part of V8::Initialize, at which point this function should be removed.
203
207
  */
204
- static bool InitializeVirtualMemoryCage();
208
+ static bool InitializeSandbox();
209
+ V8_DEPRECATE_SOON("Use InitializeSandbox()")
210
+ static bool InitializeVirtualMemoryCage() { return InitializeSandbox(); }
205
211
 
206
212
  /**
207
- * Provides access to the virtual memory cage page allocator.
213
+ * Provides access to the virtual address subspace backing the sandbox.
208
214
  *
209
- * This allocator allocates pages inside the virtual memory cage. It can for
210
- * example be used to obtain virtual memory for ArrayBuffer backing stores,
211
- * which must be located inside the cage.
215
+ * This can be used to allocate pages inside the sandbox, for example to
216
+ * obtain virtual memory for ArrayBuffer backing stores, which must be
217
+ * located inside the sandbox.
212
218
  *
213
- * It should be assumed that an attacker can corrupt data inside the cage,
214
- * and so in particular the contents of pages returned by this allocator,
215
- * arbitrarily and concurrently. Due to this, it is recommended to to only
216
- * place pure data buffers in pages obtained through this allocator.
219
+ * It should be assumed that an attacker can corrupt data inside the sandbox,
220
+ * and so in particular the contents of pages allocagted in this virtual
221
+ * address space, arbitrarily and concurrently. Due to this, it is
222
+ * recommended to to only place pure data buffers in them.
217
223
  *
218
- * This function must only be called after initializing the virtual memory
219
- * cage and V8.
224
+ * This function must only be called after initializing the sandbox.
220
225
  */
226
+ static VirtualAddressSpace* GetSandboxAddressSpace();
227
+ V8_DEPRECATE_SOON("Use GetSandboxAddressSpace()")
221
228
  static PageAllocator* GetVirtualMemoryCagePageAllocator();
222
229
 
223
230
  /**
224
- * Returns the size of the virtual memory cage in bytes.
231
+ * Returns the size of the sandbox in bytes.
225
232
  *
226
- * If the cage has not been initialized, or if the initialization failed,
233
+ * If the sandbox has not been initialized, or if the initialization failed,
227
234
  * this returns zero.
228
235
  */
229
- static size_t GetVirtualMemoryCageSizeInBytes();
236
+ static size_t GetSandboxSizeInBytes();
237
+ V8_DEPRECATE_SOON("Use GetSandboxSizeInBytes()")
238
+ static size_t GetVirtualMemoryCageSizeInBytes() {
239
+ return GetSandboxSizeInBytes();
240
+ }
241
+
242
+ /**
243
+ * Returns whether the sandbox is configured securely.
244
+ *
245
+ * If V8 cannot create a proper sandbox, it will fall back to creating a
246
+ * sandbox that doesn't have the desired security properties but at least
247
+ * still allows V8 to function. This API can be used to determine if such an
248
+ * insecure sandbox is being used, in which case it will return false.
249
+ */
250
+ static bool IsSandboxConfiguredSecurely();
251
+ V8_DEPRECATE_SOON("Use IsSandboxConfiguredSecurely()")
252
+ static bool IsUsingSecureVirtualMemoryCage() {
253
+ return IsSandboxConfiguredSecurely();
254
+ }
230
255
  #endif
231
256
 
232
257
  /**
@@ -251,6 +276,14 @@ class V8_EXPORT V8 {
251
276
  UnhandledExceptionCallback unhandled_exception_callback);
252
277
  #endif
253
278
 
279
+ /**
280
+ * Allows the host application to provide a callback that will be called when
281
+ * v8 has encountered a fatal failure to allocate memory and is about to
282
+ * terminate.
283
+ */
284
+
285
+ static void SetFatalMemoryErrorCallback(OOMErrorCallback oom_error_callback);
286
+
254
287
  /**
255
288
  * Get statistics about the shared memory usage.
256
289
  */
@@ -262,8 +295,8 @@ class V8_EXPORT V8 {
262
295
  enum BuildConfigurationFeatures {
263
296
  kPointerCompression = 1 << 0,
264
297
  k31BitSmis = 1 << 1,
265
- kHeapSandbox = 1 << 2,
266
- kVirtualMemoryCage = 1 << 3,
298
+ kSandboxedExternalPointers = 1 << 2,
299
+ kSandbox = 1 << 3,
267
300
  };
268
301
 
269
302
  /**