libv8-node 16.10.0.0-aarch64-linux → 16.17.0.0-aarch64-linux

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0279ccf47c72d2103d12a6b36d8cdc283fd3473a564d62f09833459c4fc360b8'
4
- data.tar.gz: a9bf4c0d98f68d326ec09da7fd86778349d840a21f9e7253c165249fdd790dc0
3
+ metadata.gz: c4776300e0f83433d96d9540c27fe333b6bf7a372a6a89c239f0c54cc8f7d287
4
+ data.tar.gz: c0a134477182ccaf444ce6f29b32ae4e8ffdd4c0c5d7f12bd9093991be8867ac
5
5
  SHA512:
6
- metadata.gz: 3ff85cf23f4426b3fb0f12d573bb01de9d61dbe156320369e14d15a6c6e4b5e497d6ddad593bfff78242aee343aa08707e653287942768170c40f77ea4a84c1c
7
- data.tar.gz: 8836f0362c99d8988dcf449c803b85f56bddb6a2e09d24db567a3a8dac3d9f19a6dabecd4cd34ce66c360a83e5ba277825d7061146fb500b8450867d5be0f6df
6
+ metadata.gz: 6f5ca75e0f2c3a348af1aa1eb9812fc2980b68c1140da3f453ba843a1c65e90539e5949b0ca99a528995f183a6b6bc030d7d570209ef1a45c7b41a48c86729e4
7
+ data.tar.gz: 16af19a60bbd4c689c8f6d4a7be1d4e7f1bb2b9f28413933dba740bcf6dc87234418ded508d4ddc7149b502bd11eff585187b96b5384481b114218e8ef19249a
@@ -13,12 +13,16 @@ module Libv8::Node
13
13
 
14
14
  def object_paths
15
15
  [Shellwords.escape(File.join(vendored_source_path,
16
- Gem::Platform.local.to_s,
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 = '16.10.0.0'.freeze
5
- NODE_VERSION = '16.10.0'.freeze
6
- LIBV8_VERSION = '9.3.345.19'.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
@@ -10,6 +10,7 @@
10
10
  #include <cstdint>
11
11
  #include <new>
12
12
  #include <type_traits>
13
+ #include <utility>
13
14
 
14
15
  #include "cppgc/custom-space.h"
15
16
  #include "cppgc/internal/api-constants.h"
@@ -13,12 +13,34 @@
13
13
  #include "cppgc/visitor.h"
14
14
 
15
15
  namespace cppgc {
16
-
17
16
  namespace internal {
18
17
 
18
+ // Wrapper around PersistentBase that allows accessing poisoned memory when
19
+ // using ASAN. This is needed as the GC of the heap that owns the value
20
+ // of a CTP, may clear it (heap termination, weakness) while the object
21
+ // holding the CTP may be poisoned as itself may be deemed dead.
22
+ class CrossThreadPersistentBase : public PersistentBase {
23
+ public:
24
+ CrossThreadPersistentBase() = default;
25
+ explicit CrossThreadPersistentBase(const void* raw) : PersistentBase(raw) {}
26
+
27
+ V8_CLANG_NO_SANITIZE("address") const void* GetValueFromGC() const {
28
+ return raw_;
29
+ }
30
+
31
+ V8_CLANG_NO_SANITIZE("address")
32
+ PersistentNode* GetNodeFromGC() const { return node_; }
33
+
34
+ V8_CLANG_NO_SANITIZE("address")
35
+ void ClearFromGC() const {
36
+ raw_ = nullptr;
37
+ node_ = nullptr;
38
+ }
39
+ };
40
+
19
41
  template <typename T, typename WeaknessPolicy, typename LocationPolicy,
20
42
  typename CheckingPolicy>
21
- class BasicCrossThreadPersistent final : public PersistentBase,
43
+ class BasicCrossThreadPersistent final : public CrossThreadPersistentBase,
22
44
  public LocationPolicy,
23
45
  private WeaknessPolicy,
24
46
  private CheckingPolicy {
@@ -38,11 +60,11 @@ class BasicCrossThreadPersistent final : public PersistentBase,
38
60
 
39
61
  BasicCrossThreadPersistent(
40
62
  SentinelPointer s, const SourceLocation& loc = SourceLocation::Current())
41
- : PersistentBase(s), LocationPolicy(loc) {}
63
+ : CrossThreadPersistentBase(s), LocationPolicy(loc) {}
42
64
 
43
65
  BasicCrossThreadPersistent(
44
66
  T* raw, const SourceLocation& loc = SourceLocation::Current())
45
- : PersistentBase(raw), LocationPolicy(loc) {
67
+ : CrossThreadPersistentBase(raw), LocationPolicy(loc) {
46
68
  if (!IsValid(raw)) return;
47
69
  PersistentRegionLock guard;
48
70
  CrossThreadPersistentRegion& region = this->GetPersistentRegion(raw);
@@ -61,7 +83,7 @@ class BasicCrossThreadPersistent final : public PersistentBase,
61
83
  BasicCrossThreadPersistent(
62
84
  UnsafeCtorTag, T* raw,
63
85
  const SourceLocation& loc = SourceLocation::Current())
64
- : PersistentBase(raw), LocationPolicy(loc) {
86
+ : CrossThreadPersistentBase(raw), LocationPolicy(loc) {
65
87
  if (!IsValid(raw)) return;
66
88
  CrossThreadPersistentRegion& region = this->GetPersistentRegion(raw);
67
89
  SetNode(region.AllocateNode(this, &Trace));
@@ -329,12 +351,19 @@ class BasicCrossThreadPersistent final : public PersistentBase,
329
351
  }
330
352
 
331
353
  void ClearFromGC() const {
332
- if (IsValid(GetValue())) {
333
- WeaknessPolicy::GetPersistentRegion(GetValue()).FreeNode(GetNode());
334
- PersistentBase::ClearFromGC();
354
+ if (IsValid(GetValueFromGC())) {
355
+ WeaknessPolicy::GetPersistentRegion(GetValueFromGC())
356
+ .FreeNode(GetNodeFromGC());
357
+ CrossThreadPersistentBase::ClearFromGC();
335
358
  }
336
359
  }
337
360
 
361
+ // See Get() for details.
362
+ V8_CLANG_NO_SANITIZE("cfi-unrelated-cast")
363
+ T* GetFromGC() const {
364
+ return static_cast<T*>(const_cast<void*>(GetValueFromGC()));
365
+ }
366
+
338
367
  friend class cppgc::Visitor;
339
368
  };
340
369
 
@@ -68,6 +68,23 @@ class HeapConsistency final {
68
68
  return internal::WriteBarrier::GetWriteBarrierType(slot, params, callback);
69
69
  }
70
70
 
71
+ /**
72
+ * Gets the required write barrier type for a specific write.
73
+ * This version is meant to be used in conjunction with with a marking write
74
+ * barrier barrier which doesn't consider the slot.
75
+ *
76
+ * \param value The pointer to the object. May be an interior pointer to an
77
+ * interface of the actual object.
78
+ * \param params Parameters that may be used for actual write barrier calls.
79
+ * Only filled if return value indicates that a write barrier is needed. The
80
+ * contents of the `params` are an implementation detail.
81
+ * \returns whether a write barrier is needed and which barrier to invoke.
82
+ */
83
+ static V8_INLINE WriteBarrierType
84
+ GetWriteBarrierType(const void* value, WriteBarrierParams& params) {
85
+ return internal::WriteBarrier::GetWriteBarrierType(value, params);
86
+ }
87
+
71
88
  /**
72
89
  * Conservative Dijkstra-style write barrier that processes an object if it
73
90
  * has not yet been processed.
@@ -75,7 +75,7 @@ class PersistentNode final {
75
75
  TraceCallback trace_ = nullptr;
76
76
  };
77
77
 
78
- class V8_EXPORT PersistentRegion final {
78
+ class V8_EXPORT PersistentRegion {
79
79
  using PersistentNodeSlots = std::array<PersistentNode, 256u>;
80
80
 
81
81
  public:
@@ -116,6 +116,9 @@ class V8_EXPORT PersistentRegion final {
116
116
  private:
117
117
  void EnsureNodeSlots();
118
118
 
119
+ template <typename PersistentBaseClass>
120
+ void ClearAllUsedNodes();
121
+
119
122
  std::vector<std::unique_ptr<PersistentNodeSlots>> nodes_;
120
123
  PersistentNode* free_list_head_ = nullptr;
121
124
  size_t nodes_in_use_ = 0;
@@ -135,7 +138,7 @@ class V8_EXPORT PersistentRegionLock final {
135
138
 
136
139
  // Variant of PersistentRegion that checks whether the PersistentRegionLock is
137
140
  // locked.
138
- class V8_EXPORT CrossThreadPersistentRegion final {
141
+ class V8_EXPORT CrossThreadPersistentRegion final : protected PersistentRegion {
139
142
  public:
140
143
  CrossThreadPersistentRegion() = default;
141
144
  // Clears Persistent fields to avoid stale pointers after heap teardown.
@@ -147,12 +150,12 @@ class V8_EXPORT CrossThreadPersistentRegion final {
147
150
 
148
151
  V8_INLINE PersistentNode* AllocateNode(void* owner, TraceCallback trace) {
149
152
  PersistentRegionLock::AssertLocked();
150
- return persistent_region_.AllocateNode(owner, trace);
153
+ return PersistentRegion::AllocateNode(owner, trace);
151
154
  }
152
155
 
153
156
  V8_INLINE void FreeNode(PersistentNode* node) {
154
157
  PersistentRegionLock::AssertLocked();
155
- persistent_region_.FreeNode(node);
158
+ PersistentRegion::FreeNode(node);
156
159
  }
157
160
 
158
161
  void Trace(Visitor*);
@@ -160,9 +163,6 @@ class V8_EXPORT CrossThreadPersistentRegion final {
160
163
  size_t NodesInUse() const;
161
164
 
162
165
  void ClearAllUsedNodes();
163
-
164
- private:
165
- PersistentRegion persistent_region_;
166
166
  };
167
167
 
168
168
  } // namespace internal
@@ -11,6 +11,7 @@
11
11
  #include "cppgc/heap-state.h"
12
12
  #include "cppgc/internal/api-constants.h"
13
13
  #include "cppgc/internal/atomic-entry-flag.h"
14
+ #include "cppgc/platform.h"
14
15
  #include "cppgc/sentinel-pointer.h"
15
16
  #include "cppgc/trace-trait.h"
16
17
  #include "v8config.h" // NOLINT(build/include_directory)
@@ -66,6 +67,8 @@ class V8_EXPORT WriteBarrier final {
66
67
  template <typename HeapHandleCallback>
67
68
  static V8_INLINE Type GetWriteBarrierType(const void* slot, Params& params,
68
69
  HeapHandleCallback callback);
70
+ // Returns the required write barrier for a given `value`.
71
+ static V8_INLINE Type GetWriteBarrierType(const void* value, Params& params);
69
72
 
70
73
  template <typename HeapHandleCallback>
71
74
  static V8_INLINE Type GetWriteBarrierTypeForExternallyReferencedObject(
@@ -147,9 +150,27 @@ class V8_EXPORT WriteBarrierTypeForCagedHeapPolicy final {
147
150
  return ValueModeDispatch<value_mode>::Get(slot, value, params, callback);
148
151
  }
149
152
 
153
+ template <WriteBarrier::ValueMode value_mode, typename HeapHandleCallback>
154
+ static V8_INLINE WriteBarrier::Type Get(const void* value,
155
+ WriteBarrier::Params& params,
156
+ HeapHandleCallback callback) {
157
+ return GetNoSlot(value, params, callback);
158
+ }
159
+
150
160
  template <typename HeapHandleCallback>
151
161
  static V8_INLINE WriteBarrier::Type GetForExternallyReferenced(
152
- const void* value, WriteBarrier::Params& params, HeapHandleCallback) {
162
+ const void* value, WriteBarrier::Params& params,
163
+ HeapHandleCallback callback) {
164
+ return GetNoSlot(value, params, callback);
165
+ }
166
+
167
+ private:
168
+ WriteBarrierTypeForCagedHeapPolicy() = delete;
169
+
170
+ template <typename HeapHandleCallback>
171
+ static V8_INLINE WriteBarrier::Type GetNoSlot(const void* value,
172
+ WriteBarrier::Params& params,
173
+ HeapHandleCallback) {
153
174
  if (!TryGetCagedHeap(value, value, params)) {
154
175
  return WriteBarrier::Type::kNone;
155
176
  }
@@ -159,14 +180,14 @@ class V8_EXPORT WriteBarrierTypeForCagedHeapPolicy final {
159
180
  return SetAndReturnType<WriteBarrier::Type::kNone>(params);
160
181
  }
161
182
 
162
- private:
163
- WriteBarrierTypeForCagedHeapPolicy() = delete;
164
-
165
183
  template <WriteBarrier::ValueMode value_mode>
166
184
  struct ValueModeDispatch;
167
185
 
168
186
  static V8_INLINE bool TryGetCagedHeap(const void* slot, const void* value,
169
187
  WriteBarrier::Params& params) {
188
+ // TODO(chromium:1056170): Check if the null check can be folded in with
189
+ // the rest of the write barrier.
190
+ if (!value) return false;
170
191
  params.start = reinterpret_cast<uintptr_t>(value) &
171
192
  ~(api_constants::kCagedHeapReservationAlignment - 1);
172
193
  const uintptr_t slot_offset =
@@ -257,6 +278,15 @@ class V8_EXPORT WriteBarrierTypeForNonCagedHeapPolicy final {
257
278
  return ValueModeDispatch<value_mode>::Get(slot, value, params, callback);
258
279
  }
259
280
 
281
+ template <WriteBarrier::ValueMode value_mode, typename HeapHandleCallback>
282
+ static V8_INLINE WriteBarrier::Type Get(const void* value,
283
+ WriteBarrier::Params& params,
284
+ HeapHandleCallback callback) {
285
+ // The slot will never be used in `Get()` below.
286
+ return Get<WriteBarrier::ValueMode::kValuePresent>(nullptr, value, params,
287
+ callback);
288
+ }
289
+
260
290
  template <typename HeapHandleCallback>
261
291
  static V8_INLINE WriteBarrier::Type GetForExternallyReferenced(
262
292
  const void* value, WriteBarrier::Params& params,
@@ -330,6 +360,13 @@ WriteBarrier::Type WriteBarrier::GetWriteBarrierType(
330
360
  slot, nullptr, params, callback);
331
361
  }
332
362
 
363
+ // static
364
+ WriteBarrier::Type WriteBarrier::GetWriteBarrierType(
365
+ const void* value, WriteBarrier::Params& params) {
366
+ return WriteBarrierTypePolicy::Get<ValueMode::kValuePresent>(value, params,
367
+ []() {});
368
+ }
369
+
333
370
  // static
334
371
  template <typename HeapHandleCallback>
335
372
  WriteBarrier::Type
@@ -44,7 +44,10 @@ class V8_EXPORT LivenessBroker final {
44
44
  public:
45
45
  template <typename T>
46
46
  bool IsHeapObjectAlive(const T* object) const {
47
- return object &&
47
+ // nullptr objects are considered alive to allow weakness to be used from
48
+ // stack while running into a conservative GC. Treating nullptr as dead
49
+ // would mean that e.g. custom collectins could not be strongified on stack.
50
+ return !object ||
48
51
  IsHeapObjectAliveImpl(
49
52
  TraceTrait<T>::GetTraceDescriptor(object).base_object_payload);
50
53
  }
@@ -218,6 +218,8 @@ class BasicMember final : private MemberBase, private CheckingPolicy {
218
218
 
219
219
  void ClearFromGC() const { MemberBase::ClearFromGC(); }
220
220
 
221
+ T* GetFromGC() const { return Get(); }
222
+
221
223
  friend class cppgc::Visitor;
222
224
  template <typename U>
223
225
  friend struct cppgc::TraceTrait;
@@ -41,7 +41,7 @@ class PersistentBase {
41
41
  node_ = nullptr;
42
42
  }
43
43
 
44
- private:
44
+ protected:
45
45
  mutable const void* raw_ = nullptr;
46
46
  mutable PersistentNode* node_ = nullptr;
47
47
 
@@ -259,6 +259,12 @@ class BasicPersistent final : public PersistentBase,
259
259
  }
260
260
  }
261
261
 
262
+ // Set Get() for details.
263
+ V8_CLANG_NO_SANITIZE("cfi-unrelated-cast")
264
+ T* GetFromGC() const {
265
+ return static_cast<T*>(const_cast<void*>(GetValue()));
266
+ }
267
+
262
268
  friend class cppgc::Visitor;
263
269
  };
264
270
 
@@ -148,6 +148,7 @@ namespace internal {
148
148
  V8_EXPORT void Abort();
149
149
 
150
150
  } // namespace internal
151
+
151
152
  } // namespace cppgc
152
153
 
153
154
  #endif // INCLUDE_CPPGC_PLATFORM_H_
@@ -12,6 +12,7 @@
12
12
  #include "cppgc/internal/pointer-policies.h"
13
13
  #include "cppgc/liveness-broker.h"
14
14
  #include "cppgc/member.h"
15
+ #include "cppgc/sentinel-pointer.h"
15
16
  #include "cppgc/source-location.h"
16
17
  #include "cppgc/trace-trait.h"
17
18
  #include "cppgc/type-traits.h"
@@ -318,10 +319,10 @@ class V8_EXPORT Visitor {
318
319
  template <typename PointerType>
319
320
  static void HandleWeak(const LivenessBroker& info, const void* object) {
320
321
  const PointerType* weak = static_cast<const PointerType*>(object);
322
+ auto* raw_ptr = weak->GetFromGC();
321
323
  // Sentinel values are preserved for weak pointers.
322
- if (*weak == kSentinelPointer) return;
323
- const auto* raw = weak->Get();
324
- if (!info.IsHeapObjectAlive(raw)) {
324
+ if (raw_ptr == kSentinelPointer) return;
325
+ if (!info.IsHeapObjectAlive(raw_ptr)) {
325
326
  weak->ClearFromGC();
326
327
  }
327
328
  }
@@ -335,11 +336,11 @@ class V8_EXPORT Visitor {
335
336
  static_assert(internal::IsGarbageCollectedOrMixinType<PointeeType>::value,
336
337
  "Persistent's pointee type must be GarbageCollected or "
337
338
  "GarbageCollectedMixin");
338
- if (!p.Get()) {
339
+ auto* ptr = p.GetFromGC();
340
+ if (!ptr) {
339
341
  return;
340
342
  }
341
- VisitRoot(p.Get(), TraceTrait<PointeeType>::GetTraceDescriptor(p.Get()),
342
- loc);
343
+ VisitRoot(ptr, TraceTrait<PointeeType>::GetTraceDescriptor(ptr), loc);
343
344
  }
344
345
 
345
346
  template <
@@ -354,7 +355,8 @@ class V8_EXPORT Visitor {
354
355
  "GarbageCollectedMixin");
355
356
  static_assert(!internal::IsAllocatedOnCompactableSpace<PointeeType>::value,
356
357
  "Weak references to compactable objects are not allowed");
357
- VisitWeakRoot(p.Get(), TraceTrait<PointeeType>::GetTraceDescriptor(p.Get()),
358
+ auto* ptr = p.GetFromGC();
359
+ VisitWeakRoot(ptr, TraceTrait<PointeeType>::GetTraceDescriptor(ptr),
358
360
  &HandleWeak<WeakPersistent>, &p, loc);
359
361
  }
360
362
 
@@ -225,8 +225,9 @@
225
225
  #include <tuple>
226
226
  #include <type_traits>
227
227
 
228
- #include "v8.h" // NOLINT(build/include_directory)
229
- #include "v8config.h" // NOLINT(build/include_directory)
228
+ #include "v8-internal.h" // NOLINT(build/include_directory)
229
+ #include "v8.h" // NOLINT(build/include_directory)
230
+ #include "v8config.h" // NOLINT(build/include_directory)
230
231
 
231
232
  namespace v8 {
232
233
 
@@ -298,10 +299,36 @@ class CTypeInfo {
298
299
  Flags flags_;
299
300
  };
300
301
 
302
+ struct FastApiTypedArrayBase {
303
+ public:
304
+ // Returns the length in number of elements.
305
+ size_t V8_EXPORT length() const { return length_; }
306
+ // Checks whether the given index is within the bounds of the collection.
307
+ void V8_EXPORT ValidateIndex(size_t index) const;
308
+
309
+ protected:
310
+ size_t length_ = 0;
311
+ };
312
+
301
313
  template <typename T>
302
- struct FastApiTypedArray {
303
- T* data; // should include the typed array offset applied
304
- size_t length; // length in number of elements
314
+ struct FastApiTypedArray : public FastApiTypedArrayBase {
315
+ public:
316
+ V8_INLINE T get(size_t index) const {
317
+ #ifdef DEBUG
318
+ ValidateIndex(index);
319
+ #endif // DEBUG
320
+ T tmp;
321
+ memcpy(&tmp, reinterpret_cast<T*>(data_) + index, sizeof(T));
322
+ return tmp;
323
+ }
324
+
325
+ private:
326
+ // This pointer should include the typed array offset applied.
327
+ // It's not guaranteed that it's aligned to sizeof(T), it's only
328
+ // guaranteed that it's 4-byte aligned, so for 8-byte types we need to
329
+ // provide a special implementation for reading from it, which hides
330
+ // the possibly unaligned read in the `get` method.
331
+ void* data_;
305
332
  };
306
333
 
307
334
  // Any TypedArray. It uses kTypedArrayBit with base type void
@@ -578,7 +605,7 @@ PRIMITIVE_C_TYPES(DEFINE_TYPE_INFO_TRAITS)
578
605
 
579
606
  #define SPECIALIZE_GET_TYPE_INFO_HELPER_FOR_TA(T, Enum) \
580
607
  template <> \
581
- struct TypeInfoHelper<FastApiTypedArray<T>> { \
608
+ struct TypeInfoHelper<const FastApiTypedArray<T>&> { \
582
609
  static constexpr CTypeInfo::Flags Flags() { \
583
610
  return CTypeInfo::Flags::kNone; \
584
611
  } \
@@ -770,6 +797,10 @@ CFunction CFunction::ArgUnwrap<R (*)(Args...)>::Make(R (*func)(Args...)) {
770
797
 
771
798
  using CFunctionBuilder = internal::CFunctionBuilder;
772
799
 
800
+ static constexpr CTypeInfo kTypeInfoInt32 = CTypeInfo(CTypeInfo::Type::kInt32);
801
+ static constexpr CTypeInfo kTypeInfoFloat64 =
802
+ CTypeInfo(CTypeInfo::Type::kFloat64);
803
+
773
804
  /**
774
805
  * Copies the contents of this JavaScript array to a C++ buffer with
775
806
  * a given max_length. A CTypeInfo is passed as an argument,
@@ -783,8 +814,22 @@ using CFunctionBuilder = internal::CFunctionBuilder;
783
814
  * returns true on success. `type_info` will be used for conversions.
784
815
  */
785
816
  template <const CTypeInfo* type_info, typename T>
786
- bool CopyAndConvertArrayToCppBuffer(Local<Array> src, T* dst,
787
- uint32_t max_length);
817
+ bool V8_EXPORT V8_WARN_UNUSED_RESULT TryCopyAndConvertArrayToCppBuffer(
818
+ Local<Array> src, T* dst, uint32_t max_length);
819
+
820
+ template <>
821
+ inline bool V8_WARN_UNUSED_RESULT
822
+ TryCopyAndConvertArrayToCppBuffer<&kTypeInfoInt32, int32_t>(
823
+ Local<Array> src, int32_t* dst, uint32_t max_length) {
824
+ return CopyAndConvertArrayToCppBufferInt32(src, dst, max_length);
825
+ }
826
+
827
+ template <>
828
+ inline bool V8_WARN_UNUSED_RESULT
829
+ TryCopyAndConvertArrayToCppBuffer<&kTypeInfoFloat64, double>(
830
+ Local<Array> src, double* dst, uint32_t max_length) {
831
+ return CopyAndConvertArrayToCppBufferFloat64(src, dst, max_length);
832
+ }
788
833
 
789
834
  } // namespace v8
790
835
 
@@ -194,9 +194,6 @@ class V8_EXPORT V8InspectorClient {
194
194
  v8::Local<v8::Context>, v8::Local<v8::Value>) {
195
195
  return nullptr;
196
196
  }
197
- virtual bool formatAccessorsAsProperties(v8::Local<v8::Value>) {
198
- return false;
199
- }
200
197
  virtual bool isInspectableHeapObject(v8::Local<v8::Object>) { return true; }
201
198
 
202
199
  virtual v8::Local<v8::Context> ensureDefaultContextInGroup(
@@ -15,9 +15,12 @@
15
15
 
16
16
  namespace v8 {
17
17
 
18
+ class Array;
18
19
  class Context;
19
20
  class Data;
20
21
  class Isolate;
22
+ template <typename T>
23
+ class Local;
21
24
 
22
25
  namespace internal {
23
26
 
@@ -494,6 +497,15 @@ V8_INLINE void PerformCastCheck(T* data) {
494
497
  class BackingStoreBase {};
495
498
 
496
499
  } // namespace internal
500
+
501
+ V8_EXPORT bool CopyAndConvertArrayToCppBufferInt32(Local<Array> src,
502
+ int32_t* dst,
503
+ uint32_t max_length);
504
+
505
+ V8_EXPORT bool CopyAndConvertArrayToCppBufferFloat64(Local<Array> src,
506
+ double* dst,
507
+ uint32_t max_length);
508
+
497
509
  } // namespace v8
498
510
 
499
511
  #endif // INCLUDE_V8_INTERNAL_H_
@@ -9,9 +9,9 @@
9
9
  // NOTE these macros are used by some of the tool scripts and the build
10
10
  // system so their names cannot be changed without changing the scripts.
11
11
  #define V8_MAJOR_VERSION 9
12
- #define V8_MINOR_VERSION 3
13
- #define V8_BUILD_NUMBER 345
14
- #define V8_PATCH_LEVEL 19
12
+ #define V8_MINOR_VERSION 4
13
+ #define V8_BUILD_NUMBER 146
14
+ #define V8_PATCH_LEVEL 26
15
15
 
16
16
  // Use 1 for candidates and 0 otherwise.
17
17
  // (Boolean macro values are not supported by all preprocessors.)
@@ -1441,7 +1441,7 @@ class ScriptOriginOptions {
1441
1441
  class ScriptOrigin {
1442
1442
  public:
1443
1443
  #if defined(_MSC_VER) && _MSC_VER >= 1910 /* Disable on VS2015 */
1444
- V8_DEPRECATE_SOON("Use constructor with primitive C++ types")
1444
+ V8_DEPRECATED("Use constructor with primitive C++ types")
1445
1445
  #endif
1446
1446
  V8_INLINE explicit ScriptOrigin(
1447
1447
  Local<Value> resource_name, Local<Integer> resource_line_offset,
@@ -1454,7 +1454,7 @@ class ScriptOrigin {
1454
1454
  Local<Boolean> is_module = Local<Boolean>(),
1455
1455
  Local<PrimitiveArray> host_defined_options = Local<PrimitiveArray>());
1456
1456
  #if defined(_MSC_VER) && _MSC_VER >= 1910 /* Disable on VS2015 */
1457
- V8_DEPRECATE_SOON("Use constructor that takes an isolate")
1457
+ V8_DEPRECATED("Use constructor that takes an isolate")
1458
1458
  #endif
1459
1459
  V8_INLINE explicit ScriptOrigin(
1460
1460
  Local<Value> resource_name, int resource_line_offset = 0,
@@ -1474,11 +1474,11 @@ class ScriptOrigin {
1474
1474
  Local<PrimitiveArray> host_defined_options = Local<PrimitiveArray>());
1475
1475
 
1476
1476
  V8_INLINE Local<Value> ResourceName() const;
1477
- V8_DEPRECATE_SOON("Use getter with primitvie C++ types.")
1477
+ V8_DEPRECATED("Use getter with primitvie C++ types.")
1478
1478
  V8_INLINE Local<Integer> ResourceLineOffset() const;
1479
- V8_DEPRECATE_SOON("Use getter with primitvie C++ types.")
1479
+ V8_DEPRECATED("Use getter with primitvie C++ types.")
1480
1480
  V8_INLINE Local<Integer> ResourceColumnOffset() const;
1481
- V8_DEPRECATE_SOON("Use getter with primitvie C++ types.")
1481
+ V8_DEPRECATED("Use getter with primitvie C++ types.")
1482
1482
  V8_INLINE Local<Integer> ScriptID() const;
1483
1483
  V8_INLINE int LineOffset() const;
1484
1484
  V8_INLINE int ColumnOffset() const;
@@ -1630,14 +1630,14 @@ class V8_EXPORT Module : public Data {
1630
1630
  /**
1631
1631
  * Returns the number of modules requested by this module.
1632
1632
  */
1633
- V8_DEPRECATE_SOON("Use Module::GetModuleRequests() and FixedArray::Length().")
1633
+ V8_DEPRECATED("Use Module::GetModuleRequests() and FixedArray::Length().")
1634
1634
  int GetModuleRequestsLength() const;
1635
1635
 
1636
1636
  /**
1637
1637
  * Returns the ith module specifier in this module.
1638
1638
  * i must be < GetModuleRequestsLength() and >= 0.
1639
1639
  */
1640
- V8_DEPRECATE_SOON(
1640
+ V8_DEPRECATED(
1641
1641
  "Use Module::GetModuleRequests() and ModuleRequest::GetSpecifier().")
1642
1642
  Local<String> GetModuleRequest(int i) const;
1643
1643
 
@@ -1645,7 +1645,7 @@ class V8_EXPORT Module : public Data {
1645
1645
  * Returns the source location (line number and column number) of the ith
1646
1646
  * module specifier's first occurrence in this module.
1647
1647
  */
1648
- V8_DEPRECATE_SOON(
1648
+ V8_DEPRECATED(
1649
1649
  "Use Module::GetModuleRequests(), ModuleRequest::GetSourceOffset(), and "
1650
1650
  "Module::SourceOffsetToLocation().")
1651
1651
  Location GetModuleRequestLocation(int i) const;
@@ -1680,7 +1680,7 @@ class V8_EXPORT Module : public Data {
1680
1680
  * instantiation. (In the case where the callback throws an exception, that
1681
1681
  * exception is propagated.)
1682
1682
  */
1683
- V8_DEPRECATE_SOON(
1683
+ V8_DEPRECATED(
1684
1684
  "Use the version of InstantiateModule that takes a ResolveModuleCallback "
1685
1685
  "parameter")
1686
1686
  V8_WARN_UNUSED_RESULT Maybe<bool> InstantiateModule(Local<Context> context,
@@ -4311,11 +4311,13 @@ class V8_EXPORT Object : public Value {
4311
4311
  /**
4312
4312
  * Returns the context in which the object was created.
4313
4313
  */
4314
+ // TODO(chromium:1166077): Mark as deprecate once users are updated.
4314
4315
  V8_DEPRECATE_SOON("Use MaybeLocal<Context> GetCreationContext()")
4315
4316
  Local<Context> CreationContext();
4316
4317
  MaybeLocal<Context> GetCreationContext();
4317
4318
 
4318
4319
  /** Same as above, but works for Persistents */
4320
+ // TODO(chromium:1166077): Mark as deprecate once users are updated.
4319
4321
  V8_DEPRECATE_SOON(
4320
4322
  "Use MaybeLocal<Context> GetCreationContext(const "
4321
4323
  "PersistentBase<Object>& object)")
@@ -7507,7 +7509,9 @@ using MessageCallback = void (*)(Local<Message> message, Local<Value> data);
7507
7509
 
7508
7510
  // --- Tracing ---
7509
7511
 
7510
- using LogEventCallback = void (*)(const char* name, int event);
7512
+ enum LogEventStatus : int { kStart = 0, kEnd = 1, kStamp = 2 };
7513
+ using LogEventCallback = void (*)(const char* name,
7514
+ int /* LogEventStatus */ status);
7511
7515
 
7512
7516
  /**
7513
7517
  * Create new error objects by calling the corresponding error object
@@ -8973,7 +8977,7 @@ class V8_EXPORT Isolate {
8973
8977
  * This specifies the callback called by the upcoming dynamic
8974
8978
  * import() language feature to load modules.
8975
8979
  */
8976
- V8_DEPRECATE_SOON(
8980
+ V8_DEPRECATED(
8977
8981
  "Use the version of SetHostImportModuleDynamicallyCallback that takes a "
8978
8982
  "HostImportModuleDynamicallyWithImportAssertionsCallback instead")
8979
8983
  void SetHostImportModuleDynamicallyCallback(
@@ -86,51 +86,80 @@ path. Add it with -I<path> to the command line
86
86
  # define V8_OS_ANDROID 1
87
87
  # define V8_OS_LINUX 1
88
88
  # define V8_OS_POSIX 1
89
+ # define V8_OS_STRING "android"
90
+
89
91
  #elif defined(__APPLE__)
90
92
  # define V8_OS_BSD 1
91
93
  # define V8_OS_MACOSX 1
92
94
  # define V8_OS_POSIX 1
93
95
  # if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
94
96
  # define V8_OS_IOS 1
97
+ # define V8_OS_STRING "ios"
98
+ # else
99
+ # define V8_OS_STRING "macos"
95
100
  # endif // defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
101
+
96
102
  #elif defined(__CYGWIN__)
97
103
  # define V8_OS_CYGWIN 1
98
104
  # define V8_OS_POSIX 1
105
+ # define V8_OS_STRING "cygwin"
106
+
99
107
  #elif defined(__linux__)
100
108
  # define V8_OS_LINUX 1
101
109
  # define V8_OS_POSIX 1
110
+ # define V8_OS_STRING "linux"
111
+
102
112
  #elif defined(__sun)
103
113
  # define V8_OS_POSIX 1
104
114
  # define V8_OS_SOLARIS 1
115
+ # define V8_OS_STRING "sun"
116
+
105
117
  #elif defined(STARBOARD)
106
118
  # define V8_OS_STARBOARD 1
119
+ # define V8_OS_STRING "starboard"
120
+
107
121
  #elif defined(_AIX)
108
- #define V8_OS_POSIX 1
109
- #define V8_OS_AIX 1
122
+ # define V8_OS_POSIX 1
123
+ # define V8_OS_AIX 1
124
+ # define V8_OS_STRING "aix"
125
+
110
126
  #elif defined(__FreeBSD__)
111
127
  # define V8_OS_BSD 1
112
128
  # define V8_OS_FREEBSD 1
113
129
  # define V8_OS_POSIX 1
130
+ # define V8_OS_STRING "freebsd"
131
+
114
132
  #elif defined(__Fuchsia__)
115
133
  # define V8_OS_FUCHSIA 1
116
134
  # define V8_OS_POSIX 1
135
+ # define V8_OS_STRING "fuchsia"
136
+
117
137
  #elif defined(__DragonFly__)
118
138
  # define V8_OS_BSD 1
119
139
  # define V8_OS_DRAGONFLYBSD 1
120
140
  # define V8_OS_POSIX 1
141
+ # define V8_OS_STRING "dragonflybsd"
142
+
121
143
  #elif defined(__NetBSD__)
122
144
  # define V8_OS_BSD 1
123
145
  # define V8_OS_NETBSD 1
124
146
  # define V8_OS_POSIX 1
147
+ # define V8_OS_STRING "netbsd"
148
+
125
149
  #elif defined(__OpenBSD__)
126
150
  # define V8_OS_BSD 1
127
151
  # define V8_OS_OPENBSD 1
128
152
  # define V8_OS_POSIX 1
153
+ # define V8_OS_STRING "openbsd"
154
+
129
155
  #elif defined(__QNXNTO__)
130
156
  # define V8_OS_POSIX 1
131
157
  # define V8_OS_QNX 1
158
+ # define V8_OS_STRING "qnx"
159
+
132
160
  #elif defined(_WIN32)
133
161
  # define V8_OS_WIN 1
162
+ # define V8_OS_STRING "windows"
134
163
  #endif
135
164
 
136
165
  // -----------------------------------------------------------------------------
@@ -195,6 +224,22 @@ path. Add it with -I<path> to the command line
195
224
 
196
225
  #endif // V8_HAVE_TARGET_OS
197
226
 
227
+ #if defined(V8_TARGET_OS_ANDROID)
228
+ # define V8_TARGET_OS_STRING "android"
229
+ #elif defined(V8_TARGET_OS_FUCHSIA)
230
+ # define V8_TARGET_OS_STRING "fuchsia"
231
+ #elif defined(V8_TARGET_OS_IOS)
232
+ # define V8_TARGET_OS_STRING "ios"
233
+ #elif defined(V8_TARGET_OS_LINUX)
234
+ # define V8_TARGET_OS_STRING "linux"
235
+ #elif defined(V8_TARGET_OS_MACOSX)
236
+ # define V8_TARGET_OS_STRING "macos"
237
+ #elif defined(V8_TARGET_OS_WINDOWS)
238
+ # define V8_TARGET_OS_STRING "windows"
239
+ #else
240
+ # define V8_TARGET_OS_STRING "unknown"
241
+ #endif
242
+
198
243
  // -----------------------------------------------------------------------------
199
244
  // C library detection
200
245
  //
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libv8-node
3
3
  version: !ruby/object:Gem::Version
4
- version: 16.10.0.0
4
+ version: 16.17.0.0
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - ''
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-17 00:00:00.000000000 Z
11
+ date: 2022-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -111,7 +111,7 @@ files:
111
111
  - vendor/v8/include/v8-wasm-trap-handler-win.h
112
112
  - vendor/v8/include/v8.h
113
113
  - vendor/v8/include/v8config.h
114
- homepage: https://github.com/sqreen/ruby-libv8-node
114
+ homepage: https://github.com/rubyjs/libv8-node
115
115
  licenses:
116
116
  - MIT
117
117
  metadata: {}