node-aix-ppc64 20.8.0 → 21.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 (51) hide show
  1. package/CHANGELOG.md +237 -1609
  2. package/README.md +3 -3
  3. package/bin/node +0 -0
  4. package/include/node/common.gypi +3 -3
  5. package/include/node/config.gypi +5 -3
  6. package/include/node/cppgc/internal/api-constants.h +23 -4
  7. package/include/node/cppgc/internal/caged-heap-local-data.h +16 -6
  8. package/include/node/cppgc/internal/caged-heap.h +12 -5
  9. package/include/node/cppgc/internal/gc-info.h +82 -91
  10. package/include/node/cppgc/internal/member-storage.h +16 -8
  11. package/include/node/cppgc/member.h +25 -0
  12. package/include/node/cppgc/persistent.h +4 -0
  13. package/include/node/cppgc/platform.h +6 -1
  14. package/include/node/cppgc/sentinel-pointer.h +7 -0
  15. package/include/node/cppgc/source-location.h +2 -78
  16. package/include/node/cppgc/trace-trait.h +8 -0
  17. package/include/node/cppgc/visitor.h +82 -4
  18. package/include/node/js_native_api.h +11 -1
  19. package/include/node/libplatform/libplatform.h +7 -1
  20. package/include/node/node.exp +11803 -4870
  21. package/include/node/node.h +2 -0
  22. package/include/node/node_api.h +8 -7
  23. package/include/node/node_version.h +7 -6
  24. package/include/node/v8-callbacks.h +52 -8
  25. package/include/node/v8-context.h +10 -13
  26. package/include/node/v8-embedder-heap.h +12 -0
  27. package/include/node/v8-function-callback.h +11 -15
  28. package/include/node/v8-function.h +6 -0
  29. package/include/node/v8-handle-base.h +185 -0
  30. package/include/node/v8-internal.h +109 -77
  31. package/include/node/v8-isolate.h +130 -89
  32. package/include/node/v8-local-handle.h +134 -89
  33. package/include/node/v8-object.h +71 -69
  34. package/include/node/v8-persistent-handle.h +65 -89
  35. package/include/node/v8-platform.h +140 -9
  36. package/include/node/v8-primitive.h +12 -8
  37. package/include/node/v8-profiler.h +16 -2
  38. package/include/node/v8-script.h +9 -7
  39. package/include/node/v8-snapshot.h +4 -1
  40. package/include/node/v8-source-location.h +92 -0
  41. package/include/node/v8-statistics.h +36 -1
  42. package/include/node/v8-traced-handle.h +37 -54
  43. package/include/node/v8-unwinder.h +1 -1
  44. package/include/node/v8-value-serializer.h +14 -0
  45. package/include/node/v8-value.h +14 -0
  46. package/include/node/v8-version.h +3 -3
  47. package/include/node/v8config.h +19 -10
  48. package/package.json +1 -1
  49. package/share/doc/node/gdbinit +60 -6
  50. package/share/doc/node/lldb_commands.py +73 -10
  51. package/share/man/man1/node.1 +12 -0
@@ -5,87 +5,11 @@
5
5
  #ifndef INCLUDE_CPPGC_SOURCE_LOCATION_H_
6
6
  #define INCLUDE_CPPGC_SOURCE_LOCATION_H_
7
7
 
8
- #include <cstddef>
9
- #include <string>
10
-
11
- #include "v8config.h" // NOLINT(build/include_directory)
12
-
13
- #if defined(__has_builtin)
14
- #define CPPGC_SUPPORTS_SOURCE_LOCATION \
15
- (__has_builtin(__builtin_FUNCTION) && __has_builtin(__builtin_FILE) && \
16
- __has_builtin(__builtin_LINE)) // NOLINT
17
- #elif defined(V8_CC_GNU) && __GNUC__ >= 7
18
- #define CPPGC_SUPPORTS_SOURCE_LOCATION 1
19
- #elif defined(V8_CC_INTEL) && __ICC >= 1800
20
- #define CPPGC_SUPPORTS_SOURCE_LOCATION 1
21
- #else
22
- #define CPPGC_SUPPORTS_SOURCE_LOCATION 0
23
- #endif
8
+ #include "v8-source-location.h"
24
9
 
25
10
  namespace cppgc {
26
11
 
27
- /**
28
- * Encapsulates source location information. Mimics C++20's
29
- * `std::source_location`.
30
- */
31
- class V8_EXPORT SourceLocation final {
32
- public:
33
- /**
34
- * Construct source location information corresponding to the location of the
35
- * call site.
36
- */
37
- #if CPPGC_SUPPORTS_SOURCE_LOCATION
38
- static constexpr SourceLocation Current(
39
- const char* function = __builtin_FUNCTION(),
40
- const char* file = __builtin_FILE(), size_t line = __builtin_LINE()) {
41
- return SourceLocation(function, file, line);
42
- }
43
- #else
44
- static constexpr SourceLocation Current() { return SourceLocation(); }
45
- #endif // CPPGC_SUPPORTS_SOURCE_LOCATION
46
-
47
- /**
48
- * Constructs unspecified source location information.
49
- */
50
- constexpr SourceLocation() = default;
51
-
52
- /**
53
- * Returns the name of the function associated with the position represented
54
- * by this object, if any.
55
- *
56
- * \returns the function name as cstring.
57
- */
58
- constexpr const char* Function() const { return function_; }
59
-
60
- /**
61
- * Returns the name of the current source file represented by this object.
62
- *
63
- * \returns the file name as cstring.
64
- */
65
- constexpr const char* FileName() const { return file_; }
66
-
67
- /**
68
- * Returns the line number represented by this object.
69
- *
70
- * \returns the line number.
71
- */
72
- constexpr size_t Line() const { return line_; }
73
-
74
- /**
75
- * Returns a human-readable string representing this object.
76
- *
77
- * \returns a human-readable string representing source location information.
78
- */
79
- std::string ToString() const;
80
-
81
- private:
82
- constexpr SourceLocation(const char* function, const char* file, size_t line)
83
- : function_(function), file_(file), line_(line) {}
84
-
85
- const char* function_ = nullptr;
86
- const char* file_ = nullptr;
87
- size_t line_ = 0u;
88
- };
12
+ using SourceLocation = v8::SourceLocation;
89
13
 
90
14
  } // namespace cppgc
91
15
 
@@ -53,6 +53,14 @@ struct TraceDescriptor {
53
53
  TraceCallback callback;
54
54
  };
55
55
 
56
+ /**
57
+ * Callback for getting a TraceDescriptor for a given address.
58
+ *
59
+ * \param address Possibly inner address of an object.
60
+ * \returns a TraceDescriptor for the provided address.
61
+ */
62
+ using TraceDescriptorCallback = TraceDescriptor (*)(const void* address);
63
+
56
64
  namespace internal {
57
65
 
58
66
  struct V8_EXPORT TraceTraitFromInnerAddressImpl {
@@ -5,10 +5,13 @@
5
5
  #ifndef INCLUDE_CPPGC_VISITOR_H_
6
6
  #define INCLUDE_CPPGC_VISITOR_H_
7
7
 
8
+ #include <type_traits>
9
+
8
10
  #include "cppgc/custom-space.h"
9
11
  #include "cppgc/ephemeron-pair.h"
10
12
  #include "cppgc/garbage-collected.h"
11
13
  #include "cppgc/internal/logging.h"
14
+ #include "cppgc/internal/member-storage.h"
12
15
  #include "cppgc/internal/pointer-policies.h"
13
16
  #include "cppgc/liveness-broker.h"
14
17
  #include "cppgc/member.h"
@@ -113,6 +116,30 @@ class V8_EXPORT Visitor {
113
116
  }
114
117
  #endif // defined(CPPGC_POINTER_COMPRESSION)
115
118
 
119
+ template <typename T>
120
+ void TraceMultiple(const subtle::UncompressedMember<T>* start, size_t len) {
121
+ static_assert(sizeof(T), "Pointee type must be fully defined.");
122
+ static_assert(internal::IsGarbageCollectedOrMixinType<T>::value,
123
+ "T must be GarbageCollected or GarbageCollectedMixin type");
124
+ VisitMultipleUncompressedMember(start, len,
125
+ &TraceTrait<T>::GetTraceDescriptor);
126
+ }
127
+
128
+ template <typename T,
129
+ std::enable_if_t<!std::is_same_v<
130
+ Member<T>, subtle::UncompressedMember<T>>>* = nullptr>
131
+ void TraceMultiple(const Member<T>* start, size_t len) {
132
+ static_assert(sizeof(T), "Pointee type must be fully defined.");
133
+ static_assert(internal::IsGarbageCollectedOrMixinType<T>::value,
134
+ "T must be GarbageCollected or GarbageCollectedMixin type");
135
+ #if defined(CPPGC_POINTER_COMPRESSION)
136
+ static_assert(std::is_same_v<Member<T>, subtle::CompressedMember<T>>,
137
+ "Member and CompressedMember must be the same.");
138
+ VisitMultipleCompressedMember(start, len,
139
+ &TraceTrait<T>::GetTraceDescriptor);
140
+ #endif // defined(CPPGC_POINTER_COMPRESSION)
141
+ }
142
+
116
143
  /**
117
144
  * Trace method for inlined objects that are not allocated themselves but
118
145
  * otherwise follow managed heap layout and have a Trace() method.
@@ -131,6 +158,26 @@ class V8_EXPORT Visitor {
131
158
  TraceTrait<T>::Trace(this, &object);
132
159
  }
133
160
 
161
+ template <typename T>
162
+ void TraceMultiple(const T* start, size_t len) {
163
+ #if V8_ENABLE_CHECKS
164
+ // This object is embedded in potentially multiple nested objects. The
165
+ // outermost object must not be in construction as such objects are (a) not
166
+ // processed immediately, and (b) only processed conservatively if not
167
+ // otherwise possible.
168
+ CheckObjectNotInConstruction(start);
169
+ #endif // V8_ENABLE_CHECKS
170
+ for (size_t i = 0; i < len; ++i) {
171
+ const T* object = &start[i];
172
+ if constexpr (std::is_polymorphic_v<T>) {
173
+ // The object's vtable may be uninitialized in which case the object is
174
+ // not traced.
175
+ if (*reinterpret_cast<const uintptr_t*>(object) == 0) continue;
176
+ }
177
+ TraceTrait<T>::Trace(this, object);
178
+ }
179
+ }
180
+
134
181
  /**
135
182
  * Registers a weak callback method on the object of type T. See
136
183
  * LivenessBroker for an usage example.
@@ -314,6 +361,39 @@ class V8_EXPORT Visitor {
314
361
  WeakCallback callback, const void* data) {}
315
362
  virtual void HandleMovableReference(const void**) {}
316
363
 
364
+ virtual void VisitMultipleUncompressedMember(
365
+ const void* start, size_t len,
366
+ TraceDescriptorCallback get_trace_descriptor) {
367
+ // Default implementation merely delegates to Visit().
368
+ const char* it = static_cast<const char*>(start);
369
+ const char* end = it + len * internal::kSizeOfUncompressedMember;
370
+ for (; it < end; it += internal::kSizeOfUncompressedMember) {
371
+ const auto* current = reinterpret_cast<const internal::RawPointer*>(it);
372
+ const void* object = current->LoadAtomic();
373
+ if (!object) continue;
374
+
375
+ Visit(object, get_trace_descriptor(object));
376
+ }
377
+ }
378
+
379
+ #if defined(CPPGC_POINTER_COMPRESSION)
380
+ virtual void VisitMultipleCompressedMember(
381
+ const void* start, size_t len,
382
+ TraceDescriptorCallback get_trace_descriptor) {
383
+ // Default implementation merely delegates to Visit().
384
+ const char* it = static_cast<const char*>(start);
385
+ const char* end = it + len * internal::kSizeofCompressedMember;
386
+ for (; it < end; it += internal::kSizeofCompressedMember) {
387
+ const auto* current =
388
+ reinterpret_cast<const internal::CompressedPointer*>(it);
389
+ const void* object = current->LoadAtomic();
390
+ if (!object) continue;
391
+
392
+ Visit(object, get_trace_descriptor(object));
393
+ }
394
+ }
395
+ #endif // defined(CPPGC_POINTER_COMPRESSION)
396
+
317
397
  private:
318
398
  template <typename T, void (T::*method)(const LivenessBroker&)>
319
399
  static void WeakCallbackMethodDelegate(const LivenessBroker& info,
@@ -326,8 +406,7 @@ class V8_EXPORT Visitor {
326
406
  template <typename PointerType>
327
407
  static void HandleWeak(const LivenessBroker& info, const void* object) {
328
408
  const PointerType* weak = static_cast<const PointerType*>(object);
329
- auto* raw_ptr = weak->GetFromGC();
330
- if (!info.IsHeapObjectAlive(raw_ptr)) {
409
+ if (!info.IsHeapObjectAlive(weak->GetFromGC())) {
331
410
  weak->ClearFromGC();
332
411
  }
333
412
  }
@@ -413,8 +492,7 @@ class V8_EXPORT RootVisitor {
413
492
  template <typename PointerType>
414
493
  static void HandleWeak(const LivenessBroker& info, const void* object) {
415
494
  const PointerType* weak = static_cast<const PointerType*>(object);
416
- auto* raw_ptr = weak->GetFromGC();
417
- if (!info.IsHeapObjectAlive(raw_ptr)) {
495
+ if (!info.IsHeapObjectAlive(weak->GetFromGC())) {
418
496
  weak->ClearFromGC();
419
497
  }
420
498
  }
@@ -28,7 +28,7 @@
28
28
  #ifndef NAPI_EXTERN
29
29
  #ifdef _WIN32
30
30
  #define NAPI_EXTERN __declspec(dllexport)
31
- #elif defined(__wasm32__)
31
+ #elif defined(__wasm__)
32
32
  #define NAPI_EXTERN \
33
33
  __attribute__((visibility("default"))) \
34
34
  __attribute__((__import_module__("napi")))
@@ -517,6 +517,16 @@ NAPI_EXTERN napi_status NAPI_CDECL napi_add_finalizer(napi_env env,
517
517
 
518
518
  #endif // NAPI_VERSION >= 5
519
519
 
520
+ #ifdef NAPI_EXPERIMENTAL
521
+
522
+ NAPI_EXTERN napi_status NAPI_CDECL
523
+ node_api_post_finalizer(napi_env env,
524
+ napi_finalize finalize_cb,
525
+ void* finalize_data,
526
+ void* finalize_hint);
527
+
528
+ #endif // NAPI_EXPERIMENTAL
529
+
520
530
  #if NAPI_VERSION >= 6
521
531
 
522
532
  // BigInt
@@ -23,6 +23,8 @@ enum class MessageLoopBehavior : bool {
23
23
  kWaitForWork = true
24
24
  };
25
25
 
26
+ enum class PriorityMode : bool { kDontApply, kApply };
27
+
26
28
  /**
27
29
  * Returns a new instance of the default v8::Platform implementation.
28
30
  *
@@ -35,13 +37,17 @@ enum class MessageLoopBehavior : bool {
35
37
  * calling v8::platform::RunIdleTasks to process the idle tasks.
36
38
  * If |tracing_controller| is nullptr, the default platform will create a
37
39
  * v8::platform::TracingController instance and use it.
40
+ * If |priority_mode| is PriorityMode::kApply, the default platform will use
41
+ * multiple task queues executed by threads different system-level priorities
42
+ * (where available) to schedule tasks.
38
43
  */
39
44
  V8_PLATFORM_EXPORT std::unique_ptr<v8::Platform> NewDefaultPlatform(
40
45
  int thread_pool_size = 0,
41
46
  IdleTaskSupport idle_task_support = IdleTaskSupport::kDisabled,
42
47
  InProcessStackDumping in_process_stack_dumping =
43
48
  InProcessStackDumping::kDisabled,
44
- std::unique_ptr<v8::TracingController> tracing_controller = {});
49
+ std::unique_ptr<v8::TracingController> tracing_controller = {},
50
+ PriorityMode priority_mode = PriorityMode::kDontApply);
45
51
 
46
52
  /**
47
53
  * The same as NewDefaultPlatform but disables the worker thread pool.