node-linux-arm64 24.10.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.
Files changed (47) hide show
  1. package/CHANGELOG.md +177 -1818
  2. package/bin/node +0 -0
  3. package/include/node/common.gypi +1 -13
  4. package/include/node/config.gypi +10 -9
  5. package/include/node/cppgc/allocation.h +3 -3
  6. package/include/node/cppgc/cross-thread-persistent.h +25 -29
  7. package/include/node/cppgc/internal/finalizer-trait.h +1 -1
  8. package/include/node/cppgc/internal/gc-info.h +3 -3
  9. package/include/node/cppgc/internal/logging.h +2 -2
  10. package/include/node/cppgc/internal/name-trait.h +1 -1
  11. package/include/node/cppgc/internal/pointer-policies.h +3 -3
  12. package/include/node/cppgc/member.h +10 -4
  13. package/include/node/cppgc/persistent.h +14 -15
  14. package/include/node/cppgc/platform.h +1 -1
  15. package/include/node/cppgc/trace-trait.h +1 -2
  16. package/include/node/cppgc/visitor.h +14 -9
  17. package/include/node/js_native_api.h +12 -0
  18. package/include/node/node.h +34 -78
  19. package/include/node/node_version.h +3 -3
  20. package/include/node/v8-array-buffer.h +1 -1
  21. package/include/node/v8-callbacks.h +3 -4
  22. package/include/node/v8-context.h +15 -5
  23. package/include/node/v8-data.h +5 -0
  24. package/include/node/v8-debug.h +11 -0
  25. package/include/node/v8-function-callback.h +26 -26
  26. package/include/node/v8-internal.h +136 -36
  27. package/include/node/v8-isolate.h +75 -16
  28. package/include/node/v8-json.h +8 -1
  29. package/include/node/v8-local-handle.h +112 -13
  30. package/include/node/v8-maybe.h +34 -10
  31. package/include/node/v8-memory-span.h +9 -4
  32. package/include/node/v8-message.h +3 -0
  33. package/include/node/v8-object.h +87 -24
  34. package/include/node/v8-persistent-handle.h +4 -4
  35. package/include/node/v8-platform.h +92 -28
  36. package/include/node/v8-primitive.h +22 -9
  37. package/include/node/v8-profiler.h +4 -0
  38. package/include/node/v8-sandbox.h +16 -0
  39. package/include/node/v8-source-location.h +19 -26
  40. package/include/node/v8-template.h +37 -15
  41. package/include/node/v8-traced-handle.h +6 -6
  42. package/include/node/v8-unwinder.h +13 -0
  43. package/include/node/v8-version.h +4 -4
  44. package/include/node/v8config.h +65 -5
  45. package/package.json +5 -1
  46. package/share/doc/node/gdbinit +221 -4
  47. package/share/man/man1/node.1 +21 -4
package/bin/node CHANGED
Binary file
@@ -38,7 +38,7 @@
38
38
 
39
39
  # Reset this number to 0 on major V8 upgrades.
40
40
  # Increment by one for each non-official patch applied to deps/v8.
41
- 'v8_embedder_string': '-node.28',
41
+ 'v8_embedder_string': '-node.10',
42
42
 
43
43
  ##### V8 defaults for Node.js #####
44
44
 
@@ -78,14 +78,11 @@
78
78
  'v8_win64_unwinding_info': 1,
79
79
 
80
80
  # Variables controlling external defines exposed in public headers.
81
- 'v8_enable_conservative_stack_scanning%': 0,
82
- 'v8_enable_direct_local%': 0,
83
81
  'v8_enable_map_packing%': 0,
84
82
  'v8_enable_pointer_compression_shared_cage%': 0,
85
83
  'v8_enable_external_code_space%': 0,
86
84
  'v8_enable_sandbox%': 0,
87
85
  'v8_enable_v8_checks%': 0,
88
- 'v8_enable_zone_compression%': 0,
89
86
  'v8_use_perfetto': 0,
90
87
  'tsan%': 0,
91
88
 
@@ -455,9 +452,6 @@
455
452
  ['v8_enable_pointer_compression == 1 or v8_enable_31bit_smis_on_64bit_arch == 1', {
456
453
  'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH'],
457
454
  }],
458
- ['v8_enable_zone_compression == 1', {
459
- 'defines': ['V8_COMPRESS_ZONES',],
460
- }],
461
455
  ['v8_enable_sandbox == 1', {
462
456
  'defines': ['V8_ENABLE_SANDBOX',],
463
457
  }],
@@ -479,12 +473,6 @@
479
473
  ['tsan == 1', {
480
474
  'defines': ['V8_IS_TSAN',],
481
475
  }],
482
- ['v8_enable_conservative_stack_scanning == 1', {
483
- 'defines': ['V8_ENABLE_CONSERVATIVE_STACK_SCANNING',],
484
- }],
485
- ['v8_enable_direct_local == 1', {
486
- 'defines': ['V8_ENABLE_DIRECT_LOCAL',],
487
- }],
488
476
  ['OS == "win"', {
489
477
  'defines': [
490
478
  'WIN32',
@@ -8,7 +8,7 @@
8
8
  'libraries': []},
9
9
  'variables': { 'arm_fpu': 'neon',
10
10
  'asan': 0,
11
- 'clang': 0,
11
+ 'clang': 1,
12
12
  'control_flow_guard': 'false',
13
13
  'coverage': 'false',
14
14
  'dcheck_always_on': 0,
@@ -19,7 +19,6 @@
19
19
  'enable_pgo_use': 'false',
20
20
  'error_on_warn': 'false',
21
21
  'force_dynamic_crt': 0,
22
- 'gas_version': '2.38',
23
22
  'host_arch': 'arm64',
24
23
  'icu_data_in': '../../deps/icu-tmp/icudt77l.dat',
25
24
  'icu_endianness': 'l',
@@ -28,7 +27,7 @@
28
27
  'icu_small': 'false',
29
28
  'icu_ver_major': '77',
30
29
  'libdir': 'lib',
31
- 'llvm_version': '0.0',
30
+ 'llvm_version': '19.1',
32
31
  'napi_build_version': '10',
33
32
  'node_builtin_shareable_builtins': [ 'deps/cjs-module-lexer/lexer.js',
34
33
  'deps/cjs-module-lexer/dist/lexer.js',
@@ -60,6 +59,7 @@
60
59
  'test/cctest/test_platform.cc',
61
60
  'test/cctest/test_quic_cid.cc',
62
61
  'test/cctest/test_quic_error.cc',
62
+ 'test/cctest/test_quic_preferredaddress.cc',
63
63
  'test/cctest/test_quic_tokens.cc',
64
64
  'test/cctest/test_report.cc',
65
65
  'test/cctest/test_sockaddr.cc',
@@ -72,7 +72,7 @@
72
72
  'node_enable_v8_vtunejit': 'false',
73
73
  'node_enable_v8windbg': 'false',
74
74
  'node_fipsinstall': 'false',
75
- 'node_install_corepack': 'true',
75
+ 'node_install_corepack': 'false',
76
76
  'node_install_npm': 'true',
77
77
  'node_library_files': [ 'lib/_http_agent.js',
78
78
  'lib/_http_client.js',
@@ -113,7 +113,6 @@
113
113
  'lib/internal/abort_controller.js',
114
114
  'lib/internal/assert.js',
115
115
  'lib/internal/assert/assertion_error.js',
116
- 'lib/internal/assert/calltracker.js',
117
116
  'lib/internal/assert/myers_diff.js',
118
117
  'lib/internal/assert/utils.js',
119
118
  'lib/internal/async_context_frame.js',
@@ -294,6 +293,7 @@
294
293
  'lib/internal/readline/utils.js',
295
294
  'lib/internal/repl.js',
296
295
  'lib/internal/repl/await.js',
296
+ 'lib/internal/repl/completion.js',
297
297
  'lib/internal/repl/history.js',
298
298
  'lib/internal/repl/utils.js',
299
299
  'lib/internal/socket_list.js',
@@ -344,7 +344,9 @@
344
344
  'lib/internal/test_runner/tests_stream.js',
345
345
  'lib/internal/test_runner/utils.js',
346
346
  'lib/internal/timers.js',
347
+ 'lib/internal/tls/common.js',
347
348
  'lib/internal/tls/secure-context.js',
349
+ 'lib/internal/tls/wrap.js',
348
350
  'lib/internal/trace_events_async_hooks.js',
349
351
  'lib/internal/tty.js',
350
352
  'lib/internal/url.js',
@@ -421,10 +423,9 @@
421
423
  'lib/wasi.js',
422
424
  'lib/worker_threads.js',
423
425
  'lib/zlib.js'],
424
- 'node_module_version': 137,
426
+ 'node_module_version': 141,
425
427
  'node_no_browser_globals': 'false',
426
428
  'node_prefix': '/',
427
- 'node_quic': 'false',
428
429
  'node_release_urlbase': 'https://nodejs.org/download/release/',
429
430
  'node_section_ordering_info': '',
430
431
  'node_shared': 'false',
@@ -456,9 +457,9 @@
456
457
  'node_without_node_options': 'false',
457
458
  'node_write_snapshot_as_array_literals': 'false',
458
459
  'openssl_is_fips': 'false',
459
- 'openssl_quic': 'false',
460
+ 'openssl_version': 810549327,
460
461
  'ossfuzz': 'false',
461
- 'shlib_suffix': 'so.137',
462
+ 'shlib_suffix': 'so.141',
462
463
  'single_executable_application': 'true',
463
464
  'suppress_all_error_on_warn': 'false',
464
465
  'target_arch': 'arm64',
@@ -71,7 +71,7 @@ class MakeGarbageCollectedTraitInternal {
71
71
  template <typename GCInfoType, typename CustomSpace, size_t alignment>
72
72
  struct AllocationDispatcher final {
73
73
  static void* Invoke(AllocationHandle& handle, size_t size) {
74
- static_assert(std::is_base_of<CustomSpaceBase, CustomSpace>::value,
74
+ static_assert(std::is_base_of_v<CustomSpaceBase, CustomSpace>,
75
75
  "Custom space must inherit from CustomSpaceBase.");
76
76
  static_assert(
77
77
  !CustomSpace::kSupportsCompaction,
@@ -111,7 +111,7 @@ class MakeGarbageCollectedTraitInternal {
111
111
  api_constants::kDefaultAlignment>
112
112
  final {
113
113
  static void* Invoke(AllocationHandle& handle, size_t size) {
114
- static_assert(std::is_base_of<CustomSpaceBase, CustomSpace>::value,
114
+ static_assert(std::is_base_of_v<CustomSpaceBase, CustomSpace>,
115
115
  "Custom space must inherit from CustomSpaceBase.");
116
116
  return MakeGarbageCollectedTraitInternal::Allocate(
117
117
  handle, size, internal::GCInfoTrait<GCInfoType>::Index(),
@@ -164,7 +164,7 @@ class MakeGarbageCollectedTraitBase
164
164
  */
165
165
  V8_INLINE static void* Allocate(AllocationHandle& handle, size_t size) {
166
166
  static_assert(
167
- std::is_base_of<typename T::ParentMostGarbageCollectedType, T>::value,
167
+ std::is_base_of_v<typename T::ParentMostGarbageCollectedType, T>,
168
168
  "U of GarbageCollected<U> must be a base of T. Check "
169
169
  "GarbageCollected<T> base class inheritance.");
170
170
  static constexpr size_t kWantedAlignment =
@@ -102,20 +102,19 @@ class BasicCrossThreadPersistent final : public CrossThreadPersistentBase,
102
102
  // node.
103
103
  }
104
104
 
105
- BasicCrossThreadPersistent(
106
- const SourceLocation& loc = SourceLocation::Current())
105
+ BasicCrossThreadPersistent(SourceLocation loc = SourceLocation::Current())
107
106
  : LocationPolicy(loc) {}
108
107
 
109
- BasicCrossThreadPersistent(
110
- std::nullptr_t, const SourceLocation& loc = SourceLocation::Current())
108
+ BasicCrossThreadPersistent(std::nullptr_t,
109
+ SourceLocation loc = SourceLocation::Current())
111
110
  : LocationPolicy(loc) {}
112
111
 
113
- BasicCrossThreadPersistent(
114
- SentinelPointer s, const SourceLocation& loc = SourceLocation::Current())
112
+ BasicCrossThreadPersistent(SentinelPointer s,
113
+ SourceLocation loc = SourceLocation::Current())
115
114
  : CrossThreadPersistentBase(s), LocationPolicy(loc) {}
116
115
 
117
- BasicCrossThreadPersistent(
118
- T* raw, const SourceLocation& loc = SourceLocation::Current())
116
+ BasicCrossThreadPersistent(T* raw,
117
+ SourceLocation loc = SourceLocation::Current())
119
118
  : CrossThreadPersistentBase(raw), LocationPolicy(loc) {
120
119
  if (!IsValid(raw)) return;
121
120
  PersistentRegionLock guard;
@@ -132,9 +131,8 @@ class BasicCrossThreadPersistent final : public CrossThreadPersistentBase,
132
131
  friend class BasicCrossThreadPersistent;
133
132
  };
134
133
 
135
- BasicCrossThreadPersistent(
136
- UnsafeCtorTag, T* raw,
137
- const SourceLocation& loc = SourceLocation::Current())
134
+ BasicCrossThreadPersistent(UnsafeCtorTag, T* raw,
135
+ SourceLocation loc = SourceLocation::Current())
138
136
  : CrossThreadPersistentBase(raw), LocationPolicy(loc) {
139
137
  if (!IsValid(raw)) return;
140
138
  CrossThreadPersistentRegion& region = this->GetPersistentRegion(raw);
@@ -142,24 +140,23 @@ class BasicCrossThreadPersistent final : public CrossThreadPersistentBase,
142
140
  this->CheckPointer(raw);
143
141
  }
144
142
 
145
- BasicCrossThreadPersistent(
146
- T& raw, const SourceLocation& loc = SourceLocation::Current())
143
+ BasicCrossThreadPersistent(T& raw,
144
+ SourceLocation loc = SourceLocation::Current())
147
145
  : BasicCrossThreadPersistent(&raw, loc) {}
148
146
 
149
147
  template <typename U, typename MemberBarrierPolicy,
150
148
  typename MemberWeaknessTag, typename MemberCheckingPolicy,
151
149
  typename MemberStorageType,
152
- typename = std::enable_if_t<std::is_base_of<T, U>::value>>
150
+ typename = std::enable_if_t<std::is_base_of_v<T, U>>>
153
151
  BasicCrossThreadPersistent(
154
152
  internal::BasicMember<U, MemberBarrierPolicy, MemberWeaknessTag,
155
153
  MemberCheckingPolicy, MemberStorageType>
156
154
  member,
157
- const SourceLocation& loc = SourceLocation::Current())
155
+ SourceLocation loc = SourceLocation::Current())
158
156
  : BasicCrossThreadPersistent(member.Get(), loc) {}
159
157
 
160
- BasicCrossThreadPersistent(
161
- const BasicCrossThreadPersistent& other,
162
- const SourceLocation& loc = SourceLocation::Current())
158
+ BasicCrossThreadPersistent(const BasicCrossThreadPersistent& other,
159
+ SourceLocation loc = SourceLocation::Current())
163
160
  : BasicCrossThreadPersistent(loc) {
164
161
  // Invoke operator=.
165
162
  *this = other;
@@ -168,19 +165,18 @@ class BasicCrossThreadPersistent final : public CrossThreadPersistentBase,
168
165
  // Heterogeneous ctor.
169
166
  template <typename U, typename OtherWeaknessPolicy,
170
167
  typename OtherLocationPolicy, typename OtherCheckingPolicy,
171
- typename = std::enable_if_t<std::is_base_of<T, U>::value>>
172
- BasicCrossThreadPersistent(
173
- const BasicCrossThreadPersistent<U, OtherWeaknessPolicy,
174
- OtherLocationPolicy,
175
- OtherCheckingPolicy>& other,
176
- const SourceLocation& loc = SourceLocation::Current())
168
+ typename = std::enable_if_t<std::is_base_of_v<T, U>>>
169
+ BasicCrossThreadPersistent(const BasicCrossThreadPersistent<
170
+ U, OtherWeaknessPolicy, OtherLocationPolicy,
171
+ OtherCheckingPolicy>& other,
172
+ SourceLocation loc = SourceLocation::Current())
177
173
  : BasicCrossThreadPersistent(loc) {
178
174
  *this = other;
179
175
  }
180
176
 
181
177
  BasicCrossThreadPersistent(
182
178
  BasicCrossThreadPersistent&& other,
183
- const SourceLocation& loc = SourceLocation::Current()) noexcept {
179
+ SourceLocation loc = SourceLocation::Current()) noexcept {
184
180
  // Invoke operator=.
185
181
  *this = std::move(other);
186
182
  }
@@ -194,7 +190,7 @@ class BasicCrossThreadPersistent final : public CrossThreadPersistentBase,
194
190
 
195
191
  template <typename U, typename OtherWeaknessPolicy,
196
192
  typename OtherLocationPolicy, typename OtherCheckingPolicy,
197
- typename = std::enable_if_t<std::is_base_of<T, U>::value>>
193
+ typename = std::enable_if_t<std::is_base_of_v<T, U>>>
198
194
  BasicCrossThreadPersistent& operator=(
199
195
  const BasicCrossThreadPersistent<U, OtherWeaknessPolicy,
200
196
  OtherLocationPolicy,
@@ -232,7 +228,7 @@ class BasicCrossThreadPersistent final : public CrossThreadPersistentBase,
232
228
  template <typename U, typename MemberBarrierPolicy,
233
229
  typename MemberWeaknessTag, typename MemberCheckingPolicy,
234
230
  typename MemberStorageType,
235
- typename = std::enable_if_t<std::is_base_of<T, U>::value>>
231
+ typename = std::enable_if_t<std::is_base_of_v<T, U>>>
236
232
  BasicCrossThreadPersistent& operator=(
237
233
  internal::BasicMember<U, MemberBarrierPolicy, MemberWeaknessTag,
238
234
  MemberCheckingPolicy, MemberStorageType>
@@ -338,8 +334,8 @@ class BasicCrossThreadPersistent final : public CrossThreadPersistentBase,
338
334
  }
339
335
 
340
336
  template <typename U = T,
341
- typename = typename std::enable_if<!BasicCrossThreadPersistent<
342
- U, WeaknessPolicy>::IsStrongPersistent::value>::type>
337
+ typename = std::enable_if_t<!BasicCrossThreadPersistent<
338
+ U, WeaknessPolicy>::IsStrongPersistent::value>>
343
339
  BasicCrossThreadPersistent<U, internal::StrongCrossThreadPersistentPolicy>
344
340
  Lock() const {
345
341
  return BasicCrossThreadPersistent<
@@ -70,7 +70,7 @@ struct FinalizerTrait {
70
70
  // - a destructor.
71
71
  static constexpr bool kNonTrivialFinalizer =
72
72
  internal::HasFinalizeGarbageCollectedObject<T>::value ||
73
- !std::is_trivially_destructible<typename std::remove_cv<T>::type>::value;
73
+ !std::is_trivially_destructible_v<std::remove_cv_t<T>>;
74
74
 
75
75
  static void Finalize(void* obj) {
76
76
  internal::FinalizerTraitImpl<T, kNonTrivialFinalizer>::Finalize(obj);
@@ -108,10 +108,10 @@ struct GCInfoTrait final {
108
108
  template <typename T, typename ParentMostGarbageCollectedType>
109
109
  struct GCInfoFolding final {
110
110
  static constexpr bool kHasVirtualDestructorAtBase =
111
- std::has_virtual_destructor<ParentMostGarbageCollectedType>::value;
111
+ std::has_virtual_destructor_v<ParentMostGarbageCollectedType>;
112
112
  static constexpr bool kBothTypesAreTriviallyDestructible =
113
- std::is_trivially_destructible<ParentMostGarbageCollectedType>::value &&
114
- std::is_trivially_destructible<T>::value;
113
+ std::is_trivially_destructible_v<ParentMostGarbageCollectedType> &&
114
+ std::is_trivially_destructible_v<T>;
115
115
  static constexpr bool kHasCustomFinalizerDispatchAtBase =
116
116
  internal::HasFinalizeGarbageCollectedObject<
117
117
  ParentMostGarbageCollectedType>::value;
@@ -12,9 +12,9 @@ namespace cppgc {
12
12
  namespace internal {
13
13
 
14
14
  void V8_EXPORT DCheckImpl(const char*,
15
- const SourceLocation& = SourceLocation::Current());
15
+ SourceLocation = SourceLocation::Current());
16
16
  [[noreturn]] void V8_EXPORT
17
- FatalImpl(const char*, const SourceLocation& = SourceLocation::Current());
17
+ FatalImpl(const char*, SourceLocation = SourceLocation::Current());
18
18
 
19
19
  // Used to ignore -Wunused-variable.
20
20
  template <typename>
@@ -80,7 +80,7 @@ class NameTrait final : public NameTraitBase {
80
80
  #elif CPPGC_SUPPORTS_OBJECT_NAMES
81
81
  return true;
82
82
  #else // !CPPGC_SUPPORTS_OBJECT_NAMES
83
- return std::is_base_of<NameProvider, T>::value;
83
+ return std::is_base_of_v<NameProvider, T>;
84
84
  #endif // !CPPGC_SUPPORTS_OBJECT_NAMES
85
85
  }
86
86
 
@@ -203,11 +203,11 @@ using DefaultCrossThreadPersistentCheckingPolicy = DisabledCheckingPolicy;
203
203
 
204
204
  class KeepLocationPolicy {
205
205
  public:
206
- constexpr const SourceLocation& Location() const { return location_; }
206
+ constexpr SourceLocation Location() const { return location_; }
207
207
 
208
208
  protected:
209
209
  constexpr KeepLocationPolicy() = default;
210
- constexpr explicit KeepLocationPolicy(const SourceLocation& location)
210
+ constexpr explicit KeepLocationPolicy(SourceLocation location)
211
211
  : location_(location) {}
212
212
 
213
213
  // KeepLocationPolicy must not copy underlying source locations.
@@ -228,7 +228,7 @@ class IgnoreLocationPolicy {
228
228
 
229
229
  protected:
230
230
  constexpr IgnoreLocationPolicy() = default;
231
- constexpr explicit IgnoreLocationPolicy(const SourceLocation&) {}
231
+ constexpr explicit IgnoreLocationPolicy(SourceLocation) {}
232
232
  };
233
233
 
234
234
  #if CPPGC_SUPPORTS_OBJECT_NAMES
@@ -20,6 +20,8 @@ namespace cppgc {
20
20
 
21
21
  namespace subtle {
22
22
  class HeapConsistency;
23
+ template <typename, typename, typename>
24
+ class TaggedUncompressedMember;
23
25
  } // namespace subtle
24
26
 
25
27
  class Visitor;
@@ -163,7 +165,7 @@ class V8_TRIVIAL_ABI BasicMember final : private MemberBase<StorageType>,
163
165
  template <typename U, typename PersistentWeaknessPolicy,
164
166
  typename PersistentLocationPolicy,
165
167
  typename PersistentCheckingPolicy,
166
- typename = std::enable_if_t<std::is_base_of<T, U>::value>>
168
+ typename = std::enable_if_t<std::is_base_of_v<T, U>>>
167
169
  V8_INLINE BasicMember(const BasicPersistent<U, PersistentWeaknessPolicy,
168
170
  PersistentLocationPolicy,
169
171
  PersistentCheckingPolicy>& p)
@@ -219,7 +221,7 @@ class V8_TRIVIAL_ABI BasicMember final : private MemberBase<StorageType>,
219
221
  template <typename U, typename PersistentWeaknessPolicy,
220
222
  typename PersistentLocationPolicy,
221
223
  typename PersistentCheckingPolicy,
222
- typename = std::enable_if_t<std::is_base_of<T, U>::value>>
224
+ typename = std::enable_if_t<std::is_base_of_v<T, U>>>
223
225
  V8_INLINE BasicMember& operator=(
224
226
  const BasicPersistent<U, PersistentWeaknessPolicy,
225
227
  PersistentLocationPolicy, PersistentCheckingPolicy>&
@@ -296,8 +298,10 @@ class V8_TRIVIAL_ABI BasicMember final : private MemberBase<StorageType>,
296
298
  return *this;
297
299
  }
298
300
 
299
- V8_INLINE const T* GetRawAtomic() const {
300
- return static_cast<const T*>(Base::GetRawAtomic());
301
+ V8_INLINE const void* GetRawAtomic() const { return Base::GetRawAtomic(); }
302
+
303
+ V8_INLINE const T* GetAtomic() const {
304
+ return static_cast<const T*>(GetRawAtomic());
301
305
  }
302
306
 
303
307
  V8_INLINE void InitializingWriteBarrier(T* value) const {
@@ -328,6 +332,8 @@ class V8_TRIVIAL_ABI BasicMember final : private MemberBase<StorageType>,
328
332
  V8_INLINE T* GetFromGC() const { return Get(); }
329
333
 
330
334
  friend class cppgc::subtle::HeapConsistency;
335
+ template <typename, typename, typename>
336
+ friend class cppgc::subtle::TaggedUncompressedMember;
331
337
  friend class cppgc::Visitor;
332
338
  template <typename U>
333
339
  friend struct cppgc::TraceTrait;
@@ -58,20 +58,20 @@ class BasicPersistent final : public PersistentBase,
58
58
 
59
59
  // Null-state/sentinel constructors.
60
60
  BasicPersistent( // NOLINT
61
- const SourceLocation& loc = SourceLocation::Current())
61
+ SourceLocation loc = SourceLocation::Current())
62
62
  : LocationPolicy(loc) {}
63
63
 
64
64
  BasicPersistent(std::nullptr_t, // NOLINT
65
- const SourceLocation& loc = SourceLocation::Current())
65
+ SourceLocation loc = SourceLocation::Current())
66
66
  : LocationPolicy(loc) {}
67
67
 
68
68
  BasicPersistent( // NOLINT
69
- SentinelPointer s, const SourceLocation& loc = SourceLocation::Current())
69
+ SentinelPointer s, SourceLocation loc = SourceLocation::Current())
70
70
  : PersistentBase(s), LocationPolicy(loc) {}
71
71
 
72
72
  // Raw value constructors.
73
73
  BasicPersistent(T* raw, // NOLINT
74
- const SourceLocation& loc = SourceLocation::Current())
74
+ SourceLocation loc = SourceLocation::Current())
75
75
  : PersistentBase(raw), LocationPolicy(loc) {
76
76
  if (!IsValid()) return;
77
77
  SetNode(WeaknessPolicy::GetPersistentRegion(GetValue())
@@ -80,30 +80,29 @@ class BasicPersistent final : public PersistentBase,
80
80
  }
81
81
 
82
82
  BasicPersistent(T& raw, // NOLINT
83
- const SourceLocation& loc = SourceLocation::Current())
83
+ SourceLocation loc = SourceLocation::Current())
84
84
  : BasicPersistent(&raw, loc) {}
85
85
 
86
86
  // Copy ctor.
87
87
  BasicPersistent(const BasicPersistent& other,
88
- const SourceLocation& loc = SourceLocation::Current())
88
+ SourceLocation loc = SourceLocation::Current())
89
89
  : BasicPersistent(other.Get(), loc) {}
90
90
 
91
91
  // Heterogeneous ctor.
92
92
  template <typename U, typename OtherWeaknessPolicy,
93
93
  typename OtherLocationPolicy, typename OtherCheckingPolicy,
94
- typename = std::enable_if_t<std::is_base_of<T, U>::value>>
94
+ typename = std::enable_if_t<std::is_base_of_v<T, U>>>
95
95
  // NOLINTNEXTLINE
96
96
  BasicPersistent(
97
97
  const BasicPersistent<U, OtherWeaknessPolicy, OtherLocationPolicy,
98
98
  OtherCheckingPolicy>& other,
99
- const SourceLocation& loc = SourceLocation::Current())
99
+ SourceLocation loc = SourceLocation::Current())
100
100
  : BasicPersistent(other.Get(), loc) {}
101
101
 
102
102
  // Move ctor. The heterogeneous move ctor is not supported since e.g.
103
103
  // persistent can't reuse persistent node from weak persistent.
104
- BasicPersistent(
105
- BasicPersistent&& other,
106
- const SourceLocation& loc = SourceLocation::Current()) noexcept
104
+ BasicPersistent(BasicPersistent&& other,
105
+ SourceLocation loc = SourceLocation::Current()) noexcept
107
106
  : PersistentBase(std::move(other)), LocationPolicy(std::move(other)) {
108
107
  if (!IsValid()) return;
109
108
  GetNode()->UpdateOwner(this);
@@ -116,12 +115,12 @@ class BasicPersistent final : public PersistentBase,
116
115
  template <typename U, typename MemberBarrierPolicy,
117
116
  typename MemberWeaknessTag, typename MemberCheckingPolicy,
118
117
  typename MemberStorageType,
119
- typename = std::enable_if_t<std::is_base_of<T, U>::value>>
118
+ typename = std::enable_if_t<std::is_base_of_v<T, U>>>
120
119
  // NOLINTNEXTLINE
121
120
  BasicPersistent(const internal::BasicMember<
122
121
  U, MemberBarrierPolicy, MemberWeaknessTag,
123
122
  MemberCheckingPolicy, MemberStorageType>& member,
124
- const SourceLocation& loc = SourceLocation::Current())
123
+ SourceLocation loc = SourceLocation::Current())
125
124
  : BasicPersistent(member.Get(), loc) {}
126
125
 
127
126
  ~BasicPersistent() { Clear(); }
@@ -133,7 +132,7 @@ class BasicPersistent final : public PersistentBase,
133
132
 
134
133
  template <typename U, typename OtherWeaknessPolicy,
135
134
  typename OtherLocationPolicy, typename OtherCheckingPolicy,
136
- typename = std::enable_if_t<std::is_base_of<T, U>::value>>
135
+ typename = std::enable_if_t<std::is_base_of_v<T, U>>>
137
136
  BasicPersistent& operator=(
138
137
  const BasicPersistent<U, OtherWeaknessPolicy, OtherLocationPolicy,
139
138
  OtherCheckingPolicy>& other) {
@@ -158,7 +157,7 @@ class BasicPersistent final : public PersistentBase,
158
157
  template <typename U, typename MemberBarrierPolicy,
159
158
  typename MemberWeaknessTag, typename MemberCheckingPolicy,
160
159
  typename MemberStorageType,
161
- typename = std::enable_if_t<std::is_base_of<T, U>::value>>
160
+ typename = std::enable_if_t<std::is_base_of_v<T, U>>>
162
161
  BasicPersistent& operator=(
163
162
  const internal::BasicMember<U, MemberBarrierPolicy, MemberWeaknessTag,
164
163
  MemberCheckingPolicy, MemberStorageType>&
@@ -165,7 +165,7 @@ V8_EXPORT void ShutdownProcess();
165
165
  namespace internal {
166
166
 
167
167
  V8_EXPORT void Fatal(const std::string& reason = std::string(),
168
- const SourceLocation& = SourceLocation::Current());
168
+ SourceLocation = SourceLocation::Current());
169
169
 
170
170
  } // namespace internal
171
171
 
@@ -23,8 +23,7 @@ using TraceRootCallback = void (*)(RootVisitor&, const void* object);
23
23
  // Implementation of the default TraceTrait handling GarbageCollected and
24
24
  // GarbageCollectedMixin.
25
25
  template <typename T,
26
- bool =
27
- IsGarbageCollectedMixinTypeV<typename std::remove_const<T>::type>>
26
+ bool = IsGarbageCollectedMixinTypeV<std::remove_const_t<T>>>
28
27
  struct TraceTraitImpl;
29
28
 
30
29
  } // namespace internal
@@ -91,7 +91,7 @@ class V8_EXPORT Visitor {
91
91
  */
92
92
  template <typename T>
93
93
  void Trace(const Member<T>& member) {
94
- const T* value = member.GetRawAtomic();
94
+ const T* value = member.GetAtomic();
95
95
  CPPGC_DCHECK(value != kSentinelPointer);
96
96
  TraceImpl(value);
97
97
  }
@@ -109,7 +109,7 @@ class V8_EXPORT Visitor {
109
109
  static_assert(!internal::IsAllocatedOnCompactableSpace<T>::value,
110
110
  "Weak references to compactable objects are not allowed");
111
111
 
112
- const T* value = weak_member.GetRawAtomic();
112
+ const T* value = weak_member.GetAtomic();
113
113
 
114
114
  // Bailout assumes that WeakMember emits write barrier.
115
115
  if (!value) {
@@ -129,7 +129,7 @@ class V8_EXPORT Visitor {
129
129
  */
130
130
  template <typename T>
131
131
  void Trace(const subtle::UncompressedMember<T>& member) {
132
- const T* value = member.GetRawAtomic();
132
+ const T* value = member.GetAtomic();
133
133
  CPPGC_DCHECK(value != kSentinelPointer);
134
134
  TraceImpl(value);
135
135
  }
@@ -232,12 +232,12 @@ class V8_EXPORT Visitor {
232
232
  template <typename KeyType, typename ValueType>
233
233
  void TraceEphemeron(const WeakMember<KeyType>& weak_member_key,
234
234
  const Member<ValueType>* member_value) {
235
- const KeyType* key = weak_member_key.GetRawAtomic();
235
+ const KeyType* key = weak_member_key.GetAtomic();
236
236
  if (!key) return;
237
237
 
238
238
  // `value` must always be non-null.
239
239
  CPPGC_DCHECK(member_value);
240
- const ValueType* value = member_value->GetRawAtomic();
240
+ const ValueType* value = member_value->GetAtomic();
241
241
  if (!value) return;
242
242
 
243
243
  // KeyType and ValueType may refer to GarbageCollectedMixin.
@@ -267,7 +267,7 @@ class V8_EXPORT Visitor {
267
267
  const ValueType* value) {
268
268
  static_assert(!IsGarbageCollectedOrMixinTypeV<ValueType>,
269
269
  "garbage-collected types must use WeakMember and Member");
270
- const KeyType* key = weak_member_key.GetRawAtomic();
270
+ const KeyType* key = weak_member_key.GetAtomic();
271
271
  if (!key) return;
272
272
 
273
273
  // `value` must always be non-null.
@@ -293,7 +293,7 @@ class V8_EXPORT Visitor {
293
293
  */
294
294
  template <typename T>
295
295
  void TraceStrongly(const WeakMember<T>& weak_member) {
296
- const T* value = weak_member.GetRawAtomic();
296
+ const T* value = weak_member.GetAtomic();
297
297
  CPPGC_DCHECK(value != kSentinelPointer);
298
298
  TraceImpl(value);
299
299
  }
@@ -369,6 +369,11 @@ class V8_EXPORT Visitor {
369
369
  return false;
370
370
  }
371
371
 
372
+ /**
373
+ * Checks whether the visitor is running concurrently to the mutator or not.
374
+ */
375
+ virtual bool IsConcurrent() const { return false; }
376
+
372
377
  protected:
373
378
  virtual void Visit(const void* self, TraceDescriptor) {}
374
379
  virtual void VisitWeak(const void* self, TraceDescriptor, WeakCallback,
@@ -497,9 +502,9 @@ class V8_EXPORT RootVisitor {
497
502
  }
498
503
 
499
504
  protected:
500
- virtual void VisitRoot(const void*, TraceDescriptor, const SourceLocation&) {}
505
+ virtual void VisitRoot(const void*, TraceDescriptor, SourceLocation) {}
501
506
  virtual void VisitWeakRoot(const void* self, TraceDescriptor, WeakCallback,
502
- const void* weak_root, const SourceLocation&) {}
507
+ const void* weak_root, SourceLocation) {}
503
508
 
504
509
  private:
505
510
  template <typename AnyPersistentType>
@@ -21,6 +21,18 @@
21
21
  #endif
22
22
  #endif
23
23
 
24
+ #if defined(NAPI_EXPERIMENTAL) && \
25
+ !defined(NODE_API_EXPERIMENTAL_NO_WARNING) && \
26
+ !defined(NODE_WANT_INTERNALS)
27
+ #ifdef _MSC_VER
28
+ #pragma message("NAPI_EXPERIMENTAL is enabled. " \
29
+ "Experimental features may be unstable.")
30
+ #else
31
+ #warning "NAPI_EXPERIMENTAL is enabled. " \
32
+ "Experimental features may be unstable."
33
+ #endif
34
+ #endif
35
+
24
36
  #include "js_native_api_types.h"
25
37
 
26
38
  // If you need __declspec(dllimport), either include <node_api.h> instead, or