node-darwin-x64 24.8.0 → 25.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +177 -1642
- package/README.md +2 -2
- package/bin/node +0 -0
- package/include/node/common.gypi +1 -13
- package/include/node/config.gypi +12 -8
- package/include/node/cppgc/allocation.h +3 -3
- package/include/node/cppgc/cross-thread-persistent.h +25 -29
- package/include/node/cppgc/internal/finalizer-trait.h +1 -1
- package/include/node/cppgc/internal/gc-info.h +3 -3
- package/include/node/cppgc/internal/logging.h +2 -2
- package/include/node/cppgc/internal/name-trait.h +1 -1
- package/include/node/cppgc/internal/pointer-policies.h +3 -3
- package/include/node/cppgc/member.h +10 -4
- package/include/node/cppgc/persistent.h +14 -15
- package/include/node/cppgc/platform.h +1 -1
- package/include/node/cppgc/trace-trait.h +1 -2
- package/include/node/cppgc/visitor.h +14 -9
- package/include/node/js_native_api.h +21 -1
- package/include/node/node.h +34 -78
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/BSD-x86/asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/BSD-x86/asm_avx2/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/BSD-x86/no-asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/BSD-x86_64/asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/BSD-x86_64/asm_avx2/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/BSD-x86_64/no-asm/include/openssl/opensslv.h +8 -13
- package/include/node/openssl/archs/VC-WIN32/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/VC-WIN32/asm/include/openssl/crypto.h +4 -4
- package/include/node/openssl/archs/VC-WIN32/asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/VC-WIN32/asm_avx2/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/VC-WIN32/no-asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/VC-WIN64-ARM/no-asm/include/openssl/opensslv.h +8 -13
- package/include/node/openssl/archs/VC-WIN64A/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/VC-WIN64A/asm/include/openssl/crypto.h +4 -4
- package/include/node/openssl/archs/VC-WIN64A/asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/VC-WIN64A/asm_avx2/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/VC-WIN64A/no-asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/aix64-gcc-as/asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/aix64-gcc-as/asm_avx2/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/aix64-gcc-as/no-asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/darwin-i386-cc/asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/darwin-i386-cc/asm_avx2/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/darwin-i386-cc/no-asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/darwin64-arm64-cc/asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/darwin64-arm64-cc/asm_avx2/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/darwin64-arm64-cc/no-asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/darwin64-x86_64-cc/asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/darwin64-x86_64-cc/asm_avx2/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/darwin64-x86_64-cc/no-asm/include/openssl/opensslv.h +8 -13
- package/include/node/openssl/archs/linux-aarch64/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux-aarch64/asm/include/openssl/crypto.h +4 -4
- package/include/node/openssl/archs/linux-aarch64/asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/linux-aarch64/asm_avx2/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/linux-aarch64/no-asm/include/openssl/opensslv.h +8 -13
- package/include/node/openssl/archs/linux-armv4/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux-armv4/asm/include/openssl/crypto.h +4 -4
- package/include/node/openssl/archs/linux-armv4/asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/linux-armv4/asm_avx2/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/linux-armv4/no-asm/include/openssl/opensslv.h +8 -13
- package/include/node/openssl/archs/linux-elf/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux-elf/asm/include/openssl/crypto.h +4 -4
- package/include/node/openssl/archs/linux-elf/asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/linux-elf/asm_avx2/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/linux-elf/no-asm/include/openssl/opensslv.h +8 -13
- package/include/node/openssl/archs/linux-ppc64le/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/crypto.h +4 -4
- package/include/node/openssl/archs/linux-ppc64le/asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/linux-ppc64le/asm_avx2/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/linux-ppc64le/no-asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/linux-x86_64/asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/linux-x86_64/asm_avx2/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/linux-x86_64/no-asm/include/openssl/opensslv.h +8 -13
- package/include/node/openssl/archs/linux32-s390x/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux32-s390x/asm/include/openssl/crypto.h +4 -4
- package/include/node/openssl/archs/linux32-s390x/asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/linux32-s390x/asm_avx2/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/linux32-s390x/no-asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/linux64-loongarch64/no-asm/include/openssl/opensslv.h +8 -13
- package/include/node/openssl/archs/linux64-mips64/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux64-mips64/asm/include/openssl/crypto.h +4 -4
- package/include/node/openssl/archs/linux64-mips64/asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/linux64-mips64/asm_avx2/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/linux64-mips64/no-asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/linux64-riscv64/no-asm/include/openssl/opensslv.h +8 -13
- package/include/node/openssl/archs/linux64-s390x/asm/crypto/buildinf.h +1 -1
- package/include/node/openssl/archs/linux64-s390x/asm/include/openssl/crypto.h +4 -4
- package/include/node/openssl/archs/linux64-s390x/asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/linux64-s390x/asm_avx2/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/linux64-s390x/no-asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/solaris-x86-gcc/asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/solaris-x86-gcc/asm_avx2/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/solaris-x86-gcc/no-asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/solaris64-x86_64-gcc/asm/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/solaris64-x86_64-gcc/asm_avx2/include/openssl/opensslv.h +8 -13
- 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/crypto.h +4 -4
- package/include/node/openssl/archs/solaris64-x86_64-gcc/no-asm/include/openssl/opensslv.h +8 -13
- package/include/node/openssl/proverr.h +1 -0
- package/include/node/openssl/self_test.h +1 -0
- package/include/node/v8-array-buffer.h +1 -1
- package/include/node/v8-callbacks.h +3 -4
- package/include/node/v8-context.h +15 -5
- package/include/node/v8-data.h +5 -0
- package/include/node/v8-debug.h +11 -0
- package/include/node/v8-function-callback.h +26 -26
- package/include/node/v8-internal.h +136 -36
- package/include/node/v8-isolate.h +75 -16
- package/include/node/v8-json.h +8 -1
- package/include/node/v8-local-handle.h +112 -13
- package/include/node/v8-maybe.h +34 -10
- package/include/node/v8-memory-span.h +9 -4
- package/include/node/v8-message.h +3 -0
- package/include/node/v8-object.h +87 -24
- package/include/node/v8-persistent-handle.h +4 -4
- package/include/node/v8-platform.h +92 -28
- package/include/node/v8-primitive.h +22 -9
- package/include/node/v8-profiler.h +4 -0
- package/include/node/v8-sandbox.h +16 -0
- package/include/node/v8-source-location.h +19 -26
- package/include/node/v8-template.h +37 -15
- package/include/node/v8-traced-handle.h +6 -6
- package/include/node/v8-unwinder.h +13 -0
- package/include/node/v8-version.h +4 -4
- package/include/node/v8config.h +65 -5
- package/package.json +5 -1
- package/share/doc/node/gdbinit +221 -4
- package/share/man/man1/node.1 +21 -4
package/include/node/v8-object.h
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
#ifndef INCLUDE_V8_OBJECT_H_
|
|
6
6
|
#define INCLUDE_V8_OBJECT_H_
|
|
7
7
|
|
|
8
|
+
#include "cppgc/garbage-collected.h"
|
|
9
|
+
#include "cppgc/name-provider.h"
|
|
8
10
|
#include "v8-internal.h" // NOLINT(build/include_directory)
|
|
9
11
|
#include "v8-local-handle.h" // NOLINT(build/include_directory)
|
|
10
12
|
#include "v8-maybe.h" // NOLINT(build/include_directory)
|
|
@@ -23,6 +25,14 @@ class FunctionTemplate;
|
|
|
23
25
|
template <typename T>
|
|
24
26
|
class PropertyCallbackInfo;
|
|
25
27
|
|
|
28
|
+
/**
|
|
29
|
+
* A tag for embedder data. Objects with different C++ types should use
|
|
30
|
+
* different values of EmbedderDataTypeTag when written to embedder data. The
|
|
31
|
+
* allowed range is 0..V8_EMBEDDER_DATA_TAG_COUNT - 1. If this is not
|
|
32
|
+
* sufficient, V8_EMBEDDER_DATA_TAG_COUNT can be increased.
|
|
33
|
+
*/
|
|
34
|
+
using EmbedderDataTypeTag = uint16_t;
|
|
35
|
+
|
|
26
36
|
/**
|
|
27
37
|
* A private symbol
|
|
28
38
|
*
|
|
@@ -427,15 +437,15 @@ class V8_EXPORT Object : public Value {
|
|
|
427
437
|
* be skipped by __proto__ and it does not consult the security
|
|
428
438
|
* handler.
|
|
429
439
|
*/
|
|
430
|
-
|
|
440
|
+
V8_DEPRECATED(
|
|
431
441
|
"V8 will stop providing access to hidden prototype (i.e. "
|
|
432
442
|
"JSGlobalObject). Use GetPrototypeV2() instead. "
|
|
433
443
|
"See http://crbug.com/333672197.")
|
|
434
444
|
Local<Value> GetPrototype();
|
|
435
445
|
|
|
436
446
|
/**
|
|
437
|
-
* Get the prototype object (same as
|
|
438
|
-
* not consult the security handler.
|
|
447
|
+
* Get the prototype object (same as calling Object.getPrototypeOf(..)).
|
|
448
|
+
* This does not consult the security handler.
|
|
439
449
|
* TODO(333672197): rename back to GetPrototype() once the old version goes
|
|
440
450
|
* through the deprecation process and is removed.
|
|
441
451
|
*/
|
|
@@ -446,7 +456,7 @@ class V8_EXPORT Object : public Value {
|
|
|
446
456
|
* be skipped by __proto__ and it does not consult the security
|
|
447
457
|
* handler.
|
|
448
458
|
*/
|
|
449
|
-
|
|
459
|
+
V8_DEPRECATED(
|
|
450
460
|
"V8 will stop providing access to hidden prototype (i.e. "
|
|
451
461
|
"JSGlobalObject). Use SetPrototypeV2() instead. "
|
|
452
462
|
"See http://crbug.com/333672197.")
|
|
@@ -454,8 +464,8 @@ class V8_EXPORT Object : public Value {
|
|
|
454
464
|
Local<Value> prototype);
|
|
455
465
|
|
|
456
466
|
/**
|
|
457
|
-
* Set the prototype object (same as
|
|
458
|
-
* does not consult the security handler.
|
|
467
|
+
* Set the prototype object (same as calling Object.setPrototypeOf(..)).
|
|
468
|
+
* This does not consult the security handler.
|
|
459
469
|
* TODO(333672197): rename back to SetPrototype() once the old version goes
|
|
460
470
|
* through the deprecation process and is removed.
|
|
461
471
|
*/
|
|
@@ -544,10 +554,43 @@ class V8_EXPORT Object : public Value {
|
|
|
544
554
|
* a field, GetAlignedPointerFromInternalField must be used, everything else
|
|
545
555
|
* leads to undefined behavior.
|
|
546
556
|
*/
|
|
557
|
+
V8_DEPRECATE_SOON(
|
|
558
|
+
"Use SetAlignedPointerInInternalField with EmbedderDataTypeTag parameter "
|
|
559
|
+
"instead.")
|
|
547
560
|
void SetAlignedPointerInInternalField(int index, void* value);
|
|
561
|
+
|
|
562
|
+
void SetAlignedPointerInInternalField(int index, void* value,
|
|
563
|
+
EmbedderDataTypeTag tag);
|
|
564
|
+
|
|
565
|
+
V8_DEPRECATE_SOON(
|
|
566
|
+
"Use SetAlignedPointerInInternalField with EmbedderDataTypeTag "
|
|
567
|
+
"parameter instead.")
|
|
548
568
|
void SetAlignedPointerInInternalFields(int argc, int indices[],
|
|
549
569
|
void* values[]);
|
|
550
570
|
|
|
571
|
+
// Type information for a Wrappable object that got wrapped with
|
|
572
|
+
// `v8::Object::Wrap()`.
|
|
573
|
+
struct WrapperTypeInfo {
|
|
574
|
+
const int16_t type_id;
|
|
575
|
+
};
|
|
576
|
+
|
|
577
|
+
// v8::Object::Wrappable serves as the base class for all C++ objects that can
|
|
578
|
+
// be wrapped by a JavaScript object using `v8::Object::Wrap()`.
|
|
579
|
+
//
|
|
580
|
+
// Note that v8::Object::Wrappable` inherits from `NameProvider` and provides
|
|
581
|
+
// `GetWrapperTypeInfo` to allow subclasses to have smaller object sizes.
|
|
582
|
+
class Wrappable : public cppgc::GarbageCollected<Wrappable>,
|
|
583
|
+
public cppgc::NameProvider {
|
|
584
|
+
public:
|
|
585
|
+
virtual const WrapperTypeInfo* GetWrapperTypeInfo() const {
|
|
586
|
+
return nullptr;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
const char* GetHumanReadableName() const override { return "internal"; }
|
|
590
|
+
|
|
591
|
+
virtual void Trace(cppgc::Visitor* visitor) const {}
|
|
592
|
+
};
|
|
593
|
+
|
|
551
594
|
/**
|
|
552
595
|
* Unwraps a JS wrapper object.
|
|
553
596
|
*
|
|
@@ -593,24 +636,37 @@ class V8_EXPORT Object : public Value {
|
|
|
593
636
|
template <CppHeapPointerTag tag>
|
|
594
637
|
static V8_INLINE void Wrap(v8::Isolate* isolate,
|
|
595
638
|
const v8::Local<v8::Object>& wrapper,
|
|
596
|
-
|
|
639
|
+
Wrappable* wrappable);
|
|
597
640
|
template <CppHeapPointerTag tag>
|
|
598
641
|
static V8_INLINE void Wrap(v8::Isolate* isolate,
|
|
599
642
|
const PersistentBase<Object>& wrapper,
|
|
600
|
-
|
|
643
|
+
Wrappable* wrappable);
|
|
601
644
|
template <CppHeapPointerTag tag>
|
|
602
645
|
static V8_INLINE void Wrap(v8::Isolate* isolate,
|
|
603
646
|
const BasicTracedReference<Object>& wrapper,
|
|
604
|
-
|
|
647
|
+
Wrappable* wrappable);
|
|
605
648
|
static V8_INLINE void Wrap(v8::Isolate* isolate,
|
|
606
649
|
const v8::Local<v8::Object>& wrapper,
|
|
607
|
-
|
|
650
|
+
Wrappable* wrappable, CppHeapPointerTag tag);
|
|
608
651
|
static V8_INLINE void Wrap(v8::Isolate* isolate,
|
|
609
652
|
const PersistentBase<Object>& wrapper,
|
|
610
|
-
|
|
653
|
+
Wrappable* wrappable, CppHeapPointerTag tag);
|
|
611
654
|
static V8_INLINE void Wrap(v8::Isolate* isolate,
|
|
612
655
|
const BasicTracedReference<Object>& wrapper,
|
|
613
|
-
|
|
656
|
+
Wrappable* wrappable, CppHeapPointerTag tag);
|
|
657
|
+
|
|
658
|
+
// Version of Wrap() function for v8::Context::Global() objects.
|
|
659
|
+
// Unlike the functions above it wraps both JSGlobalProxy and its hidden
|
|
660
|
+
// prototype (JSGlobalObject or remote object).
|
|
661
|
+
static void WrapGlobal(v8::Isolate* isolate,
|
|
662
|
+
const v8::Local<v8::Object>& wrapper,
|
|
663
|
+
Wrappable* wrappable, CppHeapPointerTag tag);
|
|
664
|
+
|
|
665
|
+
// Checks that wrappables set on JSGlobalProxy and its hidden prototype are
|
|
666
|
+
// the same.
|
|
667
|
+
static bool CheckGlobalWrappable(v8::Isolate* isolate,
|
|
668
|
+
const v8::Local<v8::Object>& wrapper,
|
|
669
|
+
CppHeapPointerTagRange tag_range);
|
|
614
670
|
|
|
615
671
|
/**
|
|
616
672
|
* HasOwnProperty() is like JavaScript's
|
|
@@ -795,8 +851,14 @@ class V8_EXPORT Object : public Value {
|
|
|
795
851
|
/**
|
|
796
852
|
* Return the isolate to which the Object belongs to.
|
|
797
853
|
*/
|
|
854
|
+
V8_DEPRECATED(
|
|
855
|
+
"Use Isolate::GetCurrent() instead, which is guaranteed to return the "
|
|
856
|
+
"same isolate since https://crrev.com/c/6458560.")
|
|
798
857
|
Isolate* GetIsolate();
|
|
799
858
|
|
|
859
|
+
V8_DEPRECATED(
|
|
860
|
+
"Use Isolate::GetCurrent() instead, which is guaranteed to return the "
|
|
861
|
+
"same isolate since https://crrev.com/c/6458560.")
|
|
800
862
|
V8_INLINE static Isolate* GetIsolate(const TracedReference<Object>& handle) {
|
|
801
863
|
return handle.template value<Object>()->GetIsolate();
|
|
802
864
|
}
|
|
@@ -871,8 +933,7 @@ Local<Data> Object::GetInternalField(int index) {
|
|
|
871
933
|
value = I::DecompressTaggedField(obj, static_cast<uint32_t>(value));
|
|
872
934
|
#endif
|
|
873
935
|
|
|
874
|
-
auto isolate =
|
|
875
|
-
internal::IsolateFromNeverReadOnlySpaceObject(obj));
|
|
936
|
+
auto* isolate = I::GetCurrentIsolate();
|
|
876
937
|
return Local<Data>::New(isolate, value);
|
|
877
938
|
}
|
|
878
939
|
#endif
|
|
@@ -893,7 +954,8 @@ void* Object::GetAlignedPointerFromInternalField(v8::Isolate* isolate,
|
|
|
893
954
|
(I::kEmbedderDataSlotSize * index) +
|
|
894
955
|
I::kEmbedderDataSlotExternalPointerOffset;
|
|
895
956
|
A value =
|
|
896
|
-
I::ReadExternalPointerField<internal::
|
|
957
|
+
I::ReadExternalPointerField<{internal::kFirstEmbedderDataTag,
|
|
958
|
+
internal::kLastEmbedderDataTag}>(
|
|
897
959
|
isolate, obj, offset);
|
|
898
960
|
return reinterpret_cast<void*>(value);
|
|
899
961
|
}
|
|
@@ -913,9 +975,10 @@ void* Object::GetAlignedPointerFromInternalField(int index) {
|
|
|
913
975
|
int offset = I::kJSAPIObjectWithEmbedderSlotsHeaderSize +
|
|
914
976
|
(I::kEmbedderDataSlotSize * index) +
|
|
915
977
|
I::kEmbedderDataSlotExternalPointerOffset;
|
|
916
|
-
Isolate* isolate = I::
|
|
978
|
+
Isolate* isolate = I::GetCurrentIsolateForSandbox();
|
|
917
979
|
A value =
|
|
918
|
-
I::ReadExternalPointerField<internal::
|
|
980
|
+
I::ReadExternalPointerField<{internal::kFirstEmbedderDataTag,
|
|
981
|
+
internal::kLastEmbedderDataTag}>(
|
|
919
982
|
isolate, obj, offset);
|
|
920
983
|
return reinterpret_cast<void*>(value);
|
|
921
984
|
}
|
|
@@ -1011,7 +1074,7 @@ T* Object::Unwrap(v8::Isolate* isolate,
|
|
|
1011
1074
|
// static
|
|
1012
1075
|
template <CppHeapPointerTag tag>
|
|
1013
1076
|
void Object::Wrap(v8::Isolate* isolate, const v8::Local<v8::Object>& wrapper,
|
|
1014
|
-
|
|
1077
|
+
v8::Object::Wrappable* wrappable) {
|
|
1015
1078
|
auto obj = internal::ValueHelper::ValueAsAddress(*wrapper);
|
|
1016
1079
|
Wrap(isolate, obj, tag, wrappable);
|
|
1017
1080
|
}
|
|
@@ -1019,7 +1082,7 @@ void Object::Wrap(v8::Isolate* isolate, const v8::Local<v8::Object>& wrapper,
|
|
|
1019
1082
|
// static
|
|
1020
1083
|
template <CppHeapPointerTag tag>
|
|
1021
1084
|
void Object::Wrap(v8::Isolate* isolate, const PersistentBase<Object>& wrapper,
|
|
1022
|
-
|
|
1085
|
+
v8::Object::Wrappable* wrappable) {
|
|
1023
1086
|
auto obj =
|
|
1024
1087
|
internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
|
|
1025
1088
|
Wrap(isolate, obj, tag, wrappable);
|
|
@@ -1029,7 +1092,7 @@ void Object::Wrap(v8::Isolate* isolate, const PersistentBase<Object>& wrapper,
|
|
|
1029
1092
|
template <CppHeapPointerTag tag>
|
|
1030
1093
|
void Object::Wrap(v8::Isolate* isolate,
|
|
1031
1094
|
const BasicTracedReference<Object>& wrapper,
|
|
1032
|
-
|
|
1095
|
+
v8::Object::Wrappable* wrappable) {
|
|
1033
1096
|
auto obj =
|
|
1034
1097
|
internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
|
|
1035
1098
|
Wrap(isolate, obj, tag, wrappable);
|
|
@@ -1037,14 +1100,14 @@ void Object::Wrap(v8::Isolate* isolate,
|
|
|
1037
1100
|
|
|
1038
1101
|
// static
|
|
1039
1102
|
void Object::Wrap(v8::Isolate* isolate, const v8::Local<v8::Object>& wrapper,
|
|
1040
|
-
|
|
1103
|
+
v8::Object::Wrappable* wrappable, CppHeapPointerTag tag) {
|
|
1041
1104
|
auto obj = internal::ValueHelper::ValueAsAddress(*wrapper);
|
|
1042
1105
|
Wrap(isolate, obj, tag, wrappable);
|
|
1043
1106
|
}
|
|
1044
1107
|
|
|
1045
1108
|
// static
|
|
1046
1109
|
void Object::Wrap(v8::Isolate* isolate, const PersistentBase<Object>& wrapper,
|
|
1047
|
-
|
|
1110
|
+
v8::Object::Wrappable* wrappable, CppHeapPointerTag tag) {
|
|
1048
1111
|
auto obj =
|
|
1049
1112
|
internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
|
|
1050
1113
|
Wrap(isolate, obj, tag, wrappable);
|
|
@@ -1052,8 +1115,8 @@ void Object::Wrap(v8::Isolate* isolate, const PersistentBase<Object>& wrapper,
|
|
|
1052
1115
|
|
|
1053
1116
|
// static
|
|
1054
1117
|
void Object::Wrap(v8::Isolate* isolate,
|
|
1055
|
-
const BasicTracedReference<Object>& wrapper,
|
|
1056
|
-
CppHeapPointerTag tag) {
|
|
1118
|
+
const BasicTracedReference<Object>& wrapper,
|
|
1119
|
+
v8::Object::Wrappable* wrappable, CppHeapPointerTag tag) {
|
|
1057
1120
|
auto obj =
|
|
1058
1121
|
internal::ValueHelper::ValueAsAddress(wrapper.template value<Object>());
|
|
1059
1122
|
Wrap(isolate, obj, tag, wrappable);
|
|
@@ -431,7 +431,7 @@ internal::Address* PersistentBase<T>::New(Isolate* isolate, T* that) {
|
|
|
431
431
|
template <class T, class M>
|
|
432
432
|
template <class S, class M2>
|
|
433
433
|
void Persistent<T, M>::Copy(const Persistent<S, M2>& that) {
|
|
434
|
-
static_assert(std::
|
|
434
|
+
static_assert(std::is_base_of_v<T, S>, "type check");
|
|
435
435
|
this->Reset();
|
|
436
436
|
if (that.IsEmpty()) return;
|
|
437
437
|
this->slot() = api_internal::CopyGlobalReference(that.slot());
|
|
@@ -459,7 +459,7 @@ void PersistentBase<T>::Reset() {
|
|
|
459
459
|
template <class T>
|
|
460
460
|
template <class S>
|
|
461
461
|
void PersistentBase<T>::Reset(Isolate* isolate, const Local<S>& other) {
|
|
462
|
-
static_assert(std::
|
|
462
|
+
static_assert(std::is_base_of_v<T, S>, "type check");
|
|
463
463
|
Reset();
|
|
464
464
|
if (other.IsEmpty()) return;
|
|
465
465
|
this->slot() = New(isolate, *other);
|
|
@@ -473,7 +473,7 @@ template <class T>
|
|
|
473
473
|
template <class S>
|
|
474
474
|
void PersistentBase<T>::Reset(Isolate* isolate,
|
|
475
475
|
const PersistentBase<S>& other) {
|
|
476
|
-
static_assert(std::
|
|
476
|
+
static_assert(std::is_base_of_v<T, S>, "type check");
|
|
477
477
|
Reset();
|
|
478
478
|
if (other.IsEmpty()) return;
|
|
479
479
|
this->slot() = New(isolate, other.template value<S>());
|
|
@@ -546,7 +546,7 @@ Global<T>::Global(Global&& other) : PersistentBase<T>(other.slot()) {
|
|
|
546
546
|
template <class T>
|
|
547
547
|
template <class S>
|
|
548
548
|
Global<T>& Global<T>::operator=(Global<S>&& rhs) {
|
|
549
|
-
static_assert(std::
|
|
549
|
+
static_assert(std::is_base_of_v<T, S>, "type check");
|
|
550
550
|
if (this != &rhs) {
|
|
551
551
|
this->Reset();
|
|
552
552
|
if (!rhs.IsEmpty()) {
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
#include <stdlib.h> // For abort.
|
|
12
12
|
|
|
13
13
|
#include <memory>
|
|
14
|
+
#include <optional>
|
|
14
15
|
#include <string>
|
|
15
16
|
|
|
16
17
|
#include "v8-source-location.h" // NOLINT(build/include_directory)
|
|
@@ -80,7 +81,7 @@ class TaskRunner {
|
|
|
80
81
|
* Embedders should override PostTaskImpl instead of this.
|
|
81
82
|
*/
|
|
82
83
|
void PostTask(std::unique_ptr<Task> task,
|
|
83
|
-
|
|
84
|
+
SourceLocation location = SourceLocation::Current()) {
|
|
84
85
|
PostTaskImpl(std::move(task), location);
|
|
85
86
|
}
|
|
86
87
|
|
|
@@ -103,7 +104,7 @@ class TaskRunner {
|
|
|
103
104
|
*/
|
|
104
105
|
void PostNonNestableTask(
|
|
105
106
|
std::unique_ptr<Task> task,
|
|
106
|
-
|
|
107
|
+
SourceLocation location = SourceLocation::Current()) {
|
|
107
108
|
PostNonNestableTaskImpl(std::move(task), location);
|
|
108
109
|
}
|
|
109
110
|
|
|
@@ -114,9 +115,8 @@ class TaskRunner {
|
|
|
114
115
|
*
|
|
115
116
|
* Embedders should override PostDelayedTaskImpl instead of this.
|
|
116
117
|
*/
|
|
117
|
-
void PostDelayedTask(
|
|
118
|
-
|
|
119
|
-
const SourceLocation& location = SourceLocation::Current()) {
|
|
118
|
+
void PostDelayedTask(std::unique_ptr<Task> task, double delay_in_seconds,
|
|
119
|
+
SourceLocation location = SourceLocation::Current()) {
|
|
120
120
|
PostDelayedTaskImpl(std::move(task), delay_in_seconds, location);
|
|
121
121
|
}
|
|
122
122
|
|
|
@@ -140,7 +140,7 @@ class TaskRunner {
|
|
|
140
140
|
*/
|
|
141
141
|
void PostNonNestableDelayedTask(
|
|
142
142
|
std::unique_ptr<Task> task, double delay_in_seconds,
|
|
143
|
-
|
|
143
|
+
SourceLocation location = SourceLocation::Current()) {
|
|
144
144
|
PostNonNestableDelayedTaskImpl(std::move(task), delay_in_seconds, location);
|
|
145
145
|
}
|
|
146
146
|
|
|
@@ -154,9 +154,8 @@ class TaskRunner {
|
|
|
154
154
|
*
|
|
155
155
|
* Embedders should override PostIdleTaskImpl instead of this.
|
|
156
156
|
*/
|
|
157
|
-
void PostIdleTask(
|
|
158
|
-
|
|
159
|
-
const SourceLocation& location = SourceLocation::Current()) {
|
|
157
|
+
void PostIdleTask(std::unique_ptr<IdleTask> task,
|
|
158
|
+
SourceLocation location = SourceLocation::Current()) {
|
|
160
159
|
PostIdleTaskImpl(std::move(task), location);
|
|
161
160
|
}
|
|
162
161
|
|
|
@@ -499,12 +498,59 @@ class PageAllocator {
|
|
|
499
498
|
kNoAccessWillJitLater
|
|
500
499
|
};
|
|
501
500
|
|
|
501
|
+
/**
|
|
502
|
+
* Optional hints for AllocatePages().
|
|
503
|
+
*/
|
|
504
|
+
class AllocationHint final {
|
|
505
|
+
public:
|
|
506
|
+
AllocationHint() = default;
|
|
507
|
+
|
|
508
|
+
V8_WARN_UNUSED_RESULT constexpr AllocationHint WithAddress(
|
|
509
|
+
void* address) const {
|
|
510
|
+
return AllocationHint(address, may_grow_);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
V8_WARN_UNUSED_RESULT constexpr AllocationHint WithMayGrow() const {
|
|
514
|
+
return AllocationHint(address_, true);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
bool MayGrow() const { return may_grow_; }
|
|
518
|
+
void* Address() const { return address_; }
|
|
519
|
+
|
|
520
|
+
private:
|
|
521
|
+
constexpr AllocationHint(void* address, bool may_grow)
|
|
522
|
+
: address_(address), may_grow_(may_grow) {}
|
|
523
|
+
|
|
524
|
+
void* address_ = nullptr;
|
|
525
|
+
bool may_grow_ = false;
|
|
526
|
+
};
|
|
527
|
+
|
|
502
528
|
/**
|
|
503
529
|
* Allocates memory in range with the given alignment and permission.
|
|
504
530
|
*/
|
|
505
531
|
virtual void* AllocatePages(void* address, size_t length, size_t alignment,
|
|
506
532
|
Permission permissions) = 0;
|
|
507
533
|
|
|
534
|
+
/**
|
|
535
|
+
* Allocates memory in range with the given alignment and permission. In
|
|
536
|
+
* addition to AllocatePages it allows to pass in allocation hints. The
|
|
537
|
+
* underlying implementation may not make use of hints.
|
|
538
|
+
*/
|
|
539
|
+
virtual void* AllocatePages(size_t length, size_t alignment,
|
|
540
|
+
Permission permissions, AllocationHint hint) {
|
|
541
|
+
return AllocatePages(hint.Address(), length, alignment, permissions);
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* Resizes the previously allocated memory at the given address. Returns true
|
|
546
|
+
* if the allocation could be resized. Returns false if this operation is
|
|
547
|
+
* either not supported or the object could not be resized in-place.
|
|
548
|
+
*/
|
|
549
|
+
virtual bool ResizeAllocationAt(void* address, size_t old_length,
|
|
550
|
+
size_t new_length, Permission permissions) {
|
|
551
|
+
return false;
|
|
552
|
+
}
|
|
553
|
+
|
|
508
554
|
/**
|
|
509
555
|
* Frees memory in a range that was allocated by a call to AllocatePages.
|
|
510
556
|
*/
|
|
@@ -655,14 +701,6 @@ class ThreadIsolatedAllocator {
|
|
|
655
701
|
* Return the pkey used to implement the thread isolation if Type == kPkey.
|
|
656
702
|
*/
|
|
657
703
|
virtual int Pkey() const { return -1; }
|
|
658
|
-
|
|
659
|
-
/**
|
|
660
|
-
* Per-thread permissions can be reset on signal handler entry. Even reading
|
|
661
|
-
* ThreadIsolated memory will segfault in that case.
|
|
662
|
-
* Call this function on signal handler entry to ensure that read permissions
|
|
663
|
-
* are restored.
|
|
664
|
-
*/
|
|
665
|
-
static void SetDefaultPermissionsForSignalHandler();
|
|
666
704
|
};
|
|
667
705
|
|
|
668
706
|
// Opaque type representing a handle to a shared memory region.
|
|
@@ -948,6 +986,29 @@ class VirtualAddressSpace {
|
|
|
948
986
|
*/
|
|
949
987
|
virtual void FreeSharedPages(Address address, size_t size) = 0;
|
|
950
988
|
|
|
989
|
+
/**
|
|
990
|
+
* Memory protection key support.
|
|
991
|
+
*
|
|
992
|
+
* If supported by the hardware and operating system, virtual address spaces
|
|
993
|
+
* can use memory protection keys in addition to the regular page
|
|
994
|
+
* permissions. The MemoryProtectionKeyId type identifies a memory protection
|
|
995
|
+
* key and is used by the related APIs in this class.
|
|
996
|
+
*
|
|
997
|
+
* TODO(saelo): consider renaming to just MemoryProtectionKey, but currently
|
|
998
|
+
* there's a naming conflict with base::MemoryProtectionKey.
|
|
999
|
+
*/
|
|
1000
|
+
using MemoryProtectionKeyId = int;
|
|
1001
|
+
|
|
1002
|
+
/**
|
|
1003
|
+
* The memory protection key used by this space, if any.
|
|
1004
|
+
*
|
|
1005
|
+
* If this space uses a memory protection key, then all memory pages in it
|
|
1006
|
+
* will have this key set. In that case, this API will return that key.
|
|
1007
|
+
*
|
|
1008
|
+
* \returns the memory protection key used by this space or std::nullopt.
|
|
1009
|
+
*/
|
|
1010
|
+
virtual std::optional<MemoryProtectionKeyId> ActiveMemoryProtectionKey() = 0;
|
|
1011
|
+
|
|
951
1012
|
/**
|
|
952
1013
|
* Whether this instance can allocate subspaces or not.
|
|
953
1014
|
*
|
|
@@ -974,11 +1035,15 @@ class VirtualAddressSpace {
|
|
|
974
1035
|
* \param max_page_permissions The maximum permissions that pages allocated in
|
|
975
1036
|
* the subspace can obtain.
|
|
976
1037
|
*
|
|
1038
|
+
* \param key Optional memory protection key for the subspace. If used, the
|
|
1039
|
+
* returned subspace will use this key for all its memory pages.
|
|
1040
|
+
*
|
|
977
1041
|
* \returns a new subspace or nullptr on failure.
|
|
978
1042
|
*/
|
|
979
1043
|
virtual std::unique_ptr<VirtualAddressSpace> AllocateSubspace(
|
|
980
1044
|
Address hint, size_t size, size_t alignment,
|
|
981
|
-
PagePermissions max_page_permissions
|
|
1045
|
+
PagePermissions max_page_permissions,
|
|
1046
|
+
std::optional<MemoryProtectionKeyId> key = std::nullopt) = 0;
|
|
982
1047
|
|
|
983
1048
|
//
|
|
984
1049
|
// TODO(v8) maybe refactor the methods below before stabilizing the API. For
|
|
@@ -1117,9 +1182,8 @@ class Platform {
|
|
|
1117
1182
|
* CallOnWorkerThread().
|
|
1118
1183
|
*/
|
|
1119
1184
|
V8_DEPRECATE_SOON("Use PostTaskOnWorkerThread instead.")
|
|
1120
|
-
void CallOnWorkerThread(
|
|
1121
|
-
|
|
1122
|
-
const SourceLocation& location = SourceLocation::Current()) {
|
|
1185
|
+
void CallOnWorkerThread(std::unique_ptr<Task> task,
|
|
1186
|
+
SourceLocation location = SourceLocation::Current()) {
|
|
1123
1187
|
PostTaskOnWorkerThreadImpl(TaskPriority::kUserVisible, std::move(task),
|
|
1124
1188
|
location);
|
|
1125
1189
|
}
|
|
@@ -1133,7 +1197,7 @@ class Platform {
|
|
|
1133
1197
|
V8_DEPRECATE_SOON("Use PostTaskOnWorkerThread instead.")
|
|
1134
1198
|
void CallBlockingTaskOnWorkerThread(
|
|
1135
1199
|
std::unique_ptr<Task> task,
|
|
1136
|
-
|
|
1200
|
+
SourceLocation location = SourceLocation::Current()) {
|
|
1137
1201
|
// Embedders may optionally override this to process these tasks in a high
|
|
1138
1202
|
// priority pool.
|
|
1139
1203
|
PostTaskOnWorkerThreadImpl(TaskPriority::kUserBlocking, std::move(task),
|
|
@@ -1148,7 +1212,7 @@ class Platform {
|
|
|
1148
1212
|
V8_DEPRECATE_SOON("Use PostTaskOnWorkerThread instead.")
|
|
1149
1213
|
void CallLowPriorityTaskOnWorkerThread(
|
|
1150
1214
|
std::unique_ptr<Task> task,
|
|
1151
|
-
|
|
1215
|
+
SourceLocation location = SourceLocation::Current()) {
|
|
1152
1216
|
// Embedders may optionally override this to process these tasks in a low
|
|
1153
1217
|
// priority pool.
|
|
1154
1218
|
PostTaskOnWorkerThreadImpl(TaskPriority::kBestEffort, std::move(task),
|
|
@@ -1164,7 +1228,7 @@ class Platform {
|
|
|
1164
1228
|
V8_DEPRECATE_SOON("Use PostDelayedTaskOnWorkerThread instead.")
|
|
1165
1229
|
void CallDelayedOnWorkerThread(
|
|
1166
1230
|
std::unique_ptr<Task> task, double delay_in_seconds,
|
|
1167
|
-
|
|
1231
|
+
SourceLocation location = SourceLocation::Current()) {
|
|
1168
1232
|
PostDelayedTaskOnWorkerThreadImpl(TaskPriority::kUserVisible,
|
|
1169
1233
|
std::move(task), delay_in_seconds,
|
|
1170
1234
|
location);
|
|
@@ -1177,7 +1241,7 @@ class Platform {
|
|
|
1177
1241
|
*/
|
|
1178
1242
|
void PostTaskOnWorkerThread(
|
|
1179
1243
|
TaskPriority priority, std::unique_ptr<Task> task,
|
|
1180
|
-
|
|
1244
|
+
SourceLocation location = SourceLocation::Current()) {
|
|
1181
1245
|
PostTaskOnWorkerThreadImpl(priority, std::move(task), location);
|
|
1182
1246
|
}
|
|
1183
1247
|
|
|
@@ -1190,7 +1254,7 @@ class Platform {
|
|
|
1190
1254
|
void PostDelayedTaskOnWorkerThread(
|
|
1191
1255
|
TaskPriority priority, std::unique_ptr<Task> task,
|
|
1192
1256
|
double delay_in_seconds,
|
|
1193
|
-
|
|
1257
|
+
SourceLocation location = SourceLocation::Current()) {
|
|
1194
1258
|
PostDelayedTaskOnWorkerThreadImpl(priority, std::move(task),
|
|
1195
1259
|
delay_in_seconds, location);
|
|
1196
1260
|
}
|
|
@@ -1247,7 +1311,7 @@ class Platform {
|
|
|
1247
1311
|
*/
|
|
1248
1312
|
std::unique_ptr<JobHandle> PostJob(
|
|
1249
1313
|
TaskPriority priority, std::unique_ptr<JobTask> job_task,
|
|
1250
|
-
|
|
1314
|
+
SourceLocation location = SourceLocation::Current()) {
|
|
1251
1315
|
auto handle = CreateJob(priority, std::move(job_task), location);
|
|
1252
1316
|
handle->NotifyConcurrencyIncrease();
|
|
1253
1317
|
return handle;
|
|
@@ -1270,7 +1334,7 @@ class Platform {
|
|
|
1270
1334
|
*/
|
|
1271
1335
|
std::unique_ptr<JobHandle> CreateJob(
|
|
1272
1336
|
TaskPriority priority, std::unique_ptr<JobTask> job_task,
|
|
1273
|
-
|
|
1337
|
+
SourceLocation location = SourceLocation::Current()) {
|
|
1274
1338
|
return CreateJobImpl(priority, std::move(job_task), location);
|
|
1275
1339
|
}
|
|
1276
1340
|
|
|
@@ -635,11 +635,10 @@ class V8_EXPORT String : public Name {
|
|
|
635
635
|
bool StringEquals(Local<String> str) const;
|
|
636
636
|
|
|
637
637
|
/**
|
|
638
|
-
* Converts an object to a UTF-8-encoded character array.
|
|
639
|
-
* you want to print the object. If conversion to a string fails
|
|
640
|
-
* (e.g. due to an exception in the toString() method of the object)
|
|
641
|
-
*
|
|
642
|
-
* NULL.
|
|
638
|
+
* Converts an object to a null-terminated UTF-8-encoded character array.
|
|
639
|
+
* Useful if you want to print the object. If conversion to a string fails
|
|
640
|
+
* (e.g. due to an exception in the toString() method of the object) then the
|
|
641
|
+
* length() method returns 0 and the * operator returns NULL.
|
|
643
642
|
*
|
|
644
643
|
* WARNING: This will unconditionally copy the contents of the JavaScript
|
|
645
644
|
* string, and should be avoided in situations where performance is a concern.
|
|
@@ -647,8 +646,7 @@ class V8_EXPORT String : public Name {
|
|
|
647
646
|
*/
|
|
648
647
|
class V8_EXPORT Utf8Value {
|
|
649
648
|
public:
|
|
650
|
-
Utf8Value(Isolate* isolate, Local<v8::Value> obj
|
|
651
|
-
WriteOptions options = REPLACE_INVALID_UTF8);
|
|
649
|
+
Utf8Value(Isolate* isolate, Local<v8::Value> obj);
|
|
652
650
|
~Utf8Value();
|
|
653
651
|
char* operator*() { return str_; }
|
|
654
652
|
const char* operator*() const { return str_; }
|
|
@@ -851,6 +849,19 @@ class V8_EXPORT Number : public Numeric {
|
|
|
851
849
|
public:
|
|
852
850
|
double Value() const;
|
|
853
851
|
static Local<Number> New(Isolate* isolate, double value);
|
|
852
|
+
template <typename Int>
|
|
853
|
+
requires(std::is_integral<Int>::value && !std::is_same<Int, bool>::value &&
|
|
854
|
+
std::is_signed_v<Int> && sizeof(Int) <= sizeof(int32_t))
|
|
855
|
+
V8_INLINE static Local<Number> New(Isolate* isolate, Int value) {
|
|
856
|
+
return NewFromInt32(isolate, value);
|
|
857
|
+
}
|
|
858
|
+
template <typename UInt>
|
|
859
|
+
requires(std::is_integral<UInt>::value &&
|
|
860
|
+
!std::is_same<UInt, bool>::value && std::is_unsigned_v<UInt> &&
|
|
861
|
+
sizeof(UInt) <= sizeof(uint32_t))
|
|
862
|
+
V8_INLINE static Local<Number> New(Isolate* isolate, UInt value) {
|
|
863
|
+
return NewFromUint32(isolate, value);
|
|
864
|
+
}
|
|
854
865
|
V8_INLINE static Number* Cast(v8::Data* data) {
|
|
855
866
|
#ifdef V8_ENABLE_CHECKS
|
|
856
867
|
CheckCast(data);
|
|
@@ -860,6 +871,8 @@ class V8_EXPORT Number : public Numeric {
|
|
|
860
871
|
|
|
861
872
|
private:
|
|
862
873
|
Number();
|
|
874
|
+
static Local<Number> NewFromInt32(Isolate* isolate, int32_t value);
|
|
875
|
+
static Local<Number> NewFromUint32(Isolate* isolate, uint32_t value);
|
|
863
876
|
static void CheckCast(v8::Data* that);
|
|
864
877
|
};
|
|
865
878
|
|
|
@@ -994,7 +1007,7 @@ String::ExternalStringResource* String::GetExternalStringResource() const {
|
|
|
994
1007
|
|
|
995
1008
|
ExternalStringResource* result;
|
|
996
1009
|
if (I::IsExternalTwoByteString(I::GetInstanceType(obj))) {
|
|
997
|
-
Isolate* isolate = I::
|
|
1010
|
+
Isolate* isolate = I::GetCurrentIsolateForSandbox();
|
|
998
1011
|
A value = I::ReadExternalPointerField<internal::kExternalStringResourceTag>(
|
|
999
1012
|
isolate, obj, I::kStringResourceOffset);
|
|
1000
1013
|
result = reinterpret_cast<String::ExternalStringResource*>(value);
|
|
@@ -1039,7 +1052,7 @@ String::ExternalStringResourceBase* String::GetExternalStringResourceBase(
|
|
|
1039
1052
|
ExternalStringResourceBase* resource;
|
|
1040
1053
|
if (type == I::kExternalOneByteRepresentationTag ||
|
|
1041
1054
|
type == I::kExternalTwoByteRepresentationTag) {
|
|
1042
|
-
Isolate* isolate = I::
|
|
1055
|
+
Isolate* isolate = I::GetCurrentIsolateForSandbox();
|
|
1043
1056
|
A value = I::ReadExternalPointerField<internal::kExternalStringResourceTag>(
|
|
1044
1057
|
isolate, obj, I::kStringResourceOffset);
|
|
1045
1058
|
resource = reinterpret_cast<ExternalStringResourceBase*>(value);
|
|
@@ -71,6 +71,10 @@ class V8_EXPORT CpuProfileNode {
|
|
|
71
71
|
/** The 1-based number of the source line where the function originates. */
|
|
72
72
|
int line;
|
|
73
73
|
|
|
74
|
+
/** The 1-based number of the source column where the function originates.
|
|
75
|
+
*/
|
|
76
|
+
int column;
|
|
77
|
+
|
|
74
78
|
/** The count of samples associated with the source line. */
|
|
75
79
|
unsigned int hit_count;
|
|
76
80
|
};
|
|
@@ -101,6 +101,12 @@ struct CppHeapPointerTagRange {
|
|
|
101
101
|
constexpr CppHeapPointerTagRange kAnyCppHeapPointer(
|
|
102
102
|
CppHeapPointerTag::kFirstTag, CppHeapPointerTag::kLastTag);
|
|
103
103
|
|
|
104
|
+
/**
|
|
105
|
+
* Hardware support for the V8 Sandbox.
|
|
106
|
+
*
|
|
107
|
+
* This is an experimental feature that may change or be removed without
|
|
108
|
+
* further notice. Use at your own risk.
|
|
109
|
+
*/
|
|
104
110
|
class SandboxHardwareSupport {
|
|
105
111
|
public:
|
|
106
112
|
/**
|
|
@@ -109,6 +115,16 @@ class SandboxHardwareSupport {
|
|
|
109
115
|
* hardware permissions to the memory that will be inherited on clone.
|
|
110
116
|
*/
|
|
111
117
|
V8_EXPORT static void InitializeBeforeThreadCreation();
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Prepares the current thread for executing sandboxed code.
|
|
121
|
+
*
|
|
122
|
+
* This must be called on newly created threads before they execute any
|
|
123
|
+
* sandboxed code (in particular any JavaScript or WebAssembly code). It
|
|
124
|
+
* should not be invoked on threads that never execute sandboxed code,
|
|
125
|
+
* although it is fine to do so from a security point of view.
|
|
126
|
+
*/
|
|
127
|
+
V8_EXPORT static void PrepareCurrentThreadForHardwareSandboxing();
|
|
112
128
|
};
|
|
113
129
|
|
|
114
130
|
namespace internal {
|