libv8-node 15.14.0.1-x86_64-linux-musl → 17.9.1.0-x86_64-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/include/cppgc/allocation.h +110 -44
  6. data/vendor/v8/include/cppgc/common.h +9 -6
  7. data/vendor/v8/include/cppgc/cross-thread-persistent.h +465 -0
  8. data/vendor/v8/include/cppgc/custom-space.h +37 -2
  9. data/vendor/v8/include/cppgc/default-platform.h +47 -48
  10. data/vendor/v8/include/cppgc/ephemeron-pair.h +30 -0
  11. data/vendor/v8/include/cppgc/explicit-management.h +82 -0
  12. data/vendor/v8/include/cppgc/garbage-collected.h +4 -3
  13. data/vendor/v8/include/cppgc/heap-consistency.h +253 -0
  14. data/vendor/v8/include/cppgc/heap-state.h +70 -0
  15. data/vendor/v8/include/cppgc/heap-statistics.h +120 -0
  16. data/vendor/v8/include/cppgc/heap.h +68 -6
  17. data/vendor/v8/include/cppgc/internal/api-constants.h +3 -3
  18. data/vendor/v8/include/cppgc/internal/caged-heap-local-data.h +4 -3
  19. data/vendor/v8/include/cppgc/internal/compiler-specific.h +2 -2
  20. data/vendor/v8/include/cppgc/internal/finalizer-trait.h +2 -0
  21. data/vendor/v8/include/cppgc/internal/gc-info.h +124 -13
  22. data/vendor/v8/include/cppgc/internal/name-trait.h +122 -0
  23. data/vendor/v8/include/cppgc/internal/persistent-node.h +94 -6
  24. data/vendor/v8/include/cppgc/internal/pointer-policies.h +81 -29
  25. data/vendor/v8/include/cppgc/internal/prefinalizer-handler.h +1 -1
  26. data/vendor/v8/include/cppgc/internal/write-barrier.h +398 -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 +41 -11
  33. data/vendor/v8/include/cppgc/platform.h +49 -25
  34. data/vendor/v8/include/cppgc/prefinalizer.h +2 -2
  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-array-buffer.h +433 -0
  45. data/vendor/v8/include/v8-callbacks.h +377 -0
  46. data/vendor/v8/include/v8-container.h +129 -0
  47. data/vendor/v8/include/v8-context.h +418 -0
  48. data/vendor/v8/include/v8-cppgc.h +261 -159
  49. data/vendor/v8/include/v8-data.h +65 -0
  50. data/vendor/v8/include/v8-date.h +43 -0
  51. data/vendor/v8/include/v8-debug.h +151 -0
  52. data/vendor/v8/include/v8-embedder-heap.h +238 -0
  53. data/vendor/v8/include/v8-exception.h +224 -0
  54. data/vendor/v8/include/v8-extension.h +62 -0
  55. data/vendor/v8/include/v8-external.h +37 -0
  56. data/vendor/v8/include/v8-fast-api-calls.h +652 -152
  57. data/vendor/v8/include/v8-forward.h +81 -0
  58. data/vendor/v8/include/v8-function-callback.h +475 -0
  59. data/vendor/v8/include/v8-function.h +122 -0
  60. data/vendor/v8/include/v8-initialization.h +282 -0
  61. data/vendor/v8/include/v8-inspector.h +33 -25
  62. data/vendor/v8/include/v8-internal.h +178 -31
  63. data/vendor/v8/include/v8-isolate.h +1662 -0
  64. data/vendor/v8/include/v8-json.h +47 -0
  65. data/vendor/v8/include/v8-local-handle.h +459 -0
  66. data/vendor/v8/include/v8-locker.h +148 -0
  67. data/vendor/v8/include/v8-maybe.h +137 -0
  68. data/vendor/v8/include/v8-memory-span.h +43 -0
  69. data/vendor/v8/include/v8-message.h +241 -0
  70. data/vendor/v8/include/v8-metrics.h +114 -9
  71. data/vendor/v8/include/v8-microtask-queue.h +152 -0
  72. data/vendor/v8/include/v8-microtask.h +28 -0
  73. data/vendor/v8/include/v8-object.h +770 -0
  74. data/vendor/v8/include/v8-persistent-handle.h +590 -0
  75. data/vendor/v8/include/v8-platform.h +74 -25
  76. data/vendor/v8/include/v8-primitive-object.h +118 -0
  77. data/vendor/v8/include/v8-primitive.h +858 -0
  78. data/vendor/v8/include/v8-profiler.h +72 -9
  79. data/vendor/v8/include/v8-promise.h +174 -0
  80. data/vendor/v8/include/v8-proxy.h +50 -0
  81. data/vendor/v8/include/v8-regexp.h +105 -0
  82. data/vendor/v8/include/v8-script.h +771 -0
  83. data/vendor/v8/include/v8-snapshot.h +198 -0
  84. data/vendor/v8/include/v8-statistics.h +215 -0
  85. data/vendor/v8/include/v8-template.h +1052 -0
  86. data/vendor/v8/include/v8-traced-handle.h +605 -0
  87. data/vendor/v8/include/v8-typed-array.h +282 -0
  88. data/vendor/v8/include/v8-unwinder-state.h +31 -0
  89. data/vendor/v8/include/v8-unwinder.h +129 -0
  90. data/vendor/v8/include/v8-util.h +8 -2
  91. data/vendor/v8/include/v8-value-serializer.h +249 -0
  92. data/vendor/v8/include/v8-value.h +526 -0
  93. data/vendor/v8/include/v8-version.h +3 -3
  94. data/vendor/v8/include/v8-wasm.h +245 -0
  95. data/vendor/v8/include/v8-weak-callback-info.h +73 -0
  96. data/vendor/v8/include/v8.h +41 -12050
  97. data/vendor/v8/include/v8config.h +87 -11
  98. data/vendor/v8/{out.gn → x86_64-linux-musl}/libv8/obj/libv8_monolith.a +0 -0
  99. metadata +63 -9
  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: 29fe178b4ec30d5e628603b40d1dcf62eee02d2dac0a17dd26cd8dce79d03a98
4
- data.tar.gz: 6846aab2bf6bc89c752757b94fa13432177dd18d1640f130745475fb4c08db2f
3
+ metadata.gz: f881c722e94fda67770e5199d1004c2bd177e0faff582ea66f893b43e7f300c1
4
+ data.tar.gz: d7bfd5eb634fbcd9b2966a479a08350c1e6783a273af74ec689589a09b526172
5
5
  SHA512:
6
- metadata.gz: 320b141c203ab99e610737b2088707402ab6ab04184d8187385fef4857a340f1a71b4a7f597bc695e80890672165a15265c0c8e44652a6e9a59922c1af1448d0
7
- data.tar.gz: 2ed3aa3624064dfc02742c40c8a4804eece1138c5de62f79624e826c09b54085a0931b2b7bf1e7b109447c1b998c32959c79ea95e04d1e6cb859bdec0db3c0c1
6
+ metadata.gz: 05cf7086eacdfe2376fde096e3371dc86e921b836715e6096b4f7639c98630705bfe492f27b6cede24b3e39699a000356f03b1aa349a5c3d849adf067356a92a
7
+ data.tar.gz: 5c45fb73e16a2bbfe6ab07951b4a8ed0990e58a4827ff9f7f7fc0be77c20bff8a1cbe5be08b32f3a242a6406cc196bfb7040d7d656452ffd793ccde033eb4c33
@@ -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.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 = '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