node-linux-arm64 22.10.0 → 23.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.
Files changed (57) hide show
  1. package/CHANGELOG.md +527 -2239
  2. package/README.md +9 -14
  3. package/bin/node +0 -0
  4. package/include/node/common.gypi +3 -3
  5. package/include/node/config.gypi +5 -4
  6. package/include/node/cppgc/allocation.h +10 -11
  7. package/include/node/cppgc/garbage-collected.h +8 -0
  8. package/include/node/cppgc/heap-statistics.h +2 -0
  9. package/include/node/cppgc/internal/api-constants.h +6 -1
  10. package/include/node/cppgc/internal/compiler-specific.h +9 -1
  11. package/include/node/cppgc/internal/gc-info.h +12 -10
  12. package/include/node/cppgc/internal/member-storage.h +6 -0
  13. package/include/node/cppgc/internal/name-trait.h +5 -1
  14. package/include/node/cppgc/name-provider.h +7 -0
  15. package/include/node/node.h +8 -18
  16. package/include/node/node_api.h +12 -0
  17. package/include/node/node_version.h +3 -3
  18. package/include/node/uv/tree.h +3 -250
  19. package/include/node/uv/version.h +2 -2
  20. package/include/node/uv/win.h +2 -2
  21. package/include/node/uv.h +45 -17
  22. package/include/node/v8-array-buffer.h +44 -24
  23. package/include/node/v8-callbacks.h +10 -5
  24. package/include/node/v8-context.h +41 -9
  25. package/include/node/v8-cppgc.h +3 -55
  26. package/include/node/v8-date.h +9 -0
  27. package/include/node/v8-embedder-heap.h +4 -1
  28. package/include/node/v8-exception.h +70 -0
  29. package/include/node/v8-function-callback.h +203 -62
  30. package/include/node/v8-function.h +4 -3
  31. package/include/node/v8-handle-base.h +2 -2
  32. package/include/node/v8-initialization.h +18 -1
  33. package/include/node/v8-internal.h +303 -58
  34. package/include/node/v8-isolate.h +51 -39
  35. package/include/node/v8-local-handle.h +18 -19
  36. package/include/node/v8-message.h +0 -21
  37. package/include/node/v8-microtask-queue.h +0 -5
  38. package/include/node/v8-object.h +284 -35
  39. package/include/node/v8-persistent-handle.h +0 -19
  40. package/include/node/v8-platform.h +21 -35
  41. package/include/node/v8-primitive.h +92 -1
  42. package/include/node/v8-profiler.h +38 -1
  43. package/include/node/v8-promise.h +2 -2
  44. package/include/node/v8-sandbox.h +173 -0
  45. package/include/node/v8-script.h +44 -14
  46. package/include/node/v8-snapshot.h +38 -2
  47. package/include/node/v8-template.h +105 -263
  48. package/include/node/v8-traced-handle.h +4 -15
  49. package/include/node/v8-unwinder.h +2 -1
  50. package/include/node/v8-value.h +3 -2
  51. package/include/node/v8-version.h +3 -3
  52. package/include/node/v8-wasm.h +3 -0
  53. package/include/node/v8config.h +47 -7
  54. package/package.json +1 -1
  55. package/share/doc/node/gdbinit +41 -3
  56. package/share/doc/node/lldb_commands.py +7 -2
  57. package/share/man/man1/node.1 +0 -14
@@ -107,6 +107,10 @@ class V8_EXPORT Context : public Data {
107
107
  * configured if the default context snapshot contains no pointer embedder
108
108
  * data, or if no custom startup snapshot is configured in the
109
109
  * v8::CreateParams used to create the isolate.
110
+ *
111
+ * \param api_wrapper_deserializer An optional callback used to deserialize
112
+ * API wrapper objects that was initially set with v8::Object::Wrap() and then
113
+ * serialized using SerializeAPIWrapperCallback.
110
114
  */
111
115
  static Local<Context> New(
112
116
  Isolate* isolate, ExtensionConfiguration* extensions = nullptr,
@@ -116,17 +120,19 @@ class V8_EXPORT Context : public Data {
116
120
  DeserializeInternalFieldsCallback(),
117
121
  MicrotaskQueue* microtask_queue = nullptr,
118
122
  DeserializeContextDataCallback context_data_deserializer =
119
- DeserializeContextDataCallback());
123
+ DeserializeContextDataCallback(),
124
+ DeserializeAPIWrapperCallback api_wrapper_deserializer =
125
+ DeserializeAPIWrapperCallback());
120
126
 
121
127
  /**
122
128
  * Create a new context from a (non-default) context snapshot. There
123
129
  * is no way to provide a global object template since we do not create
124
130
  * a new global object from template, but we can reuse a global object.
125
131
  *
126
- * \param isolate See v8::Context::New.
132
+ * \param isolate See v8::Context::New().
127
133
  *
128
134
  * \param context_snapshot_index The index of the context snapshot to
129
- * deserialize from. Use v8::Context::New for the default snapshot.
135
+ * deserialize from. Use v8::Context::New() for the default snapshot.
130
136
  *
131
137
  * \param internal_fields_deserializer An optional callback used
132
138
  * to deserialize fields set by
@@ -136,19 +142,23 @@ class V8_EXPORT Context : public Data {
136
142
  * pointer fields in the default context snapshot or if no startup
137
143
  * snapshot is configured when the isolate is created.
138
144
  *
139
- * \param extensions See v8::Context::New.
145
+ * \param extensions See v8::Context::New().
140
146
  *
141
- * \param global_object See v8::Context::New.
147
+ * \param global_object See v8::Context::New().
142
148
  *
143
149
  * \param internal_fields_deserializer Similar to
144
- * internal_fields_deserializer in v8::Context::New but applies to
150
+ * internal_fields_deserializer in v8::Context::New() but applies to
145
151
  * the context specified by the context_snapshot_index.
146
152
  *
147
- * \param microtask_queue See v8::Context::New.
153
+ * \param microtask_queue See v8::Context::New().
148
154
  *
149
155
  * \param context_data_deserializer Similar to
150
- * context_data_deserializer in v8::Context::New but applies to
156
+ * context_data_deserializer in v8::Context::New() but applies to
151
157
  * the context specified by the context_snapshot_index.
158
+ *
159
+ *\param api_wrapper_deserializer Similar to api_wrapper_deserializer in
160
+ * v8::Context::New() but applies to the context specified by the
161
+ * context_snapshot_index.
152
162
  */
153
163
  static MaybeLocal<Context> FromSnapshot(
154
164
  Isolate* isolate, size_t context_snapshot_index,
@@ -158,7 +168,9 @@ class V8_EXPORT Context : public Data {
158
168
  MaybeLocal<Value> global_object = MaybeLocal<Value>(),
159
169
  MicrotaskQueue* microtask_queue = nullptr,
160
170
  DeserializeContextDataCallback context_data_deserializer =
161
- DeserializeContextDataCallback());
171
+ DeserializeContextDataCallback(),
172
+ DeserializeAPIWrapperCallback api_wrapper_deserializer =
173
+ DeserializeAPIWrapperCallback());
162
174
 
163
175
  /**
164
176
  * Returns an global object that isn't backed by an actual context.
@@ -290,6 +302,8 @@ class V8_EXPORT Context : public Data {
290
302
  * SetAlignedPointerInEmbedderData with the same index. Note that index 0
291
303
  * currently has a special meaning for Chrome's debugger.
292
304
  */
305
+ V8_INLINE void* GetAlignedPointerFromEmbedderData(Isolate* isolate,
306
+ int index);
293
307
  V8_INLINE void* GetAlignedPointerFromEmbedderData(int index);
294
308
 
295
309
  /**
@@ -444,6 +458,24 @@ Local<Value> Context::GetEmbedderData(int index) {
444
458
  #endif
445
459
  }
446
460
 
461
+ void* Context::GetAlignedPointerFromEmbedderData(Isolate* isolate, int index) {
462
+ #if !defined(V8_ENABLE_CHECKS)
463
+ using A = internal::Address;
464
+ using I = internal::Internals;
465
+ A ctx = internal::ValueHelper::ValueAsAddress(this);
466
+ A embedder_data =
467
+ I::ReadTaggedPointerField(ctx, I::kNativeContextEmbedderDataOffset);
468
+ int value_offset = I::kEmbedderDataArrayHeaderSize +
469
+ (I::kEmbedderDataSlotSize * index) +
470
+ I::kEmbedderDataSlotExternalPointerOffset;
471
+ return reinterpret_cast<void*>(
472
+ I::ReadExternalPointerField<internal::kEmbedderDataSlotPayloadTag>(
473
+ isolate, embedder_data, value_offset));
474
+ #else
475
+ return SlowGetAlignedPointerFromEmbedderData(index);
476
+ #endif
477
+ }
478
+
447
479
  void* Context::GetAlignedPointerFromEmbedderData(int index) {
448
480
  #if !defined(V8_ENABLE_CHECKS)
449
481
  using A = internal::Address;
@@ -32,62 +32,15 @@ class CppHeap;
32
32
 
33
33
  class CustomSpaceStatisticsReceiver;
34
34
 
35
- /**
36
- * Describes how V8 wrapper objects maintain references to garbage-collected C++
37
- * objects.
38
- */
39
- struct WrapperDescriptor final {
40
- /**
41
- * The index used on `v8::Ojbect::SetAlignedPointerFromInternalField()` and
42
- * related APIs to add additional data to an object which is used to identify
43
- * JS->C++ references.
44
- */
45
- using InternalFieldIndex = int;
46
-
47
- /**
48
- * Unknown embedder id. The value is reserved for internal usages and must not
49
- * be used with `CppHeap`.
50
- */
51
- static constexpr uint16_t kUnknownEmbedderId = UINT16_MAX;
52
-
53
- constexpr WrapperDescriptor(InternalFieldIndex wrappable_type_index,
54
- InternalFieldIndex wrappable_instance_index,
55
- uint16_t embedder_id_for_garbage_collected)
56
- : wrappable_type_index(wrappable_type_index),
57
- wrappable_instance_index(wrappable_instance_index),
58
- embedder_id_for_garbage_collected(embedder_id_for_garbage_collected) {}
59
-
60
- /**
61
- * Index of the wrappable type.
62
- */
63
- InternalFieldIndex wrappable_type_index;
64
-
65
- /**
66
- * Index of the wrappable instance.
67
- */
68
- InternalFieldIndex wrappable_instance_index;
69
-
70
- /**
71
- * Embedder id identifying instances of garbage-collected objects. It is
72
- * expected that the first field of the wrappable type is a uint16_t holding
73
- * the id. Only references to instances of wrappables types with an id of
74
- * `embedder_id_for_garbage_collected` will be considered by CppHeap.
75
- */
76
- uint16_t embedder_id_for_garbage_collected;
77
- };
78
-
79
35
  struct V8_EXPORT CppHeapCreateParams {
80
- CppHeapCreateParams(
81
- std::vector<std::unique_ptr<cppgc::CustomSpaceBase>> custom_spaces,
82
- WrapperDescriptor wrapper_descriptor)
83
- : custom_spaces(std::move(custom_spaces)),
84
- wrapper_descriptor(wrapper_descriptor) {}
36
+ explicit CppHeapCreateParams(
37
+ std::vector<std::unique_ptr<cppgc::CustomSpaceBase>> custom_spaces)
38
+ : custom_spaces(std::move(custom_spaces)) {}
85
39
 
86
40
  CppHeapCreateParams(const CppHeapCreateParams&) = delete;
87
41
  CppHeapCreateParams& operator=(const CppHeapCreateParams&) = delete;
88
42
 
89
43
  std::vector<std::unique_ptr<cppgc::CustomSpaceBase>> custom_spaces;
90
- WrapperDescriptor wrapper_descriptor;
91
44
  /**
92
45
  * Specifies which kind of marking are supported by the heap. The type may be
93
46
  * further reduced via runtime flags when attaching the heap to an Isolate.
@@ -177,11 +130,6 @@ class V8_EXPORT CppHeap {
177
130
  void CollectGarbageInYoungGenerationForTesting(
178
131
  cppgc::EmbedderStackState stack_state);
179
132
 
180
- /**
181
- * \returns the wrapper descriptor of this CppHeap.
182
- */
183
- v8::WrapperDescriptor wrapper_descriptor() const;
184
-
185
133
  private:
186
134
  CppHeap() = default;
187
135
 
@@ -21,6 +21,10 @@ class V8_EXPORT Date : public Object {
21
21
  static V8_WARN_UNUSED_RESULT MaybeLocal<Value> New(Local<Context> context,
22
22
  double time);
23
23
 
24
+ static V8_WARN_UNUSED_RESULT MaybeLocal<Value> Parse(
25
+ Local<Context> context,
26
+ Local<String> date_string);
27
+
24
28
  /**
25
29
  * A specialization of Value::NumberValue that is more efficient
26
30
  * because we know the structure of this object.
@@ -32,6 +36,11 @@ class V8_EXPORT Date : public Object {
32
36
  */
33
37
  v8::Local<v8::String> ToISOString() const;
34
38
 
39
+ /**
40
+ * Generates UTC string representation.
41
+ */
42
+ v8::Local<v8::String> ToUTCString() const;
43
+
35
44
  V8_INLINE static Date* Cast(Value* value) {
36
45
  #ifdef V8_ENABLE_CHECKS
37
46
  CheckCast(value);
@@ -29,6 +29,8 @@ class V8_EXPORT EmbedderRootsHandler {
29
29
  virtual ~EmbedderRootsHandler() = default;
30
30
 
31
31
  EmbedderRootsHandler() = default;
32
+
33
+ V8_DEPRECATED("Use the default constructor instead.")
32
34
  explicit EmbedderRootsHandler(RootHandling default_traced_reference_handling)
33
35
  : default_traced_reference_handling_(default_traced_reference_handling) {}
34
36
 
@@ -47,6 +49,7 @@ class V8_EXPORT EmbedderRootsHandler {
47
49
  *
48
50
  * The concrete implementations must be thread-safe.
49
51
  */
52
+ V8_DEPRECATED("Use TracedReferenceHandling::kDroppable instead.")
50
53
  virtual bool IsRoot(const v8::TracedReference<v8::Value>& handle) = 0;
51
54
 
52
55
  /**
@@ -72,7 +75,7 @@ class V8_EXPORT EmbedderRootsHandler {
72
75
 
73
76
  private:
74
77
  const RootHandling default_traced_reference_handling_ =
75
- RootHandling::kQueryEmbedderForNonDroppableReferences;
78
+ RootHandling::kDontQueryEmbedderForAnyReference;
76
79
 
77
80
  friend class internal::TracedHandles;
78
81
  };
@@ -8,6 +8,7 @@
8
8
  #include <stddef.h>
9
9
 
10
10
  #include "v8-local-handle.h" // NOLINT(build/include_directory)
11
+ #include "v8-object.h" // NOLINT(build/include_directory)
11
12
  #include "v8config.h" // NOLINT(build/include_directory)
12
13
 
13
14
  namespace v8 {
@@ -58,8 +59,77 @@ class V8_EXPORT Exception {
58
59
  * of a given exception, or an empty handle if not available.
59
60
  */
60
61
  static Local<StackTrace> GetStackTrace(Local<Value> exception);
62
+
63
+ /**
64
+ * Captures the current stack trace and attaches it to the given object in the
65
+ * form of `stack` property.
66
+ */
67
+ static Maybe<bool> CaptureStackTrace(Local<Context> context,
68
+ Local<Object> object);
61
69
  };
62
70
 
71
+ /**
72
+ * This is a part of experimental Api and might be changed without further
73
+ * notice.
74
+ * Do not use it.
75
+ */
76
+ enum class ExceptionContext : uint32_t {
77
+ kUnknown,
78
+ kConstructor,
79
+ kOperation,
80
+ kAttributeGet,
81
+ kAttributeSet,
82
+ kIndexedQuery,
83
+ kIndexedGetter,
84
+ kIndexedDescriptor,
85
+ kIndexedSetter,
86
+ kIndexedDefiner,
87
+ kIndexedDeleter,
88
+ kNamedQuery,
89
+ kNamedGetter,
90
+ kNamedDescriptor,
91
+ kNamedSetter,
92
+ kNamedDefiner,
93
+ kNamedDeleter,
94
+ kNamedEnumerator
95
+ };
96
+
97
+ /**
98
+ * This is a part of experimental Api and might be changed without further
99
+ * notice.
100
+ * Do not use it.
101
+ */
102
+ class ExceptionPropagationMessage {
103
+ public:
104
+ ExceptionPropagationMessage(v8::Isolate* isolate, Local<Object> exception,
105
+ Local<String> interface_name,
106
+ Local<String> property_name,
107
+ ExceptionContext exception_context)
108
+ : isolate_(isolate),
109
+ exception_(exception),
110
+ interface_name_(interface_name),
111
+ property_name_(property_name),
112
+ exception_context_(exception_context) {}
113
+
114
+ V8_INLINE Isolate* GetIsolate() const { return isolate_; }
115
+ V8_INLINE Local<Object> GetException() const { return exception_; }
116
+ V8_INLINE Local<String> GetInterfaceName() const { return interface_name_; }
117
+ V8_INLINE Local<String> GetPropertyName() const { return property_name_; }
118
+ V8_INLINE ExceptionContext GetExceptionContext() const {
119
+ return exception_context_;
120
+ }
121
+
122
+ private:
123
+ Isolate* isolate_;
124
+ Local<Object> exception_;
125
+ Local<String> interface_name_;
126
+ Local<String> property_name_;
127
+ ExceptionContext exception_context_;
128
+ };
129
+
130
+ using ExceptionPropagationCallback =
131
+ void (*)(ExceptionPropagationMessage message);
132
+
63
133
  /**
64
134
  * An external exception handler.
65
135
  */