node-linux-arm64 24.11.0 → 25.1.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 +270 -1832
- package/README.md +2 -4
- package/bin/node +0 -0
- package/include/node/common.gypi +4 -16
- package/include/node/config.gypi +11 -9
- 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 +12 -0
- package/include/node/node.h +42 -78
- package/include/node/node_version.h +5 -5
- 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-script.h +17 -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 +1 -1
- package/share/doc/node/gdbinit +221 -4
- package/share/man/man1/node.1 +21 -4
|
@@ -181,7 +181,7 @@ class TracedReference : public BasicTracedReference<T> {
|
|
|
181
181
|
*/
|
|
182
182
|
template <class S>
|
|
183
183
|
TracedReference(Isolate* isolate, Local<S> that) : BasicTracedReference<T>() {
|
|
184
|
-
static_assert(std::
|
|
184
|
+
static_assert(std::is_base_of_v<T, S>, "type check");
|
|
185
185
|
if (V8_UNLIKELY(that.IsEmpty())) {
|
|
186
186
|
return;
|
|
187
187
|
}
|
|
@@ -202,7 +202,7 @@ class TracedReference : public BasicTracedReference<T> {
|
|
|
202
202
|
template <class S>
|
|
203
203
|
TracedReference(Isolate* isolate, Local<S> that, IsDroppable)
|
|
204
204
|
: BasicTracedReference<T>() {
|
|
205
|
-
static_assert(std::
|
|
205
|
+
static_assert(std::is_base_of_v<T, S>, "type check");
|
|
206
206
|
if (V8_UNLIKELY(that.IsEmpty())) {
|
|
207
207
|
return;
|
|
208
208
|
}
|
|
@@ -351,7 +351,7 @@ V8_INLINE bool operator!=(const v8::Local<U>& lhs,
|
|
|
351
351
|
template <class T>
|
|
352
352
|
template <class S>
|
|
353
353
|
void TracedReference<T>::Reset(Isolate* isolate, const Local<S>& other) {
|
|
354
|
-
static_assert(std::
|
|
354
|
+
static_assert(std::is_base_of_v<T, S>, "type check");
|
|
355
355
|
this->Reset();
|
|
356
356
|
if (V8_UNLIKELY(other.IsEmpty())) {
|
|
357
357
|
return;
|
|
@@ -366,7 +366,7 @@ template <class T>
|
|
|
366
366
|
template <class S>
|
|
367
367
|
void TracedReference<T>::Reset(Isolate* isolate, const Local<S>& other,
|
|
368
368
|
IsDroppable) {
|
|
369
|
-
static_assert(std::
|
|
369
|
+
static_assert(std::is_base_of_v<T, S>, "type check");
|
|
370
370
|
this->Reset();
|
|
371
371
|
if (V8_UNLIKELY(other.IsEmpty())) {
|
|
372
372
|
return;
|
|
@@ -381,7 +381,7 @@ template <class T>
|
|
|
381
381
|
template <class S>
|
|
382
382
|
TracedReference<T>& TracedReference<T>::operator=(
|
|
383
383
|
TracedReference<S>&& rhs) noexcept {
|
|
384
|
-
static_assert(std::
|
|
384
|
+
static_assert(std::is_base_of_v<T, S>, "type check");
|
|
385
385
|
*this = std::move(rhs.template As<T>());
|
|
386
386
|
return *this;
|
|
387
387
|
}
|
|
@@ -390,7 +390,7 @@ template <class T>
|
|
|
390
390
|
template <class S>
|
|
391
391
|
TracedReference<T>& TracedReference<T>::operator=(
|
|
392
392
|
const TracedReference<S>& rhs) {
|
|
393
|
-
static_assert(std::
|
|
393
|
+
static_assert(std::is_base_of_v<T, S>, "type check");
|
|
394
394
|
*this = rhs.template As<T>();
|
|
395
395
|
return *this;
|
|
396
396
|
}
|
|
@@ -33,6 +33,9 @@ struct V8_EXPORT RegisterState {
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
// A StateTag represents a possible state of the VM.
|
|
36
|
+
// This enum is append-only to preserve compatibility with historical logs.
|
|
37
|
+
// Add new states only at the end and do not reorder or remove existing values.
|
|
38
|
+
// LINT.IfChange
|
|
36
39
|
enum StateTag : uint16_t {
|
|
37
40
|
JS,
|
|
38
41
|
GC,
|
|
@@ -44,7 +47,17 @@ enum StateTag : uint16_t {
|
|
|
44
47
|
ATOMICS_WAIT,
|
|
45
48
|
IDLE,
|
|
46
49
|
LOGGING,
|
|
50
|
+
IDLE_EXTERNAL,
|
|
47
51
|
};
|
|
52
|
+
// LINT.ThenChange(../tools/profile.mjs, ../tools/tickprocessor.mjs)
|
|
53
|
+
|
|
54
|
+
constexpr bool IsExternal(StateTag state) {
|
|
55
|
+
return state == EXTERNAL || state == IDLE_EXTERNAL;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
constexpr bool IsIdle(StateTag state) {
|
|
59
|
+
return state == IDLE || state == IDLE_EXTERNAL;
|
|
60
|
+
}
|
|
48
61
|
|
|
49
62
|
// The output structure filled up by GetStackSample API function.
|
|
50
63
|
struct SampleInfo {
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
// These macros define the version number for the current version.
|
|
9
9
|
// NOTE these macros are used by some of the tool scripts and the build
|
|
10
10
|
// system so their names cannot be changed without changing the scripts.
|
|
11
|
-
#define V8_MAJOR_VERSION
|
|
12
|
-
#define V8_MINOR_VERSION
|
|
13
|
-
#define V8_BUILD_NUMBER
|
|
14
|
-
#define V8_PATCH_LEVEL
|
|
11
|
+
#define V8_MAJOR_VERSION 14
|
|
12
|
+
#define V8_MINOR_VERSION 1
|
|
13
|
+
#define V8_BUILD_NUMBER 146
|
|
14
|
+
#define V8_PATCH_LEVEL 11
|
|
15
15
|
|
|
16
16
|
// Use 1 for candidates and 0 otherwise.
|
|
17
17
|
// (Boolean macro values are not supported by all preprocessors.)
|
package/include/node/v8config.h
CHANGED
|
@@ -85,6 +85,7 @@ path. Add it with -I<path> to the command line
|
|
|
85
85
|
// V8_OS_DARWIN - Darwin (macOS, iOS)
|
|
86
86
|
// V8_OS_MACOS - macOS
|
|
87
87
|
// V8_OS_IOS - iOS
|
|
88
|
+
// V8_OS_TVOS - tvOS (also sets V8_OS_IOS)
|
|
88
89
|
// V8_OS_NETBSD - NetBSD
|
|
89
90
|
// V8_OS_OPENBSD - OpenBSD
|
|
90
91
|
// V8_OS_POSIX - POSIX compatible (mostly everything except Windows)
|
|
@@ -108,6 +109,9 @@ path. Add it with -I<path> to the command line
|
|
|
108
109
|
# if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
|
|
109
110
|
# define V8_OS_IOS 1
|
|
110
111
|
# define V8_OS_STRING "ios"
|
|
112
|
+
# if defined(TARGET_OS_TV) && TARGET_OS_TV
|
|
113
|
+
# define V8_OS_TVOS 1
|
|
114
|
+
# endif
|
|
111
115
|
# else
|
|
112
116
|
# define V8_OS_MACOS 1
|
|
113
117
|
# define V8_OS_STRING "macos"
|
|
@@ -187,6 +191,7 @@ path. Add it with -I<path> to the command line
|
|
|
187
191
|
// V8_TARGET_OS_ANDROID
|
|
188
192
|
// V8_TARGET_OS_FUCHSIA
|
|
189
193
|
// V8_TARGET_OS_IOS
|
|
194
|
+
// V8_TARGET_OS_TVOS (also sets V8_TARGET_OS_IOS)
|
|
190
195
|
// V8_TARGET_OS_LINUX
|
|
191
196
|
// V8_TARGET_OS_MACOS
|
|
192
197
|
// V8_TARGET_OS_WIN
|
|
@@ -200,6 +205,7 @@ path. Add it with -I<path> to the command line
|
|
|
200
205
|
# if !defined(V8_TARGET_OS_ANDROID) \
|
|
201
206
|
&& !defined(V8_TARGET_OS_FUCHSIA) \
|
|
202
207
|
&& !defined(V8_TARGET_OS_IOS) \
|
|
208
|
+
&& !defined(V8_TARGET_OS_TVOS) \
|
|
203
209
|
&& !defined(V8_TARGET_OS_LINUX) \
|
|
204
210
|
&& !defined(V8_TARGET_OS_MACOS) \
|
|
205
211
|
&& !defined(V8_TARGET_OS_WIN) \
|
|
@@ -212,6 +218,7 @@ path. Add it with -I<path> to the command line
|
|
|
212
218
|
# if defined(V8_TARGET_OS_ANDROID) \
|
|
213
219
|
|| defined(V8_TARGET_OS_FUCHSIA) \
|
|
214
220
|
|| defined(V8_TARGET_OS_IOS) \
|
|
221
|
+
|| defined(V8_TARGET_OS_TVOS) \
|
|
215
222
|
|| defined(V8_TARGET_OS_LINUX) \
|
|
216
223
|
|| defined(V8_TARGET_OS_MACOS) \
|
|
217
224
|
|| defined(V8_TARGET_OS_WIN) \
|
|
@@ -232,6 +239,10 @@ path. Add it with -I<path> to the command line
|
|
|
232
239
|
# define V8_TARGET_OS_IOS
|
|
233
240
|
#endif
|
|
234
241
|
|
|
242
|
+
#ifdef V8_OS_TVOS
|
|
243
|
+
# define V8_TARGET_OS_TVOS
|
|
244
|
+
#endif
|
|
245
|
+
|
|
235
246
|
#ifdef V8_OS_LINUX
|
|
236
247
|
# define V8_TARGET_OS_LINUX
|
|
237
248
|
#endif
|
|
@@ -322,6 +333,7 @@ path. Add it with -I<path> to the command line
|
|
|
322
333
|
// V8_HAS_CPP_ATTRIBUTE_NODISCARD - [[nodiscard]] supported
|
|
323
334
|
// V8_HAS_CPP_ATTRIBUTE_NO_UNIQUE_ADDRESS
|
|
324
335
|
// - [[no_unique_address]] supported
|
|
336
|
+
// V8_HAS_CPP_ATTRIBUTE_LIFETIME_BOUND - [[clang::lifetimebound]] supported
|
|
325
337
|
// V8_HAS_BUILTIN_ADD_OVERFLOW - __builtin_add_overflow() supported
|
|
326
338
|
// V8_HAS_BUILTIN_BIT_CAST - __builtin_bit_cast() supported
|
|
327
339
|
// V8_HAS_BUILTIN_BSWAP16 - __builtin_bswap16() supported
|
|
@@ -401,6 +413,7 @@ path. Add it with -I<path> to the command line
|
|
|
401
413
|
# define V8_HAS_CPP_ATTRIBUTE_NO_UNIQUE_ADDRESS \
|
|
402
414
|
(V8_HAS_CPP_ATTRIBUTE(no_unique_address))
|
|
403
415
|
#endif
|
|
416
|
+
# define V8_HAS_CPP_ATTRIBUTE_LIFETIME_BOUND (V8_HAS_CPP_ATTRIBUTE(clang::lifetimebound))
|
|
404
417
|
|
|
405
418
|
# define V8_HAS_BUILTIN_ADD_OVERFLOW (__has_builtin(__builtin_add_overflow))
|
|
406
419
|
# define V8_HAS_BUILTIN_ASSUME (__has_builtin(__builtin_assume))
|
|
@@ -697,6 +710,17 @@ path. Add it with -I<path> to the command line
|
|
|
697
710
|
#define V8_NODISCARD /* NOT SUPPORTED */
|
|
698
711
|
#endif
|
|
699
712
|
|
|
713
|
+
|
|
714
|
+
// Annotate a function to ensure the function is retained in the compiled binary
|
|
715
|
+
// even if it appears to be unused to the compiler.
|
|
716
|
+
#if V8_HAS_ATTRIBUTE_USED && V8_HAS_ATTRIBUTE_VISIBILITY
|
|
717
|
+
#define V8_SYMBOL_USED \
|
|
718
|
+
__attribute__((used, visibility("default")))
|
|
719
|
+
#else
|
|
720
|
+
#define V8_SYMBOL_USED /* NOT SUPPORTED */
|
|
721
|
+
#endif
|
|
722
|
+
|
|
723
|
+
|
|
700
724
|
// The no_unique_address attribute allows tail padding in a non-static data
|
|
701
725
|
// member to overlap other members of the enclosing class (and in the special
|
|
702
726
|
// case when the type is empty, permits it to fully overlap other members). The
|
|
@@ -726,6 +750,41 @@ path. Add it with -I<path> to the command line
|
|
|
726
750
|
#define V8_NO_UNIQUE_ADDRESS /* NOT SUPPORTED */
|
|
727
751
|
#endif
|
|
728
752
|
|
|
753
|
+
// Annotates a pointer or reference parameter or return value for a member
|
|
754
|
+
// function as having lifetime intertwined with the instance on which the
|
|
755
|
+
// function is called. For parameters, the function is assumed to store the
|
|
756
|
+
// value into the called-on object, so if the referred-to object is later
|
|
757
|
+
// destroyed, the called-on object is also considered to be dangling. For return
|
|
758
|
+
// values, the value is assumed to point into the called-on object, so if that
|
|
759
|
+
// object is destroyed, the returned value is also considered to be dangling.
|
|
760
|
+
// Useful to diagnose some cases of lifetime errors.
|
|
761
|
+
//
|
|
762
|
+
// See also:
|
|
763
|
+
// https://clang.llvm.org/docs/AttributeReference.html#lifetimebound
|
|
764
|
+
//
|
|
765
|
+
// Usage:
|
|
766
|
+
// ```
|
|
767
|
+
// struct S {
|
|
768
|
+
// S(int* p V8_LIFETIME_BOUND);
|
|
769
|
+
// int* Get() V8_LIFETIME_BOUND;
|
|
770
|
+
// };
|
|
771
|
+
// S Func1() {
|
|
772
|
+
// int i = 0;
|
|
773
|
+
// // The following return will not compile; diagnosed as returning address
|
|
774
|
+
// // of a stack object.
|
|
775
|
+
// return S(&i);
|
|
776
|
+
// }
|
|
777
|
+
// int* Func2(int* p) {
|
|
778
|
+
// // The following return will not compile; diagnosed as returning address
|
|
779
|
+
// // of a local temporary.
|
|
780
|
+
// return S(p).Get();
|
|
781
|
+
// }
|
|
782
|
+
#if V8_HAS_CPP_ATTRIBUTE_LIFETIME_BOUND
|
|
783
|
+
#define V8_LIFETIME_BOUND [[clang::lifetimebound]]
|
|
784
|
+
#else
|
|
785
|
+
#define V8_LIFETIME_BOUND /* NOT SUPPORTED */
|
|
786
|
+
#endif
|
|
787
|
+
|
|
729
788
|
// Marks a type as being eligible for the "trivial" ABI despite having a
|
|
730
789
|
// non-trivial destructor or copy/move constructor. Such types can be relocated
|
|
731
790
|
// after construction by simply copying their memory, which makes them eligible
|
|
@@ -798,7 +857,8 @@ V8 shared library set USING_V8_SHARED.
|
|
|
798
857
|
#else // V8_OS_WIN
|
|
799
858
|
|
|
800
859
|
// Setup for Linux shared library export.
|
|
801
|
-
#if V8_HAS_ATTRIBUTE_VISIBILITY &&
|
|
860
|
+
#if (V8_HAS_ATTRIBUTE_VISIBILITY && \
|
|
861
|
+
(defined(BUILDING_V8_SHARED) || USING_V8_SHARED))
|
|
802
862
|
# define V8_EXPORT __attribute__((visibility("default")))
|
|
803
863
|
#else
|
|
804
864
|
# define V8_EXPORT
|
|
@@ -909,8 +969,6 @@ V8 shared library set USING_V8_SHARED.
|
|
|
909
969
|
#define V8_TARGET_ARCH_32_BIT 1
|
|
910
970
|
#elif V8_TARGET_ARCH_ARM64
|
|
911
971
|
#define V8_TARGET_ARCH_64_BIT 1
|
|
912
|
-
#elif V8_TARGET_ARCH_MIPS
|
|
913
|
-
#define V8_TARGET_ARCH_32_BIT 1
|
|
914
972
|
#elif V8_TARGET_ARCH_MIPS64
|
|
915
973
|
#define V8_TARGET_ARCH_64_BIT 1
|
|
916
974
|
#elif V8_TARGET_ARCH_LOONG64
|
|
@@ -948,8 +1006,10 @@ V8 shared library set USING_V8_SHARED.
|
|
|
948
1006
|
#if (V8_TARGET_ARCH_MIPS64 && !(V8_HOST_ARCH_X64 || V8_HOST_ARCH_MIPS64))
|
|
949
1007
|
#error Target architecture mips64 is only supported on mips64 and x64 host
|
|
950
1008
|
#endif
|
|
951
|
-
#if (V8_TARGET_ARCH_RISCV64 &&
|
|
952
|
-
|
|
1009
|
+
#if (V8_TARGET_ARCH_RISCV64 && \
|
|
1010
|
+
!(V8_HOST_ARCH_X64 || V8_HOST_ARCH_ARM64 || V8_HOST_ARCH_RISCV64))
|
|
1011
|
+
#error Target architecture riscv64 is only supported on riscv64, x64, and \
|
|
1012
|
+
arm64 host
|
|
953
1013
|
#endif
|
|
954
1014
|
#if (V8_TARGET_ARCH_RISCV32 && !(V8_HOST_ARCH_IA32 || V8_HOST_ARCH_RISCV32))
|
|
955
1015
|
#error Target architecture riscv32 is only supported on riscv32 and ia32 host
|
package/package.json
CHANGED
package/share/doc/node/gdbinit
CHANGED
|
@@ -14,6 +14,8 @@ end
|
|
|
14
14
|
# Print content of V8 handles.
|
|
15
15
|
python
|
|
16
16
|
import gdb
|
|
17
|
+
import gdb.printing
|
|
18
|
+
import gdb.types
|
|
17
19
|
|
|
18
20
|
class PrintV8HandleCommand(gdb.Command):
|
|
19
21
|
"""Print content of a V8 object, accessed through a handle."""
|
|
@@ -94,9 +96,25 @@ PrintV8LocalCommand()
|
|
|
94
96
|
PrintV8InternalHandleCommand()
|
|
95
97
|
end
|
|
96
98
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
alias
|
|
99
|
+
python
|
|
100
|
+
class TryAliasCommand(gdb.Command):
|
|
101
|
+
"""Create an alias, but don't error if it already exists."""
|
|
102
|
+
|
|
103
|
+
def __init__ (self):
|
|
104
|
+
super (TryAliasCommand, self).__init__ ("try-alias", gdb.COMMAND_FILES)
|
|
105
|
+
|
|
106
|
+
def invoke (self, arg, from_tty):
|
|
107
|
+
try:
|
|
108
|
+
gdb.execute('alias ' + arg)
|
|
109
|
+
except:
|
|
110
|
+
pass
|
|
111
|
+
|
|
112
|
+
TryAliasCommand()
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
try-alias jlh = print-v8-local
|
|
116
|
+
try-alias jl = print-v8-local
|
|
117
|
+
try-alias jh = print-v8-internal-handle
|
|
100
118
|
|
|
101
119
|
# Print Code objects containing given PC.
|
|
102
120
|
define jco
|
|
@@ -361,7 +379,7 @@ import subprocess
|
|
|
361
379
|
import sys
|
|
362
380
|
|
|
363
381
|
compile_dirs = set()
|
|
364
|
-
|
|
382
|
+
src_dir = None
|
|
365
383
|
|
|
366
384
|
def get_current_debug_file_directories():
|
|
367
385
|
dir = gdb.execute("show debug-file-directory", to_string=True)
|
|
@@ -380,6 +398,40 @@ def add_debug_file_directory(dir):
|
|
|
380
398
|
"set debug-file-directory %s" % ":".join(current_dirs), to_string=True)
|
|
381
399
|
|
|
382
400
|
|
|
401
|
+
def load_libcxx_pretty_printers(src_dir):
|
|
402
|
+
libcxx_pretty_printers = os.path.join(src_dir, 'third_party', 'libc++', 'src',
|
|
403
|
+
'utils', 'gdb', 'libcxx')
|
|
404
|
+
if not os.path.isdir(libcxx_pretty_printers):
|
|
405
|
+
return
|
|
406
|
+
sys.path.insert(1, libcxx_pretty_printers)
|
|
407
|
+
from printers import register_libcxx_printer_loader
|
|
408
|
+
register_libcxx_printer_loader()
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
def set_src_dir(compile_dir):
|
|
412
|
+
global src_dir
|
|
413
|
+
git = subprocess.Popen(
|
|
414
|
+
['git', '-C', compile_dir, 'rev-parse', '--show-toplevel'],
|
|
415
|
+
stdout=subprocess.PIPE,
|
|
416
|
+
stderr=subprocess.PIPE)
|
|
417
|
+
src_dir, _ = git.communicate()
|
|
418
|
+
if git.returncode:
|
|
419
|
+
return
|
|
420
|
+
if isinstance(src_dir, str):
|
|
421
|
+
src_dir = src_dir.rstrip()
|
|
422
|
+
else:
|
|
423
|
+
src_dir = src_dir.decode('utf-8').rstrip()
|
|
424
|
+
|
|
425
|
+
# If there's no LICENSE.v8 file in the repo root, we got the wrong git repo.
|
|
426
|
+
# The most common way to have this happen is to be in a git checkout of
|
|
427
|
+
# another project that vendors chromium in its own third_party directory. In
|
|
428
|
+
# that case, try falling back to the current working directory.
|
|
429
|
+
if not os.path.isfile(os.path.join(src_dir, 'LICENSE.v8')):
|
|
430
|
+
src_dir = os.path.abspath(os.getcwd())
|
|
431
|
+
|
|
432
|
+
load_libcxx_pretty_printers(src_dir)
|
|
433
|
+
|
|
434
|
+
|
|
383
435
|
def newobj_handler(event):
|
|
384
436
|
global compile_dirs
|
|
385
437
|
compile_dir = os.path.dirname(event.new_objfile.filename)
|
|
@@ -396,6 +448,10 @@ def newobj_handler(event):
|
|
|
396
448
|
# https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html
|
|
397
449
|
# https://crbug.com/603286#c35
|
|
398
450
|
add_debug_file_directory(compile_dir)
|
|
451
|
+
|
|
452
|
+
global src_dir
|
|
453
|
+
if not src_dir:
|
|
454
|
+
set_src_dir(compile_dir)
|
|
399
455
|
|
|
400
456
|
# Event hook for newly loaded objfiles.
|
|
401
457
|
# https://sourceware.org/gdb/onlinedocs/gdb/Events-In-Python.html
|
|
@@ -455,6 +511,7 @@ def cppgc_pretty_printers(val):
|
|
|
455
511
|
|
|
456
512
|
|
|
457
513
|
gdb.pretty_printers.append(cppgc_pretty_printers)
|
|
514
|
+
|
|
458
515
|
class TaggedPrintCommand(gdb.Command):
|
|
459
516
|
"""
|
|
460
517
|
The equivalent of the print command that deals with tagged objects
|
|
@@ -515,4 +572,164 @@ class TaggedPrintCommand(gdb.Command):
|
|
|
515
572
|
|
|
516
573
|
TaggedPrintCommand()
|
|
517
574
|
|
|
575
|
+
|
|
576
|
+
static_roots_cache = None
|
|
577
|
+
def GetStaticRoot(ptr):
|
|
578
|
+
global static_roots_cache
|
|
579
|
+
if static_roots_cache is None:
|
|
580
|
+
static_roots_cache = {}
|
|
581
|
+
try:
|
|
582
|
+
for field in gdb.lookup_type("v8::internal::StaticReadOnlyRoot").fields():
|
|
583
|
+
value = gdb.parse_and_eval("v8::internal::StaticReadOnlyRoot::"+field.name)
|
|
584
|
+
if int(value) in static_roots_cache:
|
|
585
|
+
static_roots_cache[int(value)] += "," + field.name
|
|
586
|
+
else:
|
|
587
|
+
static_roots_cache[int(value)] = field.name
|
|
588
|
+
except Exception as e:
|
|
589
|
+
print("Warning, couldn't find static roots: ", e)
|
|
590
|
+
ptr = ptr & 0xFFFFFFFF
|
|
591
|
+
return static_roots_cache.get(ptr, None)
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
def InterpretTaggedPointer(pointer):
|
|
595
|
+
if (pointer & 0x1) == 0:
|
|
596
|
+
return f"Smi: {pointer >> 1}"
|
|
597
|
+
|
|
598
|
+
static_root = GetStaticRoot(pointer)
|
|
599
|
+
if static_root is not None:
|
|
600
|
+
return f"{static_root}"
|
|
601
|
+
|
|
602
|
+
return None
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
def OptimizedOutToNone(val):
|
|
606
|
+
if val is None:
|
|
607
|
+
return None
|
|
608
|
+
if val.is_optimized_out:
|
|
609
|
+
return None
|
|
610
|
+
return val
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
class TaggedPrinter(object):
|
|
614
|
+
"""Print Tagged<Foo> types."""
|
|
615
|
+
|
|
616
|
+
def __init__(self, val, pointee_type):
|
|
617
|
+
self.val = OptimizedOutToNone(val)
|
|
618
|
+
self.pointee_type = pointee_type.lstrip('v8::internal::')
|
|
619
|
+
self.ptr = self.val["ptr_"] if self.val is not None else None
|
|
620
|
+
|
|
621
|
+
def to_string(self):
|
|
622
|
+
if self.ptr is None:
|
|
623
|
+
return f"Tagged<{self.pointee_type}>{{<optimized out>}}"
|
|
624
|
+
pointer = int(self.ptr)
|
|
625
|
+
fmt = f"Tagged<{self.pointee_type}>{{0x{pointer:02x}}}"
|
|
626
|
+
if (label := InterpretTaggedPointer(pointer)) is not None:
|
|
627
|
+
fmt += f" ({label})"
|
|
628
|
+
return fmt
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
def tagged_pretty_printers(val):
|
|
632
|
+
# The member type might have been obscured by typedefs and template
|
|
633
|
+
# arguments. Fallback to using the underlying type.
|
|
634
|
+
real_type = val.type.strip_typedefs()
|
|
635
|
+
typename = real_type.name or real_type.tag or str(real_type)
|
|
636
|
+
regex = re.compile("^v8::internal::Tagged<(.*)>$")
|
|
637
|
+
match = regex.match(typename)
|
|
638
|
+
if match is not None:
|
|
639
|
+
return TaggedPrinter(val, pointee_type=match.group(1))
|
|
640
|
+
|
|
641
|
+
return None
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
gdb.pretty_printers.append(tagged_pretty_printers)
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
class HandlePrinter(object):
|
|
648
|
+
"""Print Handle<Foo> types."""
|
|
649
|
+
|
|
650
|
+
def __init__(self, val, pointee_type):
|
|
651
|
+
self.val = OptimizedOutToNone(val)
|
|
652
|
+
self.pointee_type = pointee_type.lstrip('v8::internal::')
|
|
653
|
+
self.location = OptimizedOutToNone(self.val["location_"] if self.val is not None else None)
|
|
654
|
+
self.ptr = self.location.dereference() if self.location is not None else None
|
|
655
|
+
|
|
656
|
+
def to_string(self):
|
|
657
|
+
if self.location is None:
|
|
658
|
+
return f"Handle<{self.pointee_type}>{{<optimized out>}}"
|
|
659
|
+
location = int(self.location)
|
|
660
|
+
fmt = f"Handle<{self.pointee_type}>{{0x{location:02x}}}: "
|
|
661
|
+
if self.ptr is None:
|
|
662
|
+
fmt += f"<optimized out>"
|
|
663
|
+
else:
|
|
664
|
+
pointer = None
|
|
665
|
+
try:
|
|
666
|
+
pointer = int(self.ptr)
|
|
667
|
+
except Exception as e:
|
|
668
|
+
fmt += f"[{e}]"
|
|
669
|
+
else:
|
|
670
|
+
fmt += f"0x{pointer:02x}"
|
|
671
|
+
if (label := InterpretTaggedPointer(pointer)) is not None:
|
|
672
|
+
fmt += f" ({label})"
|
|
673
|
+
|
|
674
|
+
return fmt
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
def handle_pretty_printers(val):
|
|
678
|
+
# The member type might have been obscured by typedefs and template
|
|
679
|
+
# arguments. Fallback to using the underlying type.
|
|
680
|
+
real_type = val.type.strip_typedefs()
|
|
681
|
+
typename = real_type.name or real_type.tag or str(real_type)
|
|
682
|
+
regex = re.compile("^v8::internal::(?:Indirect)?Handle<(.*)>$")
|
|
683
|
+
match = regex.match(typename)
|
|
684
|
+
if match is not None:
|
|
685
|
+
return HandlePrinter(val, pointee_type=match.group(1))
|
|
686
|
+
|
|
687
|
+
return None
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
gdb.pretty_printers.append(handle_pretty_printers)
|
|
691
|
+
|
|
692
|
+
|
|
693
|
+
class DirectHandlePrinter(object):
|
|
694
|
+
"""Print DirectHandle<Foo> types."""
|
|
695
|
+
|
|
696
|
+
def __init__(self, val, pointee_type):
|
|
697
|
+
self.val = val
|
|
698
|
+
self.pointee_type = pointee_type.lstrip('v8::internal::')
|
|
699
|
+
self.inner = None
|
|
700
|
+
if gdb.types.has_field(self.val.type, "handle_"):
|
|
701
|
+
self.inner = HandlePrinter(val['handle_'], pointee_type)
|
|
702
|
+
elif gdb.types.has_field(self.val.type, "obj_"):
|
|
703
|
+
self.inner = TaggedPrinter(val['obj_'], pointee_type)
|
|
704
|
+
else:
|
|
705
|
+
print("Warning: No recognised DirectHandle field")
|
|
706
|
+
|
|
707
|
+
def to_string(self):
|
|
708
|
+
if self.inner is not None:
|
|
709
|
+
return self.inner.to_string()
|
|
710
|
+
|
|
711
|
+
|
|
712
|
+
def direct_handle_pretty_printers(val):
|
|
713
|
+
# The member type might have been obscured by typedefs and template
|
|
714
|
+
# arguments. Fallback to using the underlying type.
|
|
715
|
+
real_type = val.type.strip_typedefs()
|
|
716
|
+
typename = real_type.name or real_type.tag or str(real_type)
|
|
717
|
+
regex = re.compile("^v8::internal::DirectHandle<(.*)>$")
|
|
718
|
+
match = regex.match(typename)
|
|
719
|
+
if match is not None:
|
|
720
|
+
if gdb.types.has_field(real_type, "handle_"):
|
|
721
|
+
handle = None
|
|
722
|
+
if not val.is_optimized_out:
|
|
723
|
+
handle = val['handle_']
|
|
724
|
+
return HandlePrinter(handle, match.group(1))
|
|
725
|
+
elif gdb.types.has_field(real_type, "obj_"):
|
|
726
|
+
obj = None
|
|
727
|
+
if not val.is_optimized_out:
|
|
728
|
+
obj = val['obj_']
|
|
729
|
+
return TaggedPrinter(obj, match.group(1))
|
|
730
|
+
|
|
731
|
+
return None
|
|
732
|
+
|
|
733
|
+
gdb.pretty_printers.append(direct_handle_pretty_printers)
|
|
734
|
+
|
|
518
735
|
end
|
package/share/man/man1/node.1
CHANGED
|
@@ -85,6 +85,12 @@ Allow using native addons when using the permission model.
|
|
|
85
85
|
.It Fl -allow-child-process
|
|
86
86
|
Allow spawning process when using the permission model.
|
|
87
87
|
.
|
|
88
|
+
.It Fl -allow-inspector
|
|
89
|
+
Allow inspector access when using the permission model.
|
|
90
|
+
.
|
|
91
|
+
.It Fl -allow-net
|
|
92
|
+
Allow network access when using the permission model.
|
|
93
|
+
.
|
|
88
94
|
.It Fl -allow-wasi
|
|
89
95
|
Allow execution of WASI when using the permission model.
|
|
90
96
|
.
|
|
@@ -201,8 +207,8 @@ Enable experimental support for the EventSource Web API.
|
|
|
201
207
|
.It Fl -no-experimental-websocket
|
|
202
208
|
Disable experimental support for the WebSocket API.
|
|
203
209
|
.
|
|
204
|
-
.It Fl -
|
|
205
|
-
|
|
210
|
+
.It Fl -no-webstorage
|
|
211
|
+
Disable webstorage.
|
|
206
212
|
.
|
|
207
213
|
.It Fl -no-experimental-repl-await
|
|
208
214
|
Disable top-level await keyword support in REPL.
|
|
@@ -333,7 +339,7 @@ The file used to store localStorage data.
|
|
|
333
339
|
Specify the maximum size of HTTP headers in bytes. Defaults to 16 KiB.
|
|
334
340
|
.
|
|
335
341
|
.It Fl -max-old-space-size-percentage Ns = Ns Ar percentage
|
|
336
|
-
Sets the
|
|
342
|
+
Sets the maximum memory size of V8's old memory section as a percentage of available system memory.
|
|
337
343
|
This flag takes precedence over
|
|
338
344
|
.Fl -max-old-space-size
|
|
339
345
|
when both are specified.
|
|
@@ -341,6 +347,10 @@ The
|
|
|
341
347
|
.Ar percentage
|
|
342
348
|
parameter must be a number greater than 0 and up to 100, representing the percentage
|
|
343
349
|
of available system memory to allocate to the V8 heap.
|
|
350
|
+
.Pp
|
|
351
|
+
Note: This flag utilizes
|
|
352
|
+
.Fl -max-old-space-size ,
|
|
353
|
+
which may be unreliable on 32-bit platforms due to integer overflow issues.
|
|
344
354
|
.
|
|
345
355
|
.It Fl -napi-modules
|
|
346
356
|
This option is a no-op.
|
|
@@ -656,7 +666,7 @@ This will turn off watching of required or imported modules, even when used in c
|
|
|
656
666
|
Customizes the signal sent to the process on watch mode restarts.
|
|
657
667
|
.
|
|
658
668
|
.It Fl -zero-fill-buffers
|
|
659
|
-
Automatically zero-fills all newly allocated Buffer
|
|
669
|
+
Automatically zero-fills all newly allocated Buffer instances.
|
|
660
670
|
.
|
|
661
671
|
.It Fl c , Fl -check
|
|
662
672
|
Check the script's syntax without executing it.
|
|
@@ -719,6 +729,13 @@ Enable the
|
|
|
719
729
|
.Sy module compile cache
|
|
720
730
|
for the Node.js instance.
|
|
721
731
|
.
|
|
732
|
+
.It Ev NODE_COMPILE_CACHE_PORTABLE
|
|
733
|
+
When set to '1' or 'true', the
|
|
734
|
+
.Sy module compile cache
|
|
735
|
+
will be hit as long as the location of the modules relative to the cache directory remain
|
|
736
|
+
consistent. This can be used in conjunction with .Ev NODE_COMPILE_CACHE
|
|
737
|
+
to enable portable on-disk caching.
|
|
738
|
+
.
|
|
722
739
|
.It Ev NODE_DEBUG Ar modules...
|
|
723
740
|
Comma-separated list of core modules that should print debug information.
|
|
724
741
|
.
|