node-linux-s390x 22.8.0 → 23.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.
- package/CHANGELOG.md +395 -1656
- package/LICENSE +10 -33
- package/README.md +16 -7
- package/bin/node +0 -0
- package/include/node/common.gypi +3 -3
- package/include/node/config.gypi +7 -4
- package/include/node/cppgc/allocation.h +10 -11
- package/include/node/cppgc/garbage-collected.h +8 -0
- package/include/node/cppgc/heap-statistics.h +2 -0
- package/include/node/cppgc/internal/api-constants.h +6 -1
- package/include/node/cppgc/internal/compiler-specific.h +9 -1
- package/include/node/cppgc/internal/gc-info.h +12 -10
- package/include/node/cppgc/internal/member-storage.h +6 -0
- package/include/node/cppgc/internal/name-trait.h +5 -1
- package/include/node/cppgc/name-provider.h +7 -0
- package/include/node/js_native_api.h +4 -0
- package/include/node/node.h +8 -18
- package/include/node/node_api.h +12 -0
- package/include/node/node_version.h +3 -3
- package/include/node/openssl/archs/BSD-x86/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/BSD-x86/asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/BSD-x86/asm_avx2/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/BSD-x86/no-asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/BSD-x86/no-asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/BSD-x86_64/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/BSD-x86_64/asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/BSD-x86_64/asm_avx2/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/BSD-x86_64/asm_avx2/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/BSD-x86_64/no-asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/BSD-x86_64/no-asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/VC-WIN32/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/VC-WIN32/asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/VC-WIN32/asm_avx2/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/VC-WIN32/asm_avx2/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/VC-WIN32/no-asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/VC-WIN32/no-asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/VC-WIN64-ARM/no-asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/VC-WIN64-ARM/no-asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/VC-WIN64A/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/VC-WIN64A/asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/VC-WIN64A/asm_avx2/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/VC-WIN64A/asm_avx2/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/VC-WIN64A/no-asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/VC-WIN64A/no-asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/aix64-gcc-as/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/aix64-gcc-as/asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/aix64-gcc-as/asm_avx2/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/aix64-gcc-as/asm_avx2/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/aix64-gcc-as/no-asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/aix64-gcc-as/no-asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/darwin-i386-cc/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/darwin-i386-cc/asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/darwin-i386-cc/asm_avx2/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/darwin-i386-cc/asm_avx2/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/darwin-i386-cc/no-asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/darwin-i386-cc/no-asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/darwin64-arm64-cc/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/darwin64-arm64-cc/asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/darwin64-arm64-cc/asm_avx2/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/darwin64-arm64-cc/asm_avx2/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/darwin64-arm64-cc/no-asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/darwin64-arm64-cc/no-asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/darwin64-x86_64-cc/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/darwin64-x86_64-cc/asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/darwin64-x86_64-cc/asm_avx2/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/darwin64-x86_64-cc/asm_avx2/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/darwin64-x86_64-cc/no-asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/darwin64-x86_64-cc/no-asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux-aarch64/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux-aarch64/asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux-aarch64/asm_avx2/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux-aarch64/asm_avx2/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux-aarch64/no-asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux-aarch64/no-asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux-armv4/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux-armv4/asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux-armv4/asm_avx2/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux-armv4/asm_avx2/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux-armv4/no-asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux-armv4/no-asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux-elf/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux-elf/asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux-elf/asm_avx2/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux-elf/asm_avx2/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux-elf/no-asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux-elf/no-asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux-ppc64le/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux-ppc64le/asm_avx2/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux-ppc64le/asm_avx2/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux-ppc64le/no-asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux-ppc64le/no-asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux-x86_64/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux-x86_64/asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux-x86_64/asm_avx2/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux-x86_64/asm_avx2/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux-x86_64/no-asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux-x86_64/no-asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux32-s390x/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux32-s390x/asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux32-s390x/asm_avx2/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux32-s390x/asm_avx2/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux32-s390x/no-asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux32-s390x/no-asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux64-loongarch64/no-asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux64-loongarch64/no-asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux64-mips64/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux64-mips64/asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux64-mips64/asm_avx2/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux64-mips64/asm_avx2/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux64-mips64/no-asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux64-mips64/no-asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux64-riscv64/no-asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux64-riscv64/no-asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux64-s390x/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux64-s390x/asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux64-s390x/asm_avx2/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux64-s390x/asm_avx2/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/linux64-s390x/no-asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux64-s390x/no-asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/solaris-x86-gcc/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/solaris-x86-gcc/asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/solaris-x86-gcc/asm_avx2/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/solaris-x86-gcc/asm_avx2/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/solaris-x86-gcc/no-asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/solaris-x86-gcc/no-asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/solaris64-x86_64-gcc/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/solaris64-x86_64-gcc/asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/solaris64-x86_64-gcc/asm_avx2/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/solaris64-x86_64-gcc/asm_avx2/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/archs/solaris64-x86_64-gcc/no-asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/solaris64-x86_64-gcc/no-asm/include/openssl/opensslv.h +5 -5
- package/include/node/openssl/sslerr.h +3 -1
- package/include/node/openssl/tls1.h +3 -1
- package/include/node/v8-array-buffer.h +44 -24
- package/include/node/v8-callbacks.h +10 -5
- package/include/node/v8-context.h +41 -9
- package/include/node/v8-cppgc.h +3 -55
- package/include/node/v8-date.h +9 -0
- package/include/node/v8-embedder-heap.h +4 -1
- package/include/node/v8-exception.h +70 -0
- package/include/node/v8-function-callback.h +203 -62
- package/include/node/v8-function.h +4 -3
- package/include/node/v8-handle-base.h +2 -2
- package/include/node/v8-initialization.h +18 -1
- package/include/node/v8-internal.h +303 -58
- package/include/node/v8-isolate.h +51 -39
- package/include/node/v8-local-handle.h +18 -19
- package/include/node/v8-message.h +0 -21
- package/include/node/v8-microtask-queue.h +0 -5
- package/include/node/v8-object.h +284 -35
- package/include/node/v8-persistent-handle.h +0 -19
- package/include/node/v8-platform.h +21 -35
- package/include/node/v8-primitive.h +92 -1
- package/include/node/v8-profiler.h +38 -1
- package/include/node/v8-promise.h +2 -2
- package/include/node/v8-sandbox.h +173 -0
- package/include/node/v8-script.h +44 -14
- package/include/node/v8-snapshot.h +38 -2
- package/include/node/v8-template.h +105 -263
- package/include/node/v8-traced-handle.h +4 -15
- package/include/node/v8-unwinder.h +2 -1
- package/include/node/v8-value.h +3 -2
- package/include/node/v8-version.h +3 -3
- package/include/node/v8-wasm.h +3 -0
- package/include/node/v8config.h +47 -7
- package/package.json +1 -1
- package/share/doc/node/gdbinit +41 -3
- package/share/doc/node/lldb_commands.py +7 -2
- package/share/man/man1/node.1 +3 -14
|
@@ -18,11 +18,12 @@ namespace v8 {
|
|
|
18
18
|
class SharedArrayBuffer;
|
|
19
19
|
|
|
20
20
|
#ifndef V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT
|
|
21
|
-
//
|
|
21
|
+
// Defined using gn arg `v8_array_buffer_internal_field_count`.
|
|
22
22
|
#define V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT 2
|
|
23
23
|
#endif
|
|
24
24
|
|
|
25
25
|
enum class ArrayBufferCreationMode { kInternalized, kExternalized };
|
|
26
|
+
enum class BackingStoreInitializationMode { kZeroInitialized, kUninitialized };
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
29
|
* A wrapper around the backing store (i.e. the raw memory) of an array buffer.
|
|
@@ -87,6 +88,9 @@ class V8_EXPORT BackingStore : public v8::internal::BackingStoreBase {
|
|
|
87
88
|
* Assumes that the backing_store was allocated by the ArrayBuffer allocator
|
|
88
89
|
* of the given isolate.
|
|
89
90
|
*/
|
|
91
|
+
V8_DEPRECATED(
|
|
92
|
+
"Reallocate is unsafe, please do not use. Please allocate a new "
|
|
93
|
+
"BackingStore and copy instead.")
|
|
90
94
|
static std::unique_ptr<BackingStore> Reallocate(
|
|
91
95
|
v8::Isolate* isolate, std::unique_ptr<BackingStore> backing_store,
|
|
92
96
|
size_t byte_length);
|
|
@@ -179,6 +183,9 @@ class V8_EXPORT ArrayBuffer : public Object {
|
|
|
179
183
|
*
|
|
180
184
|
* The default implementation allocates a new block and copies data.
|
|
181
185
|
*/
|
|
186
|
+
V8_DEPRECATED(
|
|
187
|
+
"Reallocate is unsafe, please do not use. Please allocate new memory "
|
|
188
|
+
"and copy instead.")
|
|
182
189
|
virtual void* Reallocate(void* data, size_t old_length, size_t new_length);
|
|
183
190
|
|
|
184
191
|
/**
|
|
@@ -211,12 +218,15 @@ class V8_EXPORT ArrayBuffer : public Object {
|
|
|
211
218
|
size_t MaxByteLength() const;
|
|
212
219
|
|
|
213
220
|
/**
|
|
214
|
-
* Create a new ArrayBuffer. Allocate |byte_length| bytes
|
|
215
|
-
* Allocated memory will be owned by a
|
|
216
|
-
* will be deallocated when it is garbage-collected,
|
|
221
|
+
* Create a new ArrayBuffer. Allocate |byte_length| bytes, which are either
|
|
222
|
+
* zero-initialized or uninitialized. Allocated memory will be owned by a
|
|
223
|
+
* created ArrayBuffer and will be deallocated when it is garbage-collected,
|
|
217
224
|
* unless the object is externalized.
|
|
218
225
|
*/
|
|
219
|
-
static Local<ArrayBuffer> New(
|
|
226
|
+
static Local<ArrayBuffer> New(
|
|
227
|
+
Isolate* isolate, size_t byte_length,
|
|
228
|
+
BackingStoreInitializationMode initialization_mode =
|
|
229
|
+
BackingStoreInitializationMode::kZeroInitialized);
|
|
220
230
|
|
|
221
231
|
/**
|
|
222
232
|
* Create a new ArrayBuffer with an existing backing store.
|
|
@@ -235,15 +245,18 @@ class V8_EXPORT ArrayBuffer : public Object {
|
|
|
235
245
|
|
|
236
246
|
/**
|
|
237
247
|
* Returns a new standalone BackingStore that is allocated using the array
|
|
238
|
-
* buffer allocator of the isolate. The
|
|
248
|
+
* buffer allocator of the isolate. The allocation can either be zero
|
|
249
|
+
* intialized, or uninitialized. The result can be later passed to
|
|
239
250
|
* ArrayBuffer::New.
|
|
240
251
|
*
|
|
241
252
|
* If the allocator returns nullptr, then the function may cause GCs in the
|
|
242
253
|
* given isolate and re-try the allocation. If GCs do not help, then the
|
|
243
254
|
* function will crash with an out-of-memory error.
|
|
244
255
|
*/
|
|
245
|
-
static std::unique_ptr<BackingStore> NewBackingStore(
|
|
246
|
-
|
|
256
|
+
static std::unique_ptr<BackingStore> NewBackingStore(
|
|
257
|
+
Isolate* isolate, size_t byte_length,
|
|
258
|
+
BackingStoreInitializationMode initialization_mode =
|
|
259
|
+
BackingStoreInitializationMode::kZeroInitialized);
|
|
247
260
|
/**
|
|
248
261
|
* Returns a new standalone BackingStore that takes over the ownership of
|
|
249
262
|
* the given buffer. The destructor of the BackingStore invokes the given
|
|
@@ -287,7 +300,7 @@ class V8_EXPORT ArrayBuffer : public Object {
|
|
|
287
300
|
* preventing JavaScript from ever accessing underlying backing store.
|
|
288
301
|
* ArrayBuffer should have been externalized and must be detachable.
|
|
289
302
|
*/
|
|
290
|
-
|
|
303
|
+
V8_DEPRECATED(
|
|
291
304
|
"Use the version which takes a key parameter (passing a null handle is "
|
|
292
305
|
"ok).")
|
|
293
306
|
void Detach();
|
|
@@ -337,8 +350,9 @@ class V8_EXPORT ArrayBuffer : public Object {
|
|
|
337
350
|
return static_cast<ArrayBuffer*>(value);
|
|
338
351
|
}
|
|
339
352
|
|
|
340
|
-
static
|
|
341
|
-
|
|
353
|
+
static constexpr int kInternalFieldCount =
|
|
354
|
+
V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT;
|
|
355
|
+
static constexpr int kEmbedderFieldCount = kInternalFieldCount;
|
|
342
356
|
|
|
343
357
|
private:
|
|
344
358
|
ArrayBuffer();
|
|
@@ -346,7 +360,7 @@ class V8_EXPORT ArrayBuffer : public Object {
|
|
|
346
360
|
};
|
|
347
361
|
|
|
348
362
|
#ifndef V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT
|
|
349
|
-
//
|
|
363
|
+
// Defined using gn arg `v8_array_buffer_view_internal_field_count`.
|
|
350
364
|
#define V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT 2
|
|
351
365
|
#endif
|
|
352
366
|
|
|
@@ -393,10 +407,9 @@ class V8_EXPORT ArrayBufferView : public Object {
|
|
|
393
407
|
return static_cast<ArrayBufferView*>(value);
|
|
394
408
|
}
|
|
395
409
|
|
|
396
|
-
static
|
|
397
|
-
V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT;
|
|
398
|
-
static const int kEmbedderFieldCount =
|
|
410
|
+
static constexpr int kInternalFieldCount =
|
|
399
411
|
V8_ARRAY_BUFFER_VIEW_INTERNAL_FIELD_COUNT;
|
|
412
|
+
static const int kEmbedderFieldCount = kInternalFieldCount;
|
|
400
413
|
|
|
401
414
|
private:
|
|
402
415
|
ArrayBufferView();
|
|
@@ -440,12 +453,15 @@ class V8_EXPORT SharedArrayBuffer : public Object {
|
|
|
440
453
|
size_t MaxByteLength() const;
|
|
441
454
|
|
|
442
455
|
/**
|
|
443
|
-
* Create a new SharedArrayBuffer. Allocate |byte_length| bytes
|
|
444
|
-
* Allocated memory will be owned by
|
|
445
|
-
* will be deallocated when it is
|
|
446
|
-
* unless the object is externalized.
|
|
456
|
+
* Create a new SharedArrayBuffer. Allocate |byte_length| bytes, which are
|
|
457
|
+
* either zero-initialized or uninitialized. Allocated memory will be owned by
|
|
458
|
+
* a created SharedArrayBuffer and will be deallocated when it is
|
|
459
|
+
* garbage-collected, unless the object is externalized.
|
|
447
460
|
*/
|
|
448
|
-
static Local<SharedArrayBuffer> New(
|
|
461
|
+
static Local<SharedArrayBuffer> New(
|
|
462
|
+
Isolate* isolate, size_t byte_length,
|
|
463
|
+
BackingStoreInitializationMode initialization_mode =
|
|
464
|
+
BackingStoreInitializationMode::kZeroInitialized);
|
|
449
465
|
|
|
450
466
|
/**
|
|
451
467
|
* Create a new SharedArrayBuffer with an existing backing store.
|
|
@@ -464,15 +480,18 @@ class V8_EXPORT SharedArrayBuffer : public Object {
|
|
|
464
480
|
|
|
465
481
|
/**
|
|
466
482
|
* Returns a new standalone BackingStore that is allocated using the array
|
|
467
|
-
* buffer allocator of the isolate. The
|
|
483
|
+
* buffer allocator of the isolate. The allocation can either be zero
|
|
484
|
+
* intialized, or uninitialized. The result can be later passed to
|
|
468
485
|
* SharedArrayBuffer::New.
|
|
469
486
|
*
|
|
470
487
|
* If the allocator returns nullptr, then the function may cause GCs in the
|
|
471
488
|
* given isolate and re-try the allocation. If GCs do not help, then the
|
|
472
489
|
* function will crash with an out-of-memory error.
|
|
473
490
|
*/
|
|
474
|
-
static std::unique_ptr<BackingStore> NewBackingStore(
|
|
475
|
-
|
|
491
|
+
static std::unique_ptr<BackingStore> NewBackingStore(
|
|
492
|
+
Isolate* isolate, size_t byte_length,
|
|
493
|
+
BackingStoreInitializationMode initialization_mode =
|
|
494
|
+
BackingStoreInitializationMode::kZeroInitialized);
|
|
476
495
|
/**
|
|
477
496
|
* Returns a new standalone BackingStore that takes over the ownership of
|
|
478
497
|
* the given buffer. The destructor of the BackingStore invokes the given
|
|
@@ -506,7 +525,8 @@ class V8_EXPORT SharedArrayBuffer : public Object {
|
|
|
506
525
|
return static_cast<SharedArrayBuffer*>(value);
|
|
507
526
|
}
|
|
508
527
|
|
|
509
|
-
static
|
|
528
|
+
static constexpr int kInternalFieldCount =
|
|
529
|
+
V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT;
|
|
510
530
|
|
|
511
531
|
private:
|
|
512
532
|
SharedArrayBuffer();
|
|
@@ -152,9 +152,6 @@ using JitCodeEventHandler = void (*)(const JitCodeEvent* event);
|
|
|
152
152
|
enum GCType {
|
|
153
153
|
kGCTypeScavenge = 1 << 0,
|
|
154
154
|
kGCTypeMinorMarkSweep = 1 << 1,
|
|
155
|
-
kGCTypeMinorMarkCompact V8_DEPRECATE_SOON(
|
|
156
|
-
"Use kGCTypeMinorMarkSweep instead of kGCTypeMinorMarkCompact.") =
|
|
157
|
-
kGCTypeMinorMarkSweep,
|
|
158
155
|
kGCTypeMarkSweepCompact = 1 << 2,
|
|
159
156
|
kGCTypeIncrementalMarking = 1 << 3,
|
|
160
157
|
kGCTypeProcessWeakCallbacks = 1 << 4,
|
|
@@ -234,7 +231,7 @@ using MessageCallback = void (*)(Local<Message> message, Local<Value> data);
|
|
|
234
231
|
|
|
235
232
|
// --- Tracing ---
|
|
236
233
|
|
|
237
|
-
enum LogEventStatus : int { kStart = 0, kEnd = 1,
|
|
234
|
+
enum LogEventStatus : int { kStart = 0, kEnd = 1, kLog = 2 };
|
|
238
235
|
using LogEventCallback = void (*)(const char* name,
|
|
239
236
|
int /* LogEventStatus */ status);
|
|
240
237
|
|
|
@@ -341,6 +338,14 @@ using JavaScriptCompileHintsMagicEnabledCallback =
|
|
|
341
338
|
// --- Callback for checking if WebAssembly JSPI is enabled ---
|
|
342
339
|
using WasmJSPIEnabledCallback = bool (*)(Local<Context> context);
|
|
343
340
|
|
|
341
|
+
/**
|
|
342
|
+
* Import phases in import requests.
|
|
343
|
+
*/
|
|
344
|
+
enum class ModuleImportPhase {
|
|
345
|
+
kSource,
|
|
346
|
+
kEvaluation,
|
|
347
|
+
};
|
|
348
|
+
|
|
344
349
|
/**
|
|
345
350
|
* HostImportModuleDynamicallyCallback is called when we
|
|
346
351
|
* require the embedder to load a module. This is used as part of the dynamic
|
|
@@ -354,7 +359,7 @@ using WasmJSPIEnabledCallback = bool (*)(Local<Context> context);
|
|
|
354
359
|
* The import_attributes are import attributes for this request in the form:
|
|
355
360
|
* [key1, value1, key2, value2, ...] where the keys and values are of type
|
|
356
361
|
* v8::String. Note, unlike the FixedArray passed to ResolveModuleCallback and
|
|
357
|
-
* returned from ModuleRequest::
|
|
362
|
+
* returned from ModuleRequest::GetImportAttributes(), this array does not
|
|
358
363
|
* contain the source Locations of the attributes.
|
|
359
364
|
*
|
|
360
365
|
* The embedder must compile, instantiate, evaluate the Module, and
|
|
@@ -107,6 +107,10 @@ class V8_EXPORT Context : public Data {
|
|
|
107
107
|
* configured if the default context snapshot contains no pointer embedder
|
|
108
108
|
* data, or if no custom startup snapshot is configured in the
|
|
109
109
|
* v8::CreateParams used to create the isolate.
|
|
110
|
+
*
|
|
111
|
+
* \param api_wrapper_deserializer An optional callback used to deserialize
|
|
112
|
+
* API wrapper objects that was initially set with v8::Object::Wrap() and then
|
|
113
|
+
* serialized using SerializeAPIWrapperCallback.
|
|
110
114
|
*/
|
|
111
115
|
static Local<Context> New(
|
|
112
116
|
Isolate* isolate, ExtensionConfiguration* extensions = nullptr,
|
|
@@ -116,17 +120,19 @@ class V8_EXPORT Context : public Data {
|
|
|
116
120
|
DeserializeInternalFieldsCallback(),
|
|
117
121
|
MicrotaskQueue* microtask_queue = nullptr,
|
|
118
122
|
DeserializeContextDataCallback context_data_deserializer =
|
|
119
|
-
DeserializeContextDataCallback()
|
|
123
|
+
DeserializeContextDataCallback(),
|
|
124
|
+
DeserializeAPIWrapperCallback api_wrapper_deserializer =
|
|
125
|
+
DeserializeAPIWrapperCallback());
|
|
120
126
|
|
|
121
127
|
/**
|
|
122
128
|
* Create a new context from a (non-default) context snapshot. There
|
|
123
129
|
* is no way to provide a global object template since we do not create
|
|
124
130
|
* a new global object from template, but we can reuse a global object.
|
|
125
131
|
*
|
|
126
|
-
* \param isolate See v8::Context::New.
|
|
132
|
+
* \param isolate See v8::Context::New().
|
|
127
133
|
*
|
|
128
134
|
* \param context_snapshot_index The index of the context snapshot to
|
|
129
|
-
* deserialize from. Use v8::Context::New for the default snapshot.
|
|
135
|
+
* deserialize from. Use v8::Context::New() for the default snapshot.
|
|
130
136
|
*
|
|
131
137
|
* \param internal_fields_deserializer An optional callback used
|
|
132
138
|
* to deserialize fields set by
|
|
@@ -136,19 +142,23 @@ class V8_EXPORT Context : public Data {
|
|
|
136
142
|
* pointer fields in the default context snapshot or if no startup
|
|
137
143
|
* snapshot is configured when the isolate is created.
|
|
138
144
|
*
|
|
139
|
-
* \param extensions See v8::Context::New.
|
|
145
|
+
* \param extensions See v8::Context::New().
|
|
140
146
|
*
|
|
141
|
-
* \param global_object See v8::Context::New.
|
|
147
|
+
* \param global_object See v8::Context::New().
|
|
142
148
|
*
|
|
143
149
|
* \param internal_fields_deserializer Similar to
|
|
144
|
-
* internal_fields_deserializer in v8::Context::New but applies to
|
|
150
|
+
* internal_fields_deserializer in v8::Context::New() but applies to
|
|
145
151
|
* the context specified by the context_snapshot_index.
|
|
146
152
|
*
|
|
147
|
-
* \param microtask_queue See v8::Context::New.
|
|
153
|
+
* \param microtask_queue See v8::Context::New().
|
|
148
154
|
*
|
|
149
155
|
* \param context_data_deserializer Similar to
|
|
150
|
-
* context_data_deserializer in v8::Context::New but applies to
|
|
156
|
+
* context_data_deserializer in v8::Context::New() but applies to
|
|
151
157
|
* the context specified by the context_snapshot_index.
|
|
158
|
+
*
|
|
159
|
+
*\param api_wrapper_deserializer Similar to api_wrapper_deserializer in
|
|
160
|
+
* v8::Context::New() but applies to the context specified by the
|
|
161
|
+
* context_snapshot_index.
|
|
152
162
|
*/
|
|
153
163
|
static MaybeLocal<Context> FromSnapshot(
|
|
154
164
|
Isolate* isolate, size_t context_snapshot_index,
|
|
@@ -158,7 +168,9 @@ class V8_EXPORT Context : public Data {
|
|
|
158
168
|
MaybeLocal<Value> global_object = MaybeLocal<Value>(),
|
|
159
169
|
MicrotaskQueue* microtask_queue = nullptr,
|
|
160
170
|
DeserializeContextDataCallback context_data_deserializer =
|
|
161
|
-
DeserializeContextDataCallback()
|
|
171
|
+
DeserializeContextDataCallback(),
|
|
172
|
+
DeserializeAPIWrapperCallback api_wrapper_deserializer =
|
|
173
|
+
DeserializeAPIWrapperCallback());
|
|
162
174
|
|
|
163
175
|
/**
|
|
164
176
|
* Returns an global object that isn't backed by an actual context.
|
|
@@ -290,6 +302,8 @@ class V8_EXPORT Context : public Data {
|
|
|
290
302
|
* SetAlignedPointerInEmbedderData with the same index. Note that index 0
|
|
291
303
|
* currently has a special meaning for Chrome's debugger.
|
|
292
304
|
*/
|
|
305
|
+
V8_INLINE void* GetAlignedPointerFromEmbedderData(Isolate* isolate,
|
|
306
|
+
int index);
|
|
293
307
|
V8_INLINE void* GetAlignedPointerFromEmbedderData(int index);
|
|
294
308
|
|
|
295
309
|
/**
|
|
@@ -444,6 +458,24 @@ Local<Value> Context::GetEmbedderData(int index) {
|
|
|
444
458
|
#endif
|
|
445
459
|
}
|
|
446
460
|
|
|
461
|
+
void* Context::GetAlignedPointerFromEmbedderData(Isolate* isolate, int index) {
|
|
462
|
+
#if !defined(V8_ENABLE_CHECKS)
|
|
463
|
+
using A = internal::Address;
|
|
464
|
+
using I = internal::Internals;
|
|
465
|
+
A ctx = internal::ValueHelper::ValueAsAddress(this);
|
|
466
|
+
A embedder_data =
|
|
467
|
+
I::ReadTaggedPointerField(ctx, I::kNativeContextEmbedderDataOffset);
|
|
468
|
+
int value_offset = I::kEmbedderDataArrayHeaderSize +
|
|
469
|
+
(I::kEmbedderDataSlotSize * index) +
|
|
470
|
+
I::kEmbedderDataSlotExternalPointerOffset;
|
|
471
|
+
return reinterpret_cast<void*>(
|
|
472
|
+
I::ReadExternalPointerField<internal::kEmbedderDataSlotPayloadTag>(
|
|
473
|
+
isolate, embedder_data, value_offset));
|
|
474
|
+
#else
|
|
475
|
+
return SlowGetAlignedPointerFromEmbedderData(index);
|
|
476
|
+
#endif
|
|
477
|
+
}
|
|
478
|
+
|
|
447
479
|
void* Context::GetAlignedPointerFromEmbedderData(int index) {
|
|
448
480
|
#if !defined(V8_ENABLE_CHECKS)
|
|
449
481
|
using A = internal::Address;
|
package/include/node/v8-cppgc.h
CHANGED
|
@@ -32,62 +32,15 @@ class CppHeap;
|
|
|
32
32
|
|
|
33
33
|
class CustomSpaceStatisticsReceiver;
|
|
34
34
|
|
|
35
|
-
/**
|
|
36
|
-
* Describes how V8 wrapper objects maintain references to garbage-collected C++
|
|
37
|
-
* objects.
|
|
38
|
-
*/
|
|
39
|
-
struct WrapperDescriptor final {
|
|
40
|
-
/**
|
|
41
|
-
* The index used on `v8::Ojbect::SetAlignedPointerFromInternalField()` and
|
|
42
|
-
* related APIs to add additional data to an object which is used to identify
|
|
43
|
-
* JS->C++ references.
|
|
44
|
-
*/
|
|
45
|
-
using InternalFieldIndex = int;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Unknown embedder id. The value is reserved for internal usages and must not
|
|
49
|
-
* be used with `CppHeap`.
|
|
50
|
-
*/
|
|
51
|
-
static constexpr uint16_t kUnknownEmbedderId = UINT16_MAX;
|
|
52
|
-
|
|
53
|
-
constexpr WrapperDescriptor(InternalFieldIndex wrappable_type_index,
|
|
54
|
-
InternalFieldIndex wrappable_instance_index,
|
|
55
|
-
uint16_t embedder_id_for_garbage_collected)
|
|
56
|
-
: wrappable_type_index(wrappable_type_index),
|
|
57
|
-
wrappable_instance_index(wrappable_instance_index),
|
|
58
|
-
embedder_id_for_garbage_collected(embedder_id_for_garbage_collected) {}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Index of the wrappable type.
|
|
62
|
-
*/
|
|
63
|
-
InternalFieldIndex wrappable_type_index;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Index of the wrappable instance.
|
|
67
|
-
*/
|
|
68
|
-
InternalFieldIndex wrappable_instance_index;
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Embedder id identifying instances of garbage-collected objects. It is
|
|
72
|
-
* expected that the first field of the wrappable type is a uint16_t holding
|
|
73
|
-
* the id. Only references to instances of wrappables types with an id of
|
|
74
|
-
* `embedder_id_for_garbage_collected` will be considered by CppHeap.
|
|
75
|
-
*/
|
|
76
|
-
uint16_t embedder_id_for_garbage_collected;
|
|
77
|
-
};
|
|
78
|
-
|
|
79
35
|
struct V8_EXPORT CppHeapCreateParams {
|
|
80
|
-
CppHeapCreateParams(
|
|
81
|
-
std::vector<std::unique_ptr<cppgc::CustomSpaceBase>> custom_spaces
|
|
82
|
-
|
|
83
|
-
: custom_spaces(std::move(custom_spaces)),
|
|
84
|
-
wrapper_descriptor(wrapper_descriptor) {}
|
|
36
|
+
explicit CppHeapCreateParams(
|
|
37
|
+
std::vector<std::unique_ptr<cppgc::CustomSpaceBase>> custom_spaces)
|
|
38
|
+
: custom_spaces(std::move(custom_spaces)) {}
|
|
85
39
|
|
|
86
40
|
CppHeapCreateParams(const CppHeapCreateParams&) = delete;
|
|
87
41
|
CppHeapCreateParams& operator=(const CppHeapCreateParams&) = delete;
|
|
88
42
|
|
|
89
43
|
std::vector<std::unique_ptr<cppgc::CustomSpaceBase>> custom_spaces;
|
|
90
|
-
WrapperDescriptor wrapper_descriptor;
|
|
91
44
|
/**
|
|
92
45
|
* Specifies which kind of marking are supported by the heap. The type may be
|
|
93
46
|
* further reduced via runtime flags when attaching the heap to an Isolate.
|
|
@@ -177,11 +130,6 @@ class V8_EXPORT CppHeap {
|
|
|
177
130
|
void CollectGarbageInYoungGenerationForTesting(
|
|
178
131
|
cppgc::EmbedderStackState stack_state);
|
|
179
132
|
|
|
180
|
-
/**
|
|
181
|
-
* \returns the wrapper descriptor of this CppHeap.
|
|
182
|
-
*/
|
|
183
|
-
v8::WrapperDescriptor wrapper_descriptor() const;
|
|
184
|
-
|
|
185
133
|
private:
|
|
186
134
|
CppHeap() = default;
|
|
187
135
|
|
package/include/node/v8-date.h
CHANGED
|
@@ -21,6 +21,10 @@ class V8_EXPORT Date : public Object {
|
|
|
21
21
|
static V8_WARN_UNUSED_RESULT MaybeLocal<Value> New(Local<Context> context,
|
|
22
22
|
double time);
|
|
23
23
|
|
|
24
|
+
static V8_WARN_UNUSED_RESULT MaybeLocal<Value> Parse(
|
|
25
|
+
Local<Context> context,
|
|
26
|
+
Local<String> date_string);
|
|
27
|
+
|
|
24
28
|
/**
|
|
25
29
|
* A specialization of Value::NumberValue that is more efficient
|
|
26
30
|
* because we know the structure of this object.
|
|
@@ -32,6 +36,11 @@ class V8_EXPORT Date : public Object {
|
|
|
32
36
|
*/
|
|
33
37
|
v8::Local<v8::String> ToISOString() const;
|
|
34
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Generates UTC string representation.
|
|
41
|
+
*/
|
|
42
|
+
v8::Local<v8::String> ToUTCString() const;
|
|
43
|
+
|
|
35
44
|
V8_INLINE static Date* Cast(Value* value) {
|
|
36
45
|
#ifdef V8_ENABLE_CHECKS
|
|
37
46
|
CheckCast(value);
|
|
@@ -29,6 +29,8 @@ class V8_EXPORT EmbedderRootsHandler {
|
|
|
29
29
|
virtual ~EmbedderRootsHandler() = default;
|
|
30
30
|
|
|
31
31
|
EmbedderRootsHandler() = default;
|
|
32
|
+
|
|
33
|
+
V8_DEPRECATED("Use the default constructor instead.")
|
|
32
34
|
explicit EmbedderRootsHandler(RootHandling default_traced_reference_handling)
|
|
33
35
|
: default_traced_reference_handling_(default_traced_reference_handling) {}
|
|
34
36
|
|
|
@@ -47,6 +49,7 @@ class V8_EXPORT EmbedderRootsHandler {
|
|
|
47
49
|
*
|
|
48
50
|
* The concrete implementations must be thread-safe.
|
|
49
51
|
*/
|
|
52
|
+
V8_DEPRECATED("Use TracedReferenceHandling::kDroppable instead.")
|
|
50
53
|
virtual bool IsRoot(const v8::TracedReference<v8::Value>& handle) = 0;
|
|
51
54
|
|
|
52
55
|
/**
|
|
@@ -72,7 +75,7 @@ class V8_EXPORT EmbedderRootsHandler {
|
|
|
72
75
|
|
|
73
76
|
private:
|
|
74
77
|
const RootHandling default_traced_reference_handling_ =
|
|
75
|
-
RootHandling::
|
|
78
|
+
RootHandling::kDontQueryEmbedderForAnyReference;
|
|
76
79
|
|
|
77
80
|
friend class internal::TracedHandles;
|
|
78
81
|
};
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
#include <stddef.h>
|
|
9
9
|
|
|
10
10
|
#include "v8-local-handle.h" // NOLINT(build/include_directory)
|
|
11
|
+
#include "v8-object.h" // NOLINT(build/include_directory)
|
|
11
12
|
#include "v8config.h" // NOLINT(build/include_directory)
|
|
12
13
|
|
|
13
14
|
namespace v8 {
|
|
@@ -58,8 +59,77 @@ class V8_EXPORT Exception {
|
|
|
58
59
|
* of a given exception, or an empty handle if not available.
|
|
59
60
|
*/
|
|
60
61
|
static Local<StackTrace> GetStackTrace(Local<Value> exception);
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Captures the current stack trace and attaches it to the given object in the
|
|
65
|
+
* form of `stack` property.
|
|
66
|
+
*/
|
|
67
|
+
static Maybe<bool> CaptureStackTrace(Local<Context> context,
|
|
68
|
+
Local<Object> object);
|
|
61
69
|
};
|
|
62
70
|
|
|
71
|
+
/**
|
|
72
|
+
* This is a part of experimental Api and might be changed without further
|
|
73
|
+
* notice.
|
|
74
|
+
* Do not use it.
|
|
75
|
+
*/
|
|
76
|
+
enum class ExceptionContext : uint32_t {
|
|
77
|
+
kUnknown,
|
|
78
|
+
kConstructor,
|
|
79
|
+
kOperation,
|
|
80
|
+
kAttributeGet,
|
|
81
|
+
kAttributeSet,
|
|
82
|
+
kIndexedQuery,
|
|
83
|
+
kIndexedGetter,
|
|
84
|
+
kIndexedDescriptor,
|
|
85
|
+
kIndexedSetter,
|
|
86
|
+
kIndexedDefiner,
|
|
87
|
+
kIndexedDeleter,
|
|
88
|
+
kNamedQuery,
|
|
89
|
+
kNamedGetter,
|
|
90
|
+
kNamedDescriptor,
|
|
91
|
+
kNamedSetter,
|
|
92
|
+
kNamedDefiner,
|
|
93
|
+
kNamedDeleter,
|
|
94
|
+
kNamedEnumerator
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* This is a part of experimental Api and might be changed without further
|
|
99
|
+
* notice.
|
|
100
|
+
* Do not use it.
|
|
101
|
+
*/
|
|
102
|
+
class ExceptionPropagationMessage {
|
|
103
|
+
public:
|
|
104
|
+
ExceptionPropagationMessage(v8::Isolate* isolate, Local<Object> exception,
|
|
105
|
+
Local<String> interface_name,
|
|
106
|
+
Local<String> property_name,
|
|
107
|
+
ExceptionContext exception_context)
|
|
108
|
+
: isolate_(isolate),
|
|
109
|
+
exception_(exception),
|
|
110
|
+
interface_name_(interface_name),
|
|
111
|
+
property_name_(property_name),
|
|
112
|
+
exception_context_(exception_context) {}
|
|
113
|
+
|
|
114
|
+
V8_INLINE Isolate* GetIsolate() const { return isolate_; }
|
|
115
|
+
V8_INLINE Local<Object> GetException() const { return exception_; }
|
|
116
|
+
V8_INLINE Local<String> GetInterfaceName() const { return interface_name_; }
|
|
117
|
+
V8_INLINE Local<String> GetPropertyName() const { return property_name_; }
|
|
118
|
+
V8_INLINE ExceptionContext GetExceptionContext() const {
|
|
119
|
+
return exception_context_;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
private:
|
|
123
|
+
Isolate* isolate_;
|
|
124
|
+
Local<Object> exception_;
|
|
125
|
+
Local<String> interface_name_;
|
|
126
|
+
Local<String> property_name_;
|
|
127
|
+
ExceptionContext exception_context_;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
using ExceptionPropagationCallback =
|
|
131
|
+
void (*)(ExceptionPropagationMessage message);
|
|
132
|
+
|
|
63
133
|
/**
|
|
64
134
|
* An external exception handler.
|
|
65
135
|
*/
|