libv8-node 15.12.0.0.beta1-aarch64-linux-musl → 17.9.1.0-aarch64-linux-musl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) 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 +110 -44
  7. data/vendor/v8/include/cppgc/common.h +9 -6
  8. data/vendor/v8/include/cppgc/cross-thread-persistent.h +465 -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 +4 -3
  20. data/vendor/v8/include/cppgc/internal/compiler-specific.h +2 -2
  21. data/vendor/v8/include/cppgc/internal/finalizer-trait.h +2 -0
  22. data/vendor/v8/include/cppgc/internal/gc-info.h +124 -13
  23. data/vendor/v8/include/cppgc/internal/name-trait.h +122 -0
  24. data/vendor/v8/include/cppgc/internal/persistent-node.h +94 -6
  25. data/vendor/v8/include/cppgc/internal/pointer-policies.h +81 -29
  26. data/vendor/v8/include/cppgc/internal/prefinalizer-handler.h +1 -1
  27. data/vendor/v8/include/cppgc/internal/write-barrier.h +398 -35
  28. data/vendor/v8/include/cppgc/liveness-broker.h +11 -2
  29. data/vendor/v8/include/cppgc/macros.h +2 -0
  30. data/vendor/v8/include/cppgc/member.h +87 -25
  31. data/vendor/v8/include/cppgc/name-provider.h +65 -0
  32. data/vendor/v8/include/cppgc/object-size-trait.h +58 -0
  33. data/vendor/v8/include/cppgc/persistent.h +41 -11
  34. data/vendor/v8/include/cppgc/platform.h +49 -25
  35. data/vendor/v8/include/cppgc/prefinalizer.h +2 -2
  36. data/vendor/v8/include/cppgc/process-heap-statistics.h +36 -0
  37. data/vendor/v8/include/cppgc/sentinel-pointer.h +32 -0
  38. data/vendor/v8/include/cppgc/source-location.h +2 -1
  39. data/vendor/v8/include/cppgc/testing.h +99 -0
  40. data/vendor/v8/include/cppgc/trace-trait.h +8 -3
  41. data/vendor/v8/include/cppgc/type-traits.h +157 -19
  42. data/vendor/v8/include/cppgc/visitor.h +194 -28
  43. data/vendor/v8/include/libplatform/libplatform.h +11 -0
  44. data/vendor/v8/include/libplatform/v8-tracing.h +2 -0
  45. data/vendor/v8/include/v8-array-buffer.h +433 -0
  46. data/vendor/v8/include/v8-callbacks.h +377 -0
  47. data/vendor/v8/include/v8-container.h +129 -0
  48. data/vendor/v8/include/v8-context.h +418 -0
  49. data/vendor/v8/include/v8-cppgc.h +261 -159
  50. data/vendor/v8/include/v8-data.h +65 -0
  51. data/vendor/v8/include/v8-date.h +43 -0
  52. data/vendor/v8/include/v8-debug.h +151 -0
  53. data/vendor/v8/include/v8-embedder-heap.h +238 -0
  54. data/vendor/v8/include/v8-exception.h +224 -0
  55. data/vendor/v8/include/v8-extension.h +62 -0
  56. data/vendor/v8/include/v8-external.h +37 -0
  57. data/vendor/v8/include/v8-fast-api-calls.h +652 -152
  58. data/vendor/v8/include/v8-forward.h +81 -0
  59. data/vendor/v8/include/v8-function-callback.h +475 -0
  60. data/vendor/v8/include/v8-function.h +122 -0
  61. data/vendor/v8/include/v8-initialization.h +282 -0
  62. data/vendor/v8/include/v8-inspector.h +33 -25
  63. data/vendor/v8/include/v8-internal.h +178 -31
  64. data/vendor/v8/include/v8-isolate.h +1662 -0
  65. data/vendor/v8/include/v8-json.h +47 -0
  66. data/vendor/v8/include/v8-local-handle.h +459 -0
  67. data/vendor/v8/include/v8-locker.h +148 -0
  68. data/vendor/v8/include/v8-maybe.h +137 -0
  69. data/vendor/v8/include/v8-memory-span.h +43 -0
  70. data/vendor/v8/include/v8-message.h +241 -0
  71. data/vendor/v8/include/v8-metrics.h +114 -9
  72. data/vendor/v8/include/v8-microtask-queue.h +152 -0
  73. data/vendor/v8/include/v8-microtask.h +28 -0
  74. data/vendor/v8/include/v8-object.h +770 -0
  75. data/vendor/v8/include/v8-persistent-handle.h +590 -0
  76. data/vendor/v8/include/v8-platform.h +74 -25
  77. data/vendor/v8/include/v8-primitive-object.h +118 -0
  78. data/vendor/v8/include/v8-primitive.h +858 -0
  79. data/vendor/v8/include/v8-profiler.h +72 -9
  80. data/vendor/v8/include/v8-promise.h +174 -0
  81. data/vendor/v8/include/v8-proxy.h +50 -0
  82. data/vendor/v8/include/v8-regexp.h +105 -0
  83. data/vendor/v8/include/v8-script.h +771 -0
  84. data/vendor/v8/include/v8-snapshot.h +198 -0
  85. data/vendor/v8/include/v8-statistics.h +215 -0
  86. data/vendor/v8/include/v8-template.h +1052 -0
  87. data/vendor/v8/include/v8-traced-handle.h +605 -0
  88. data/vendor/v8/include/v8-typed-array.h +282 -0
  89. data/vendor/v8/include/v8-unwinder-state.h +31 -0
  90. data/vendor/v8/include/v8-unwinder.h +129 -0
  91. data/vendor/v8/include/v8-util.h +8 -2
  92. data/vendor/v8/include/v8-value-serializer.h +249 -0
  93. data/vendor/v8/include/v8-value.h +526 -0
  94. data/vendor/v8/include/v8-version.h +3 -3
  95. data/vendor/v8/include/v8-wasm.h +245 -0
  96. data/vendor/v8/include/v8-weak-callback-info.h +73 -0
  97. data/vendor/v8/include/v8.h +41 -12050
  98. data/vendor/v8/include/v8config.h +87 -11
  99. metadata +65 -11
  100. 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: ee3bbbaeb666d2688fe98bdb07923ab8944b90c68eb25b9c57818d84282442e9
4
- data.tar.gz: 02ff219f0d746defda3da3e7b2f889b7cab349c392c3ccf97fa068481c4ed253
3
+ metadata.gz: 160103ef0c9c47d3a24afed122b4a3ffdea704ea706c02cb0a5b182f1c1ece1d
4
+ data.tar.gz: b17bc833d8f7ca0b8e3b70324956aeef95f4c286b83ebccf2e12e483c16871ba
5
5
  SHA512:
6
- metadata.gz: 9701df531bb5b9c93656af3c3fcab97ffd81307c4216e515f47bd728dbe356a8c8db7743f3fce5e447aab52a16fab1240ad79af1c053a604fe3f93c370bb7a89
7
- data.tar.gz: 633a2ccf010c5b1252ef713300453c570ff29ee51289629a1ddfd1ba54b379b813f3c8485ee6c1c52954300d911edb4acc0692b13742461928dda528f663015e
6
+ metadata.gz: 7df74564693d7c50ff45400fa9b62cc85198aa6586d8ffdab17a21edd9dfbd76a744634fb777cd52c1a482a708be50ace41dc6bd0076bf6d5d44134532a2b63f
7
+ data.tar.gz: a9dbf70a5551a848d0325ed96b58107e405f6b7b6190abf534c51acba9507b196adbab2f42d3b0c07aea783171e40937ae923ad59360beb3ce28616ac40af9e1
@@ -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? and 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.12.0.0.beta1'.freeze
5
- NODE_VERSION = '15.12.0'.freeze
6
- LIBV8_VERSION = '8.6.395.17'.freeze # from v8/include/v8-version.h
4
+ VERSION = '17.9.1.0'.freeze
5
+ NODE_VERSION = '17.9.1'.freeze
6
+ LIBV8_VERSION = '9.6.180.15'.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,37 @@ 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)));
39
+ // It's safe to split use load+store here (instead of a read-modify-write
40
+ // operation), since it's guaranteed that this 16-bit bitfield is only
41
+ // modified by a single thread. This is cheaper in terms of code bloat (on
42
+ // ARM) and performance.
42
43
  uint16_t value = atomic_mutable_bitfield->load(std::memory_order_relaxed);
43
- value = value | api_constants::kFullyConstructedBitMask;
44
+ value |= api_constants::kFullyConstructedBitMask;
44
45
  atomic_mutable_bitfield->store(value, std::memory_order_release);
45
46
  }
46
47
 
48
+ template <typename U, typename CustomSpace>
49
+ struct SpacePolicy {
50
+ static void* Allocate(AllocationHandle& handle, size_t size) {
51
+ // Custom space.
52
+ static_assert(std::is_base_of<CustomSpaceBase, CustomSpace>::value,
53
+ "Custom space must inherit from CustomSpaceBase.");
54
+ return MakeGarbageCollectedTraitInternal::Allocate(
55
+ handle, size, internal::GCInfoTrait<U>::Index(),
56
+ CustomSpace::kSpaceIndex);
57
+ }
58
+ };
59
+
60
+ template <typename U>
61
+ struct SpacePolicy<U, void> {
62
+ static void* Allocate(AllocationHandle& handle, size_t size) {
63
+ // Default space.
64
+ return MakeGarbageCollectedTraitInternal::Allocate(
65
+ handle, size, internal::GCInfoTrait<U>::Index());
66
+ }
67
+ };
68
+
69
+ private:
47
70
  static void* Allocate(cppgc::AllocationHandle& handle, size_t size,
48
71
  GCInfoIndex index);
49
72
  static void* Allocate(cppgc::AllocationHandle& handle, size_t size,
@@ -65,26 +88,12 @@ template <typename T>
65
88
  class MakeGarbageCollectedTraitBase
66
89
  : private internal::MakeGarbageCollectedTraitInternal {
67
90
  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
- };
91
+ static_assert(internal::IsGarbageCollectedType<T>::value,
92
+ "T needs to be a garbage collected object");
93
+ static_assert(!IsGarbageCollectedWithMixinTypeV<T> ||
94
+ sizeof(T) <=
95
+ internal::api_constants::kLargeObjectSizeThreshold,
96
+ "GarbageCollectedMixin may not be a large object");
88
97
 
89
98
  protected:
90
99
  /**
@@ -95,9 +104,15 @@ class MakeGarbageCollectedTraitBase
95
104
  * \param size The size that should be reserved for the object.
96
105
  * \returns the memory to construct an object of type T on.
97
106
  */
98
- static void* Allocate(AllocationHandle& handle, size_t size) {
99
- return SpacePolicy<T, typename SpaceTrait<T>::Space>::Allocate(handle,
100
- size);
107
+ V8_INLINE static void* Allocate(AllocationHandle& handle, size_t size) {
108
+ static_assert(
109
+ std::is_base_of<typename T::ParentMostGarbageCollectedType, T>::value,
110
+ "U of GarbageCollected<U> must be a base of T. Check "
111
+ "GarbageCollected<T> base class inheritance.");
112
+ return SpacePolicy<
113
+ typename internal::GCInfoFolding<
114
+ T, typename T::ParentMostGarbageCollectedType>::ResultType,
115
+ typename SpaceTrait<T>::Space>::Allocate(handle, size);
101
116
  }
102
117
 
103
118
  /**
@@ -106,39 +121,70 @@ class MakeGarbageCollectedTraitBase
106
121
  *
107
122
  * \param payload The base pointer the object is allocated at.
108
123
  */
109
- static void MarkObjectAsFullyConstructed(const void* payload) {
124
+ V8_INLINE static void MarkObjectAsFullyConstructed(const void* payload) {
110
125
  internal::MakeGarbageCollectedTraitInternal::MarkObjectAsFullyConstructed(
111
126
  payload);
112
127
  }
113
128
  };
114
129
 
130
+ /**
131
+ * Passed to MakeGarbageCollected to specify how many bytes should be appended
132
+ * to the allocated object.
133
+ *
134
+ * Example:
135
+ * \code
136
+ * class InlinedArray final : public GarbageCollected<InlinedArray> {
137
+ * public:
138
+ * explicit InlinedArray(size_t bytes) : size(bytes), byte_array(this + 1) {}
139
+ * void Trace(Visitor*) const {}
140
+
141
+ * size_t size;
142
+ * char* byte_array;
143
+ * };
144
+ *
145
+ * auto* inlined_array = MakeGarbageCollected<InlinedArray(
146
+ * GetAllocationHandle(), AdditionalBytes(4), 4);
147
+ * for (size_t i = 0; i < 4; i++) {
148
+ * Process(inlined_array->byte_array[i]);
149
+ * }
150
+ * \endcode
151
+ */
152
+ struct AdditionalBytes {
153
+ constexpr explicit AdditionalBytes(size_t bytes) : value(bytes) {}
154
+ const size_t value;
155
+ };
156
+
115
157
  /**
116
158
  * Default trait class that specifies how to construct an object of type T.
117
159
  * Advanced users may override how an object is constructed using the utilities
118
160
  * that are provided through MakeGarbageCollectedTraitBase.
119
161
  *
120
162
  * Any trait overriding construction must
121
- * - allocate through MakeGarbageCollectedTraitBase<T>::Allocate;
163
+ * - allocate through `MakeGarbageCollectedTraitBase<T>::Allocate`;
122
164
  * - mark the object as fully constructed using
123
- * MakeGarbageCollectedTraitBase<T>::MarkObjectAsFullyConstructed;
165
+ * `MakeGarbageCollectedTraitBase<T>::MarkObjectAsFullyConstructed`;
124
166
  */
125
167
  template <typename T>
126
168
  class MakeGarbageCollectedTrait : public MakeGarbageCollectedTraitBase<T> {
127
169
  public:
128
170
  template <typename... Args>
129
171
  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
172
  void* memory =
137
173
  MakeGarbageCollectedTraitBase<T>::Allocate(handle, sizeof(T));
138
174
  T* object = ::new (memory) T(std::forward<Args>(args)...);
139
175
  MakeGarbageCollectedTraitBase<T>::MarkObjectAsFullyConstructed(object);
140
176
  return object;
141
177
  }
178
+
179
+ template <typename... Args>
180
+ static T* Call(AllocationHandle& handle, AdditionalBytes additional_bytes,
181
+ Args&&... args) {
182
+ void* memory = MakeGarbageCollectedTraitBase<T>::Allocate(
183
+ handle, sizeof(T) + additional_bytes.value);
184
+ T* object = ::new (memory) T(std::forward<Args>(args)...);
185
+ MakeGarbageCollectedTraitBase<T>::MarkObjectAsFullyConstructed(object);
186
+ return object;
187
+ }
142
188
  };
143
189
 
144
190
  /**
@@ -161,13 +207,33 @@ struct PostConstructionCallbackTrait {
161
207
  * \returns an instance of type T.
162
208
  */
163
209
  template <typename T, typename... Args>
164
- T* MakeGarbageCollected(AllocationHandle& handle, Args&&... args) {
210
+ V8_INLINE T* MakeGarbageCollected(AllocationHandle& handle, Args&&... args) {
165
211
  T* object =
166
212
  MakeGarbageCollectedTrait<T>::Call(handle, std::forward<Args>(args)...);
167
213
  PostConstructionCallbackTrait<T>::Call(object);
168
214
  return object;
169
215
  }
170
216
 
217
+ /**
218
+ * Constructs a managed object of type T where T transitively inherits from
219
+ * GarbageCollected. Created objects will have additional bytes appended to
220
+ * it. Allocated memory would suffice for `sizeof(T) + additional_bytes`.
221
+ *
222
+ * \param additional_bytes Denotes how many bytes to append to T.
223
+ * \param args List of arguments with which an instance of T will be
224
+ * constructed.
225
+ * \returns an instance of type T.
226
+ */
227
+ template <typename T, typename... Args>
228
+ V8_INLINE T* MakeGarbageCollected(AllocationHandle& handle,
229
+ AdditionalBytes additional_bytes,
230
+ Args&&... args) {
231
+ T* object = MakeGarbageCollectedTrait<T>::Call(handle, additional_bytes,
232
+ std::forward<Args>(args)...);
233
+ PostConstructionCallbackTrait<T>::Call(object);
234
+ return object;
235
+ }
236
+
171
237
  } // namespace cppgc
172
238
 
173
239
  #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