libv8-node 15.14.0.1-aarch64-linux-musl → 16.17.0.0-aarch64-linux-musl

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. checksums.yaml +4 -4
  2. data/ext/libv8-node/location.rb +1 -1
  3. data/ext/libv8-node/paths.rb +5 -1
  4. data/lib/libv8/node/version.rb +3 -3
  5. data/vendor/v8/{out.gn → aarch64-linux-musl}/libv8/obj/libv8_monolith.a +0 -0
  6. data/vendor/v8/include/cppgc/allocation.h +105 -45
  7. data/vendor/v8/include/cppgc/common.h +9 -6
  8. data/vendor/v8/include/cppgc/cross-thread-persistent.h +413 -0
  9. data/vendor/v8/include/cppgc/custom-space.h +37 -2
  10. data/vendor/v8/include/cppgc/default-platform.h +47 -48
  11. data/vendor/v8/include/cppgc/ephemeron-pair.h +30 -0
  12. data/vendor/v8/include/cppgc/explicit-management.h +82 -0
  13. data/vendor/v8/include/cppgc/garbage-collected.h +4 -3
  14. data/vendor/v8/include/cppgc/heap-consistency.h +253 -0
  15. data/vendor/v8/include/cppgc/heap-state.h +70 -0
  16. data/vendor/v8/include/cppgc/heap-statistics.h +120 -0
  17. data/vendor/v8/include/cppgc/heap.h +68 -6
  18. data/vendor/v8/include/cppgc/internal/api-constants.h +3 -3
  19. data/vendor/v8/include/cppgc/internal/caged-heap-local-data.h +2 -1
  20. data/vendor/v8/include/cppgc/internal/compiler-specific.h +2 -2
  21. data/vendor/v8/include/cppgc/internal/gc-info.h +44 -13
  22. data/vendor/v8/include/cppgc/internal/name-trait.h +111 -0
  23. data/vendor/v8/include/cppgc/internal/persistent-node.h +58 -2
  24. data/vendor/v8/include/cppgc/internal/pointer-policies.h +69 -28
  25. data/vendor/v8/include/cppgc/internal/prefinalizer-handler.h +1 -1
  26. data/vendor/v8/include/cppgc/internal/write-barrier.h +390 -35
  27. data/vendor/v8/include/cppgc/liveness-broker.h +11 -2
  28. data/vendor/v8/include/cppgc/macros.h +2 -0
  29. data/vendor/v8/include/cppgc/member.h +87 -25
  30. data/vendor/v8/include/cppgc/name-provider.h +65 -0
  31. data/vendor/v8/include/cppgc/object-size-trait.h +58 -0
  32. data/vendor/v8/include/cppgc/persistent.h +40 -10
  33. data/vendor/v8/include/cppgc/platform.h +49 -25
  34. data/vendor/v8/include/cppgc/prefinalizer.h +1 -1
  35. data/vendor/v8/include/cppgc/process-heap-statistics.h +36 -0
  36. data/vendor/v8/include/cppgc/sentinel-pointer.h +32 -0
  37. data/vendor/v8/include/cppgc/source-location.h +2 -1
  38. data/vendor/v8/include/cppgc/testing.h +99 -0
  39. data/vendor/v8/include/cppgc/trace-trait.h +8 -3
  40. data/vendor/v8/include/cppgc/type-traits.h +157 -19
  41. data/vendor/v8/include/cppgc/visitor.h +194 -28
  42. data/vendor/v8/include/libplatform/libplatform.h +11 -0
  43. data/vendor/v8/include/libplatform/v8-tracing.h +2 -0
  44. data/vendor/v8/include/v8-cppgc.h +258 -159
  45. data/vendor/v8/include/v8-fast-api-calls.h +603 -155
  46. data/vendor/v8/include/v8-inspector.h +22 -4
  47. data/vendor/v8/include/v8-internal.h +111 -27
  48. data/vendor/v8/include/v8-metrics.h +77 -8
  49. data/vendor/v8/include/v8-platform.h +47 -22
  50. data/vendor/v8/include/v8-profiler.h +75 -11
  51. data/vendor/v8/include/v8-unwinder-state.h +30 -0
  52. data/vendor/v8/include/v8-util.h +1 -1
  53. data/vendor/v8/include/v8-version.h +4 -4
  54. data/vendor/v8/include/v8.h +1196 -642
  55. data/vendor/v8/include/v8config.h +87 -11
  56. metadata +17 -5
  57. data/vendor/v8/include/cppgc/internal/process-heap.h +0 -34
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 151265172774397e9607a741cfe97dd31bef09562171d73ac4da41a16ce57458
4
- data.tar.gz: 39deee975458b5cf489d07812dee611c3eb02e632aa1440c4687436b3550b4a9
3
+ metadata.gz: 3484f69fe9e2395bf9e4df8e5ecc87676730890456a6d3352c634503ce04c896
4
+ data.tar.gz: 2aa5b2efce031f587b7932028170fb52f9af3928946a0f3af6d3a0a2a4691a11
5
5
  SHA512:
6
- metadata.gz: 9ce674c70a3c323e7ea8ff71a602d6609ddcf3a6f036c27238ecb0fa673f3380428ec961a2bc3e9430aa7bf42b7842f14022cc8018eb6bcb474bec97666019cb
7
- data.tar.gz: 4f5054198393005334e4d417e3841dd014467073172dc8560c018490b695a7ef4fbf013e562b81507952733638c723acb87099c837a21a50c783b3088ac957f7
6
+ metadata.gz: 2e91ed5afe7482ec3efc49b1f8bd61424923a6fb7081072223ac7a453225db4e99f6b3e2008aad7c2596ca05eab12eec4cc65f54f980b53769932d773e5a7b22
7
+ data.tar.gz: 7d26268bb0cc47023199a8d6b5909b641fbaa23ea698f66f9c2bab506405b912bc2a138c371a8252ef8edef1218f2eecf89d135d4e6b738920bf55455034e235
@@ -18,7 +18,7 @@ module Libv8::Node
18
18
 
19
19
  def self.load!
20
20
  File.open(Pathname(__FILE__).dirname.join('.location.yml')) do |f|
21
- YAML.load(f) # rubocop:disable Security/YAMLLoad
21
+ YAML.respond_to?(:unsafe_load) ? YAML.unsafe_load(f) : YAML.load(f) # rubocop:disable Security/YAMLLoad
22
22
  end
23
23
  end
24
24
 
@@ -13,12 +13,16 @@ module Libv8::Node
13
13
 
14
14
  def object_paths
15
15
  [Shellwords.escape(File.join(vendored_source_path,
16
- 'out.gn',
16
+ platform,
17
17
  'libv8',
18
18
  'obj',
19
19
  "libv8_monolith.#{config['LIBEXT']}"))]
20
20
  end
21
21
 
22
+ def platform
23
+ Gem::Platform.local.tap { |p| RUBY_PLATFORM =~ /musl/ && p.version.nil? && p.instance_eval { @version = 'musl' } }.to_s.gsub(/-darwin-?\d+/, '-darwin')
24
+ end
25
+
22
26
  def config
23
27
  RbConfig::MAKEFILE_CONFIG
24
28
  end
@@ -1,7 +1,7 @@
1
1
  module Libv8; end
2
2
 
3
3
  module Libv8::Node
4
- VERSION = '15.14.0.1'.freeze
5
- NODE_VERSION = '15.14.0'.freeze
6
- LIBV8_VERSION = '8.6.395.17'.freeze # from v8/include/v8-version.h
4
+ VERSION = '16.17.0.0'.freeze
5
+ NODE_VERSION = '16.17.0'.freeze
6
+ LIBV8_VERSION = '9.4.146.26'.freeze # from v8/include/v8-version.h
7
7
  end
@@ -5,24 +5,21 @@
5
5
  #ifndef INCLUDE_CPPGC_ALLOCATION_H_
6
6
  #define INCLUDE_CPPGC_ALLOCATION_H_
7
7
 
8
- #include <stdint.h>
9
-
10
8
  #include <atomic>
9
+ #include <cstddef>
10
+ #include <cstdint>
11
+ #include <new>
12
+ #include <type_traits>
13
+ #include <utility>
11
14
 
12
15
  #include "cppgc/custom-space.h"
13
- #include "cppgc/garbage-collected.h"
14
16
  #include "cppgc/internal/api-constants.h"
15
17
  #include "cppgc/internal/gc-info.h"
18
+ #include "cppgc/type-traits.h"
19
+ #include "v8config.h" // NOLINT(build/include_directory)
16
20
 
17
21
  namespace cppgc {
18
22
 
19
- template <typename T>
20
- class MakeGarbageCollectedTraitBase;
21
-
22
- namespace internal {
23
- class ObjectAllocator;
24
- } // namespace internal
25
-
26
23
  /**
27
24
  * AllocationHandle is used to allocate garbage-collected objects.
28
25
  */
@@ -39,11 +36,32 @@ class V8_EXPORT MakeGarbageCollectedTraitInternal {
39
36
  const_cast<uint16_t*>(reinterpret_cast<const uint16_t*>(
40
37
  reinterpret_cast<const uint8_t*>(payload) -
41
38
  api_constants::kFullyConstructedBitFieldOffsetFromPayload)));
42
- uint16_t value = atomic_mutable_bitfield->load(std::memory_order_relaxed);
43
- value = value | api_constants::kFullyConstructedBitMask;
44
- atomic_mutable_bitfield->store(value, std::memory_order_release);
39
+ atomic_mutable_bitfield->fetch_or(api_constants::kFullyConstructedBitMask,
40
+ std::memory_order_release);
45
41
  }
46
42
 
43
+ template <typename U, typename CustomSpace>
44
+ struct SpacePolicy {
45
+ static void* Allocate(AllocationHandle& handle, size_t size) {
46
+ // Custom space.
47
+ static_assert(std::is_base_of<CustomSpaceBase, CustomSpace>::value,
48
+ "Custom space must inherit from CustomSpaceBase.");
49
+ return MakeGarbageCollectedTraitInternal::Allocate(
50
+ handle, size, internal::GCInfoTrait<U>::Index(),
51
+ CustomSpace::kSpaceIndex);
52
+ }
53
+ };
54
+
55
+ template <typename U>
56
+ struct SpacePolicy<U, void> {
57
+ static void* Allocate(AllocationHandle& handle, size_t size) {
58
+ // Default space.
59
+ return MakeGarbageCollectedTraitInternal::Allocate(
60
+ handle, size, internal::GCInfoTrait<U>::Index());
61
+ }
62
+ };
63
+
64
+ private:
47
65
  static void* Allocate(cppgc::AllocationHandle& handle, size_t size,
48
66
  GCInfoIndex index);
49
67
  static void* Allocate(cppgc::AllocationHandle& handle, size_t size,
@@ -65,26 +83,12 @@ template <typename T>
65
83
  class MakeGarbageCollectedTraitBase
66
84
  : private internal::MakeGarbageCollectedTraitInternal {
67
85
  private:
68
- template <typename U, typename CustomSpace>
69
- struct SpacePolicy {
70
- static void* Allocate(AllocationHandle& handle, size_t size) {
71
- // Custom space.
72
- static_assert(std::is_base_of<CustomSpaceBase, CustomSpace>::value,
73
- "Custom space must inherit from CustomSpaceBase.");
74
- return internal::MakeGarbageCollectedTraitInternal::Allocate(
75
- handle, size, internal::GCInfoTrait<T>::Index(),
76
- CustomSpace::kSpaceIndex);
77
- }
78
- };
79
-
80
- template <typename U>
81
- struct SpacePolicy<U, void> {
82
- static void* Allocate(AllocationHandle& handle, size_t size) {
83
- // Default space.
84
- return internal::MakeGarbageCollectedTraitInternal::Allocate(
85
- handle, size, internal::GCInfoTrait<T>::Index());
86
- }
87
- };
86
+ static_assert(internal::IsGarbageCollectedType<T>::value,
87
+ "T needs to be a garbage collected object");
88
+ static_assert(!IsGarbageCollectedWithMixinTypeV<T> ||
89
+ sizeof(T) <=
90
+ internal::api_constants::kLargeObjectSizeThreshold,
91
+ "GarbageCollectedMixin may not be a large object");
88
92
 
89
93
  protected:
90
94
  /**
@@ -95,9 +99,15 @@ class MakeGarbageCollectedTraitBase
95
99
  * \param size The size that should be reserved for the object.
96
100
  * \returns the memory to construct an object of type T on.
97
101
  */
98
- static void* Allocate(AllocationHandle& handle, size_t size) {
99
- return SpacePolicy<T, typename SpaceTrait<T>::Space>::Allocate(handle,
100
- size);
102
+ V8_INLINE static void* Allocate(AllocationHandle& handle, size_t size) {
103
+ static_assert(
104
+ std::is_base_of<typename T::ParentMostGarbageCollectedType, T>::value,
105
+ "U of GarbageCollected<U> must be a base of T. Check "
106
+ "GarbageCollected<T> base class inheritance.");
107
+ return SpacePolicy<
108
+ typename internal::GCInfoFolding<
109
+ T, typename T::ParentMostGarbageCollectedType>::ResultType,
110
+ typename SpaceTrait<T>::Space>::Allocate(handle, size);
101
111
  }
102
112
 
103
113
  /**
@@ -106,39 +116,70 @@ class MakeGarbageCollectedTraitBase
106
116
  *
107
117
  * \param payload The base pointer the object is allocated at.
108
118
  */
109
- static void MarkObjectAsFullyConstructed(const void* payload) {
119
+ V8_INLINE static void MarkObjectAsFullyConstructed(const void* payload) {
110
120
  internal::MakeGarbageCollectedTraitInternal::MarkObjectAsFullyConstructed(
111
121
  payload);
112
122
  }
113
123
  };
114
124
 
125
+ /**
126
+ * Passed to MakeGarbageCollected to specify how many bytes should be appended
127
+ * to the allocated object.
128
+ *
129
+ * Example:
130
+ * \code
131
+ * class InlinedArray final : public GarbageCollected<InlinedArray> {
132
+ * public:
133
+ * explicit InlinedArray(size_t bytes) : size(bytes), byte_array(this + 1) {}
134
+ * void Trace(Visitor*) const {}
135
+
136
+ * size_t size;
137
+ * char* byte_array;
138
+ * };
139
+ *
140
+ * auto* inlined_array = MakeGarbageCollected<InlinedArray(
141
+ * GetAllocationHandle(), AdditionalBytes(4), 4);
142
+ * for (size_t i = 0; i < 4; i++) {
143
+ * Process(inlined_array->byte_array[i]);
144
+ * }
145
+ * \endcode
146
+ */
147
+ struct AdditionalBytes {
148
+ constexpr explicit AdditionalBytes(size_t bytes) : value(bytes) {}
149
+ const size_t value;
150
+ };
151
+
115
152
  /**
116
153
  * Default trait class that specifies how to construct an object of type T.
117
154
  * Advanced users may override how an object is constructed using the utilities
118
155
  * that are provided through MakeGarbageCollectedTraitBase.
119
156
  *
120
157
  * Any trait overriding construction must
121
- * - allocate through MakeGarbageCollectedTraitBase<T>::Allocate;
158
+ * - allocate through `MakeGarbageCollectedTraitBase<T>::Allocate`;
122
159
  * - mark the object as fully constructed using
123
- * MakeGarbageCollectedTraitBase<T>::MarkObjectAsFullyConstructed;
160
+ * `MakeGarbageCollectedTraitBase<T>::MarkObjectAsFullyConstructed`;
124
161
  */
125
162
  template <typename T>
126
163
  class MakeGarbageCollectedTrait : public MakeGarbageCollectedTraitBase<T> {
127
164
  public:
128
165
  template <typename... Args>
129
166
  static T* Call(AllocationHandle& handle, Args&&... args) {
130
- static_assert(internal::IsGarbageCollectedType<T>::value,
131
- "T needs to be a garbage collected object");
132
- static_assert(
133
- !internal::IsGarbageCollectedMixinType<T>::value ||
134
- sizeof(T) <= internal::api_constants::kLargeObjectSizeThreshold,
135
- "GarbageCollectedMixin may not be a large object");
136
167
  void* memory =
137
168
  MakeGarbageCollectedTraitBase<T>::Allocate(handle, sizeof(T));
138
169
  T* object = ::new (memory) T(std::forward<Args>(args)...);
139
170
  MakeGarbageCollectedTraitBase<T>::MarkObjectAsFullyConstructed(object);
140
171
  return object;
141
172
  }
173
+
174
+ template <typename... Args>
175
+ static T* Call(AllocationHandle& handle, AdditionalBytes additional_bytes,
176
+ Args&&... args) {
177
+ void* memory = MakeGarbageCollectedTraitBase<T>::Allocate(
178
+ handle, sizeof(T) + additional_bytes.value);
179
+ T* object = ::new (memory) T(std::forward<Args>(args)...);
180
+ MakeGarbageCollectedTraitBase<T>::MarkObjectAsFullyConstructed(object);
181
+ return object;
182
+ }
142
183
  };
143
184
 
144
185
  /**
@@ -168,6 +209,25 @@ T* MakeGarbageCollected(AllocationHandle& handle, Args&&... args) {
168
209
  return object;
169
210
  }
170
211
 
212
+ /**
213
+ * Constructs a managed object of type T where T transitively inherits from
214
+ * GarbageCollected. Created objects will have additional bytes appended to
215
+ * it. Allocated memory would suffice for `sizeof(T) + additional_bytes`.
216
+ *
217
+ * \param additional_bytes Denotes how many bytes to append to T.
218
+ * \param args List of arguments with which an instance of T will be
219
+ * constructed.
220
+ * \returns an instance of type T.
221
+ */
222
+ template <typename T, typename... Args>
223
+ T* MakeGarbageCollected(AllocationHandle& handle,
224
+ AdditionalBytes additional_bytes, Args&&... args) {
225
+ T* object = MakeGarbageCollectedTrait<T>::Call(handle, additional_bytes,
226
+ std::forward<Args>(args)...);
227
+ PostConstructionCallbackTrait<T>::Call(object);
228
+ return object;
229
+ }
230
+
171
231
  } // namespace cppgc
172
232
 
173
233
  #endif // INCLUDE_CPPGC_ALLOCATION_H_
@@ -10,15 +10,18 @@
10
10
 
11
11
  namespace cppgc {
12
12
 
13
- // Indicator for the stack state of the embedder.
13
+ /**
14
+ * Indicator for the stack state of the embedder.
15
+ */
14
16
  enum class EmbedderStackState {
17
+ /**
18
+ * Stack may contain interesting heap pointers.
19
+ */
15
20
  kMayContainHeapPointers,
21
+ /**
22
+ * Stack does not contain any interesting heap pointers.
23
+ */
16
24
  kNoHeapPointers,
17
- kUnknown V8_ENUM_DEPRECATE_SOON("Use kMayContainHeapPointers") =
18
- kMayContainHeapPointers,
19
- kNonEmpty V8_ENUM_DEPRECATE_SOON("Use kMayContainHeapPointers") =
20
- kMayContainHeapPointers,
21
- kEmpty V8_ENUM_DEPRECATE_SOON("Use kNoHeapPointers") = kNoHeapPointers,
22
25
  };
23
26
 
24
27
  } // namespace cppgc