libv8-node 15.14.0.0-x86_64-linux → 16.17.0.0-x86_64-linux

Sign up to get free protection for your applications and to get access to all the features.
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/include/cppgc/allocation.h +105 -45
  6. data/vendor/v8/include/cppgc/common.h +9 -6
  7. data/vendor/v8/include/cppgc/cross-thread-persistent.h +413 -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 +2 -1
  19. data/vendor/v8/include/cppgc/internal/compiler-specific.h +2 -2
  20. data/vendor/v8/include/cppgc/internal/gc-info.h +44 -13
  21. data/vendor/v8/include/cppgc/internal/name-trait.h +111 -0
  22. data/vendor/v8/include/cppgc/internal/persistent-node.h +58 -2
  23. data/vendor/v8/include/cppgc/internal/pointer-policies.h +69 -28
  24. data/vendor/v8/include/cppgc/internal/prefinalizer-handler.h +1 -1
  25. data/vendor/v8/include/cppgc/internal/write-barrier.h +390 -35
  26. data/vendor/v8/include/cppgc/liveness-broker.h +11 -2
  27. data/vendor/v8/include/cppgc/macros.h +2 -0
  28. data/vendor/v8/include/cppgc/member.h +87 -25
  29. data/vendor/v8/include/cppgc/name-provider.h +65 -0
  30. data/vendor/v8/include/cppgc/object-size-trait.h +58 -0
  31. data/vendor/v8/include/cppgc/persistent.h +40 -10
  32. data/vendor/v8/include/cppgc/platform.h +49 -25
  33. data/vendor/v8/include/cppgc/prefinalizer.h +1 -1
  34. data/vendor/v8/include/cppgc/process-heap-statistics.h +36 -0
  35. data/vendor/v8/include/cppgc/sentinel-pointer.h +32 -0
  36. data/vendor/v8/include/cppgc/source-location.h +2 -1
  37. data/vendor/v8/include/cppgc/testing.h +99 -0
  38. data/vendor/v8/include/cppgc/trace-trait.h +8 -3
  39. data/vendor/v8/include/cppgc/type-traits.h +157 -19
  40. data/vendor/v8/include/cppgc/visitor.h +194 -28
  41. data/vendor/v8/include/libplatform/libplatform.h +11 -0
  42. data/vendor/v8/include/libplatform/v8-tracing.h +2 -0
  43. data/vendor/v8/include/v8-cppgc.h +258 -159
  44. data/vendor/v8/include/v8-fast-api-calls.h +603 -155
  45. data/vendor/v8/include/v8-inspector.h +22 -4
  46. data/vendor/v8/include/v8-internal.h +111 -27
  47. data/vendor/v8/include/v8-metrics.h +77 -8
  48. data/vendor/v8/include/v8-platform.h +47 -22
  49. data/vendor/v8/include/v8-profiler.h +75 -11
  50. data/vendor/v8/include/v8-unwinder-state.h +30 -0
  51. data/vendor/v8/include/v8-util.h +1 -1
  52. data/vendor/v8/include/v8-version.h +4 -4
  53. data/vendor/v8/include/v8.h +1196 -642
  54. data/vendor/v8/include/v8config.h +87 -11
  55. data/vendor/v8/{out.gn → x86_64-linux}/libv8/obj/libv8_monolith.a +0 -0
  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: 2d90c6922cfbb874cfbab49196da9f2dce177d7e6420dff64efc80d269f5de8f
4
- data.tar.gz: 107a8a03b899d8684d67727d4a74f1e087faa61ad75f7ca8757c62072407fb23
3
+ metadata.gz: d8416be4dee0bf256f8935836ee0c18b1274ca8dc6eacef1be2f5096f47f2164
4
+ data.tar.gz: 3db2c830f7f1463baa6782a3002b3f4004ef4c49b233d800f048d0bcf79d59df
5
5
  SHA512:
6
- metadata.gz: 4f116fb73b254d66429a72a98e98d38aa79baa10d2824aafc8b7c15d8650a1ab4af411ff0bf135f29838fd594d473ed6642ee10237d1710726db37367d817327
7
- data.tar.gz: fef3e6a3407f00e761d7f3fd178adfeb893877f4e7c502d34353d75e19d26398ebb241f6544691b302bbb5b68dbb83b7bfe20197dfc08d7cacb56bd7a13fccd5
6
+ metadata.gz: 9c9c66d051e1a1a706c6bd281914fc484171093f750b8c7d30af2a4c482d73628a12236d1b4a6833aceb933d4a0cc663ee14250477f24ad65f1a438288fae6dc
7
+ data.tar.gz: 5aede2315cd8087fa21388ba3d3c675cc13b0f7e51be5ad37453b996440f2cc29329a614fc7f6898b14785c520e3ec87a7f14f9e1c5044d89beab550015c00a5
@@ -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.0'.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