libv8-node 19.9.0.0-x86_64-darwin → 20.12.1.0-x86_64-darwin

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/lib/libv8/node/version.rb +3 -3
  3. data/vendor/v8/include/cppgc/cross-thread-persistent.h +4 -2
  4. data/vendor/v8/include/cppgc/heap-consistency.h +2 -2
  5. data/vendor/v8/include/cppgc/heap-handle.h +5 -0
  6. data/vendor/v8/include/cppgc/internal/api-constants.h +4 -1
  7. data/vendor/v8/include/cppgc/internal/gc-info.h +35 -33
  8. data/vendor/v8/include/cppgc/internal/member-storage.h +19 -7
  9. data/vendor/v8/include/cppgc/internal/pointer-policies.h +38 -2
  10. data/vendor/v8/include/cppgc/internal/write-barrier.h +15 -5
  11. data/vendor/v8/include/cppgc/macros.h +10 -1
  12. data/vendor/v8/include/cppgc/member.h +167 -129
  13. data/vendor/v8/include/cppgc/persistent.h +22 -15
  14. data/vendor/v8/include/cppgc/platform.h +6 -4
  15. data/vendor/v8/include/cppgc/type-traits.h +4 -3
  16. data/vendor/v8/include/cppgc/visitor.h +16 -1
  17. data/vendor/v8/include/libplatform/v8-tracing.h +2 -2
  18. data/vendor/v8/include/v8-array-buffer.h +59 -0
  19. data/vendor/v8/include/v8-callbacks.h +14 -1
  20. data/vendor/v8/include/v8-context.h +50 -3
  21. data/vendor/v8/include/v8-cppgc.h +15 -0
  22. data/vendor/v8/include/v8-data.h +1 -1
  23. data/vendor/v8/include/v8-embedder-heap.h +0 -169
  24. data/vendor/v8/include/v8-fast-api-calls.h +7 -3
  25. data/vendor/v8/include/v8-function-callback.h +69 -42
  26. data/vendor/v8/include/v8-function.h +1 -0
  27. data/vendor/v8/include/v8-inspector.h +20 -5
  28. data/vendor/v8/include/v8-internal.h +242 -150
  29. data/vendor/v8/include/v8-isolate.h +30 -40
  30. data/vendor/v8/include/v8-local-handle.h +81 -48
  31. data/vendor/v8/include/v8-metrics.h +28 -2
  32. data/vendor/v8/include/v8-microtask-queue.h +5 -0
  33. data/vendor/v8/include/v8-object.h +38 -3
  34. data/vendor/v8/include/v8-persistent-handle.h +25 -16
  35. data/vendor/v8/include/v8-platform.h +79 -10
  36. data/vendor/v8/include/v8-primitive.h +19 -12
  37. data/vendor/v8/include/v8-profiler.h +59 -31
  38. data/vendor/v8/include/v8-script.h +32 -5
  39. data/vendor/v8/include/v8-snapshot.h +4 -8
  40. data/vendor/v8/include/v8-template.h +3 -1
  41. data/vendor/v8/include/v8-traced-handle.h +22 -28
  42. data/vendor/v8/include/v8-util.h +9 -3
  43. data/vendor/v8/include/v8-value.h +31 -4
  44. data/vendor/v8/include/v8-version.h +4 -4
  45. data/vendor/v8/include/v8-wasm.h +2 -1
  46. data/vendor/v8/include/v8config.h +73 -2
  47. data/vendor/v8/x86_64-darwin/libv8/obj/libv8_monolith.a +0 -0
  48. metadata +3 -3
@@ -62,7 +62,8 @@ class TracedReferenceBase {
62
62
  */
63
63
  V8_INLINE v8::Local<v8::Value> Get(v8::Isolate* isolate) const {
64
64
  if (IsEmpty()) return Local<Value>();
65
- return Local<Value>::New(isolate, reinterpret_cast<Value*>(val_));
65
+ return Local<Value>::New(isolate,
66
+ internal::ValueHelper::SlotAsValue<Value>(val_));
66
67
  }
67
68
 
68
69
  /**
@@ -103,10 +104,13 @@ class TracedReferenceBase {
103
104
 
104
105
  V8_EXPORT void CheckValue() const;
105
106
 
107
+ V8_INLINE internal::Address address() const { return *val_; }
108
+
106
109
  // val_ points to a GlobalHandles node.
107
110
  internal::Address* val_ = nullptr;
108
111
 
109
112
  friend class internal::BasicTracedReferenceExtractor;
113
+ friend class internal::HandleHelper;
110
114
  template <typename F>
111
115
  friend class Local;
112
116
  template <typename U>
@@ -117,11 +121,11 @@ class TracedReferenceBase {
117
121
 
118
122
  /**
119
123
  * A traced handle with copy and move semantics. The handle is to be used
120
- * together with |v8::EmbedderHeapTracer| or as part of GarbageCollected objects
121
- * (see v8-cppgc.h) and specifies edges from C++ objects to JavaScript.
124
+ * together as part of GarbageCollected objects (see v8-cppgc.h) or from stack
125
+ * and specifies edges from C++ objects to JavaScript.
122
126
  *
123
127
  * The exact semantics are:
124
- * - Tracing garbage collections use |v8::EmbedderHeapTracer| or cppgc.
128
+ * - Tracing garbage collections using CppHeap.
125
129
  * - Non-tracing garbage collections refer to
126
130
  * |v8::EmbedderRootsHandler::IsRoot()| whether the handle should
127
131
  * be treated as root or not.
@@ -135,7 +139,12 @@ class BasicTracedReference : public TracedReferenceBase {
135
139
  /**
136
140
  * Construct a Local<T> from this handle.
137
141
  */
138
- Local<T> Get(Isolate* isolate) const { return Local<T>::New(isolate, *this); }
142
+ Local<T> Get(Isolate* isolate) const {
143
+ #ifdef V8_ENABLE_CONSERVATIVE_STACK_SCANNING
144
+ if (val_ == nullptr) return Local<T>();
145
+ #endif
146
+ return Local<T>::New(isolate, *this);
147
+ }
139
148
 
140
149
  template <class S>
141
150
  V8_INLINE BasicTracedReference<S>& As() const {
@@ -166,7 +175,6 @@ class BasicTracedReference : public TracedReferenceBase {
166
175
  Isolate* isolate, T* that, void* slot,
167
176
  internal::GlobalHandleStoreMode store_mode);
168
177
 
169
- friend class EmbedderHeapTracer;
170
178
  template <typename F>
171
179
  friend class Local;
172
180
  friend class Object;
@@ -181,13 +189,7 @@ class BasicTracedReference : public TracedReferenceBase {
181
189
  /**
182
190
  * A traced handle without destructor that clears the handle. The embedder needs
183
191
  * to ensure that the handle is not accessed once the V8 object has been
184
- * reclaimed. This can happen when the handle is not passed through the
185
- * EmbedderHeapTracer. For more details see BasicTracedReference.
186
- *
187
- * The reference assumes the embedder has precise knowledge about references at
188
- * all times. In case V8 needs to separately handle on-stack references, the
189
- * embedder is required to set the stack start through
190
- * |EmbedderHeapTracer::SetStackStart|.
192
+ * reclaimed. For more details see BasicTracedReference.
191
193
  */
192
194
  template <typename T>
193
195
  class TracedReference : public BasicTracedReference<T> {
@@ -207,7 +209,7 @@ class TracedReference : public BasicTracedReference<T> {
207
209
  */
208
210
  template <class S>
209
211
  TracedReference(Isolate* isolate, Local<S> that) : BasicTracedReference<T>() {
210
- this->val_ = this->New(isolate, that.val_, &this->val_,
212
+ this->val_ = this->New(isolate, *that, &this->val_,
211
213
  internal::GlobalHandleStoreMode::kInitializingStore);
212
214
  static_assert(std::is_base_of<T, S>::value, "type check");
213
215
  }
@@ -291,7 +293,7 @@ template <class T>
291
293
  internal::Address* BasicTracedReference<T>::New(
292
294
  Isolate* isolate, T* that, void* slot,
293
295
  internal::GlobalHandleStoreMode store_mode) {
294
- if (that == nullptr) return nullptr;
296
+ if (that == internal::ValueHelper::EmptyValue<T>()) return nullptr;
295
297
  internal::Address* p = reinterpret_cast<internal::Address*>(that);
296
298
  return internal::GlobalizeTracedReference(
297
299
  reinterpret_cast<internal::Isolate*>(isolate), p,
@@ -306,21 +308,13 @@ void TracedReferenceBase::Reset() {
306
308
 
307
309
  V8_INLINE bool operator==(const TracedReferenceBase& lhs,
308
310
  const TracedReferenceBase& rhs) {
309
- v8::internal::Address* a = reinterpret_cast<v8::internal::Address*>(lhs.val_);
310
- v8::internal::Address* b = reinterpret_cast<v8::internal::Address*>(rhs.val_);
311
- if (a == nullptr) return b == nullptr;
312
- if (b == nullptr) return false;
313
- return *a == *b;
311
+ return internal::HandleHelper::EqualHandles(lhs, rhs);
314
312
  }
315
313
 
316
314
  template <typename U>
317
315
  V8_INLINE bool operator==(const TracedReferenceBase& lhs,
318
316
  const v8::Local<U>& rhs) {
319
- v8::internal::Address* a = reinterpret_cast<v8::internal::Address*>(lhs.val_);
320
- v8::internal::Address* b = reinterpret_cast<v8::internal::Address*>(*rhs);
321
- if (a == nullptr) return b == nullptr;
322
- if (b == nullptr) return false;
323
- return *a == *b;
317
+ return internal::HandleHelper::EqualHandles(lhs, rhs);
324
318
  }
325
319
 
326
320
  template <typename U>
@@ -353,7 +347,7 @@ void TracedReference<T>::Reset(Isolate* isolate, const Local<S>& other) {
353
347
  this->Reset();
354
348
  if (other.IsEmpty()) return;
355
349
  this->SetSlotThreadSafe(
356
- this->New(isolate, other.val_, &this->val_,
350
+ this->New(isolate, *other, &this->val_,
357
351
  internal::GlobalHandleStoreMode::kAssigningStore));
358
352
  }
359
353
 
@@ -403,7 +397,7 @@ void TracedReferenceBase::SetWrapperClassId(uint16_t class_id) {
403
397
  using I = internal::Internals;
404
398
  if (IsEmpty()) return;
405
399
  internal::Address* obj = reinterpret_cast<internal::Address*>(val_);
406
- uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + I::kNodeClassIdOffset;
400
+ uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + I::kTracedNodeClassIdOffset;
407
401
  *reinterpret_cast<uint16_t*>(addr) = class_id;
408
402
  }
409
403
 
@@ -411,7 +405,7 @@ uint16_t TracedReferenceBase::WrapperClassId() const {
411
405
  using I = internal::Internals;
412
406
  if (IsEmpty()) return 0;
413
407
  internal::Address* obj = reinterpret_cast<internal::Address*>(val_);
414
- uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + I::kNodeClassIdOffset;
408
+ uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + I::kTracedNodeClassIdOffset;
415
409
  return *reinterpret_cast<uint16_t*>(addr);
416
410
  }
417
411
 
@@ -181,7 +181,11 @@ class PersistentValueMapBase {
181
181
  * Get value stored in map.
182
182
  */
183
183
  Local<V> Get(const K& key) {
184
- return Local<V>::New(isolate_, FromVal(Traits::Get(&impl_, key)));
184
+ V* p = FromVal(Traits::Get(&impl_, key));
185
+ #ifdef V8_ENABLE_CONSERVATIVE_STACK_SCANNING
186
+ if (p == nullptr) return Local<V>();
187
+ #endif
188
+ return Local<V>::New(isolate_, p);
185
189
  }
186
190
 
187
191
  /**
@@ -236,7 +240,8 @@ class PersistentValueMapBase {
236
240
  : value_(other.value_) { }
237
241
 
238
242
  Local<V> NewLocal(Isolate* isolate) const {
239
- return Local<V>::New(isolate, FromVal(value_));
243
+ return Local<V>::New(
244
+ isolate, internal::ValueHelper::SlotAsValue<V>(FromVal(value_)));
240
245
  }
241
246
  bool IsEmpty() const {
242
247
  return value_ == kPersistentContainerNotFound;
@@ -613,7 +618,8 @@ class V8_DEPRECATE_SOON("Use std::vector<Global<V>>.") PersistentValueVector {
613
618
  * Retrieve the i-th value in the vector.
614
619
  */
615
620
  Local<V> Get(size_t index) const {
616
- return Local<V>::New(isolate_, FromVal(Traits::Get(&impl_, index)));
621
+ return Local<V>::New(isolate_, internal::ValueHelper::SlotAsValue<V>(
622
+ FromVal(Traits::Get(&impl_, index))));
617
623
  }
618
624
 
619
625
  /**
@@ -244,6 +244,11 @@ class V8_EXPORT Value : public Data {
244
244
  */
245
245
  bool IsWeakSet() const;
246
246
 
247
+ /**
248
+ * Returns true if this value is a WeakRef.
249
+ */
250
+ bool IsWeakRef() const;
251
+
247
252
  /**
248
253
  * Returns true if this value is an ArrayBuffer.
249
254
  */
@@ -339,6 +344,11 @@ class V8_EXPORT Value : public Data {
339
344
  */
340
345
  bool IsWasmModuleObject() const;
341
346
 
347
+ /**
348
+ * Returns true if this value is the WasmNull object.
349
+ */
350
+ bool IsWasmNull() const;
351
+
342
352
  /**
343
353
  * Returns true if the value is a Module Namespace Object.
344
354
  */
@@ -464,10 +474,14 @@ bool Value::IsUndefined() const {
464
474
  bool Value::QuickIsUndefined() const {
465
475
  using A = internal::Address;
466
476
  using I = internal::Internals;
467
- A obj = *reinterpret_cast<const A*>(this);
477
+ A obj = internal::ValueHelper::ValueAsAddress(this);
478
+ #if V8_STATIC_ROOTS_BOOL
479
+ return I::is_identical(obj, I::StaticReadOnlyRoot::kUndefinedValue);
480
+ #else
468
481
  if (!I::HasHeapObjectTag(obj)) return false;
469
482
  if (I::GetInstanceType(obj) != I::kOddballType) return false;
470
483
  return (I::GetOddballKind(obj) == I::kUndefinedOddballKind);
484
+ #endif // V8_STATIC_ROOTS_BOOL
471
485
  }
472
486
 
473
487
  bool Value::IsNull() const {
@@ -481,10 +495,14 @@ bool Value::IsNull() const {
481
495
  bool Value::QuickIsNull() const {
482
496
  using A = internal::Address;
483
497
  using I = internal::Internals;
484
- A obj = *reinterpret_cast<const A*>(this);
498
+ A obj = internal::ValueHelper::ValueAsAddress(this);
499
+ #if V8_STATIC_ROOTS_BOOL
500
+ return I::is_identical(obj, I::StaticReadOnlyRoot::kNullValue);
501
+ #else
485
502
  if (!I::HasHeapObjectTag(obj)) return false;
486
503
  if (I::GetInstanceType(obj) != I::kOddballType) return false;
487
504
  return (I::GetOddballKind(obj) == I::kNullOddballKind);
505
+ #endif // V8_STATIC_ROOTS_BOOL
488
506
  }
489
507
 
490
508
  bool Value::IsNullOrUndefined() const {
@@ -496,13 +514,17 @@ bool Value::IsNullOrUndefined() const {
496
514
  }
497
515
 
498
516
  bool Value::QuickIsNullOrUndefined() const {
517
+ #if V8_STATIC_ROOTS_BOOL
518
+ return QuickIsNull() || QuickIsUndefined();
519
+ #else
499
520
  using A = internal::Address;
500
521
  using I = internal::Internals;
501
- A obj = *reinterpret_cast<const A*>(this);
522
+ A obj = internal::ValueHelper::ValueAsAddress(this);
502
523
  if (!I::HasHeapObjectTag(obj)) return false;
503
524
  if (I::GetInstanceType(obj) != I::kOddballType) return false;
504
525
  int kind = I::GetOddballKind(obj);
505
526
  return kind == I::kNullOddballKind || kind == I::kUndefinedOddballKind;
527
+ #endif // V8_STATIC_ROOTS_BOOL
506
528
  }
507
529
 
508
530
  bool Value::IsString() const {
@@ -516,9 +538,14 @@ bool Value::IsString() const {
516
538
  bool Value::QuickIsString() const {
517
539
  using A = internal::Address;
518
540
  using I = internal::Internals;
519
- A obj = *reinterpret_cast<const A*>(this);
541
+ A obj = internal::ValueHelper::ValueAsAddress(this);
520
542
  if (!I::HasHeapObjectTag(obj)) return false;
543
+ #if V8_STATIC_ROOTS_BOOL && !V8_MAP_PACKING
544
+ return I::CheckInstanceMapRange(obj, I::StaticReadOnlyRoot::kFirstStringMap,
545
+ I::StaticReadOnlyRoot::kLastStringMap);
546
+ #else
521
547
  return (I::GetInstanceType(obj) < I::kFirstNonstringType);
548
+ #endif // V8_STATIC_ROOTS_BOOL
522
549
  }
523
550
 
524
551
  } // namespace v8
@@ -8,10 +8,10 @@
8
8
  // These macros define the version number for the current version.
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
- #define V8_MAJOR_VERSION 10
12
- #define V8_MINOR_VERSION 8
13
- #define V8_BUILD_NUMBER 168
14
- #define V8_PATCH_LEVEL 25
11
+ #define V8_MAJOR_VERSION 11
12
+ #define V8_MINOR_VERSION 3
13
+ #define V8_BUILD_NUMBER 244
14
+ #define V8_PATCH_LEVEL 8
15
15
 
16
16
  // Use 1 for candidates and 0 otherwise.
17
17
  // (Boolean macro values are not supported by all preprocessors.)
@@ -144,7 +144,7 @@ class V8_EXPORT WasmStreaming final {
144
144
  /**
145
145
  * {Finish} should be called after all received bytes where passed to
146
146
  * {OnBytesReceived} to tell V8 that there will be no more bytes. {Finish}
147
- * does not have to be called after {Abort} has been called already.
147
+ * must not be called after {Abort} has been called already.
148
148
  * If {can_use_compiled_module} is true and {SetCompiledModuleBytes} was
149
149
  * previously called, the compiled module bytes can be used.
150
150
  * If {can_use_compiled_module} is false, the compiled module bytes previously
@@ -156,6 +156,7 @@ class V8_EXPORT WasmStreaming final {
156
156
  * Abort streaming compilation. If {exception} has a value, then the promise
157
157
  * associated with streaming compilation is rejected with that value. If
158
158
  * {exception} does not have value, the promise does not get rejected.
159
+ * {Abort} must not be called repeatedly, or after {Finish}.
159
160
  */
160
161
  void Abort(MaybeLocal<Value> exception);
161
162
 
@@ -173,6 +173,7 @@ path. Add it with -I<path> to the command line
173
173
  // V8_TARGET_OS_LINUX
174
174
  // V8_TARGET_OS_MACOS
175
175
  // V8_TARGET_OS_WIN
176
+ // V8_TARGET_OS_CHROMEOS
176
177
  //
177
178
  // If not set explicitly, these fall back to corresponding V8_OS_ values.
178
179
 
@@ -184,7 +185,8 @@ path. Add it with -I<path> to the command line
184
185
  && !defined(V8_TARGET_OS_IOS) \
185
186
  && !defined(V8_TARGET_OS_LINUX) \
186
187
  && !defined(V8_TARGET_OS_MACOS) \
187
- && !defined(V8_TARGET_OS_WIN)
188
+ && !defined(V8_TARGET_OS_WIN) \
189
+ && !defined(V8_TARGET_OS_CHROMEOS)
188
190
  # error No known target OS defined.
189
191
  # endif
190
192
 
@@ -195,7 +197,8 @@ path. Add it with -I<path> to the command line
195
197
  || defined(V8_TARGET_OS_IOS) \
196
198
  || defined(V8_TARGET_OS_LINUX) \
197
199
  || defined(V8_TARGET_OS_MACOS) \
198
- || defined(V8_TARGET_OS_WIN)
200
+ || defined(V8_TARGET_OS_WIN) \
201
+ || defined(V8_TARGET_OS_CHROMEOS)
199
202
  # error A target OS is defined but V8_HAVE_TARGET_OS is unset.
200
203
  # endif
201
204
 
@@ -288,6 +291,9 @@ path. Add it with -I<path> to the command line
288
291
  //
289
292
  // V8_HAS_ATTRIBUTE_ALWAYS_INLINE - __attribute__((always_inline))
290
293
  // supported
294
+ // V8_HAS_ATTRIBUTE_CONSTINIT - __attribute__((require_constant_
295
+ // initialization))
296
+ // supported
291
297
  // V8_HAS_ATTRIBUTE_NONNULL - __attribute__((nonnull)) supported
292
298
  // V8_HAS_ATTRIBUTE_NOINLINE - __attribute__((noinline)) supported
293
299
  // V8_HAS_ATTRIBUTE_UNUSED - __attribute__((unused)) supported
@@ -305,6 +311,9 @@ path. Add it with -I<path> to the command line
305
311
  // V8_HAS_BUILTIN_EXPECT - __builtin_expect() supported
306
312
  // V8_HAS_BUILTIN_FRAME_ADDRESS - __builtin_frame_address() supported
307
313
  // V8_HAS_BUILTIN_POPCOUNT - __builtin_popcount() supported
314
+ // V8_HAS_BUILTIN_ADD_OVERFLOW - __builtin_add_overflow() supported
315
+ // V8_HAS_BUILTIN_SUB_OVERFLOW - __builtin_sub_overflow() supported
316
+ // V8_HAS_BUILTIN_MUL_OVERFLOW - __builtin_mul_overflow() supported
308
317
  // V8_HAS_BUILTIN_SADD_OVERFLOW - __builtin_sadd_overflow() supported
309
318
  // V8_HAS_BUILTIN_SSUB_OVERFLOW - __builtin_ssub_overflow() supported
310
319
  // V8_HAS_BUILTIN_UADD_OVERFLOW - __builtin_uadd_overflow() supported
@@ -334,9 +343,27 @@ path. Add it with -I<path> to the command line
334
343
  #endif
335
344
 
336
345
  # define V8_HAS_ATTRIBUTE_ALWAYS_INLINE (__has_attribute(always_inline))
346
+ # define V8_HAS_ATTRIBUTE_CONSTINIT \
347
+ (__has_attribute(require_constant_initialization))
348
+ # define V8_HAS_ATTRIBUTE_CONST (__has_attribute(const))
337
349
  # define V8_HAS_ATTRIBUTE_NONNULL (__has_attribute(nonnull))
338
350
  # define V8_HAS_ATTRIBUTE_NOINLINE (__has_attribute(noinline))
339
351
  # define V8_HAS_ATTRIBUTE_UNUSED (__has_attribute(unused))
352
+ // Support for the "preserve_most" attribute is limited:
353
+ // - 32-bit platforms do not implement it,
354
+ // - component builds fail because _dl_runtime_resolve clobbers registers,
355
+ // - we see crashes on arm64 on Windows (https://crbug.com/1409934), which can
356
+ // hopefully be fixed in the future.
357
+ // Additionally, the initial implementation in clang <= 16 overwrote the return
358
+ // register(s) in the epilogue of a preserve_most function, so we only use
359
+ // preserve_most in clang >= 17 (see https://reviews.llvm.org/D143425).
360
+ #if (defined(_M_X64) || defined(__x86_64__) /* x64 (everywhere) */ \
361
+ || ((defined(__AARCH64EL__) || defined(_M_ARM64)) /* arm64, but ... */ \
362
+ && !defined(_WIN32))) /* not on windows */ \
363
+ && !defined(COMPONENT_BUILD) /* no component build */\
364
+ && __clang_major__ >= 17 /* clang >= 17 */
365
+ # define V8_HAS_ATTRIBUTE_PRESERVE_MOST (__has_attribute(preserve_most))
366
+ #endif
340
367
  # define V8_HAS_ATTRIBUTE_VISIBILITY (__has_attribute(visibility))
341
368
  # define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT \
342
369
  (__has_attribute(warn_unused_result))
@@ -355,6 +382,9 @@ path. Add it with -I<path> to the command line
355
382
  # define V8_HAS_BUILTIN_EXPECT (__has_builtin(__builtin_expect))
356
383
  # define V8_HAS_BUILTIN_FRAME_ADDRESS (__has_builtin(__builtin_frame_address))
357
384
  # define V8_HAS_BUILTIN_POPCOUNT (__has_builtin(__builtin_popcount))
385
+ # define V8_HAS_BUILTIN_ADD_OVERFLOW (__has_builtin(__builtin_add_overflow))
386
+ # define V8_HAS_BUILTIN_SUB_OVERFLOW (__has_builtin(__builtin_sub_overflow))
387
+ # define V8_HAS_BUILTIN_MUL_OVERFLOW (__has_builtin(__builtin_mul_overflow))
358
388
  # define V8_HAS_BUILTIN_SADD_OVERFLOW (__has_builtin(__builtin_sadd_overflow))
359
389
  # define V8_HAS_BUILTIN_SSUB_OVERFLOW (__has_builtin(__builtin_ssub_overflow))
360
390
  # define V8_HAS_BUILTIN_UADD_OVERFLOW (__has_builtin(__builtin_uadd_overflow))
@@ -450,6 +480,26 @@ path. Add it with -I<path> to the command line
450
480
  #endif
451
481
 
452
482
 
483
+ // A macro to mark functions whose values don't change (e.g. across calls)
484
+ // and thereby compiler is free to hoist and fold multiple calls together.
485
+ // Use like:
486
+ // V8_CONST int foo() { ... }
487
+ #if V8_HAS_ATTRIBUTE_CONST
488
+ # define V8_CONST __attribute__((const))
489
+ #else
490
+ # define V8_CONST
491
+ #endif
492
+
493
+ // A macro to mark a declaration as requiring constant initialization.
494
+ // Use like:
495
+ // int* foo V8_CONSTINIT;
496
+ #if V8_HAS_ATTRIBUTE_CONSTINIT
497
+ # define V8_CONSTINIT __attribute__((require_constant_initialization))
498
+ #else
499
+ # define V8_CONSTINIT
500
+ #endif
501
+
502
+
453
503
  // A macro to mark specific arguments as non-null.
454
504
  // Use like:
455
505
  // int add(int* x, int y, int* z) V8_NONNULL(1, 3) { return *x + y + *z; }
@@ -472,6 +522,21 @@ path. Add it with -I<path> to the command line
472
522
  #endif
473
523
 
474
524
 
525
+ // A macro used to change the calling conventions to preserve all registers (no
526
+ // caller-saved registers). Use this for cold functions called from hot
527
+ // functions.
528
+ // Note: The attribute is considered experimental, so apply with care. Also,
529
+ // "preserve_most" is currently not handling the return value correctly, so only
530
+ // use it for functions returning void (see https://reviews.llvm.org/D141020).
531
+ // Use like:
532
+ // V8_NOINLINE V8_PRESERVE_MOST void UnlikelyMethod();
533
+ #if V8_HAS_ATTRIBUTE_PRESERVE_MOST
534
+ # define V8_PRESERVE_MOST __attribute__((preserve_most))
535
+ #else
536
+ # define V8_PRESERVE_MOST /* NOT SUPPORTED */
537
+ #endif
538
+
539
+
475
540
  // A macro (V8_DEPRECATED) to mark classes or functions as deprecated.
476
541
  #if defined(V8_DEPRECATION_WARNINGS)
477
542
  # define V8_DEPRECATED(message) [[deprecated(message)]]
@@ -869,4 +934,10 @@ V8 shared library set USING_V8_SHARED.
869
934
 
870
935
  #undef V8_HAS_CPP_ATTRIBUTE
871
936
 
937
+ #if !defined(V8_STATIC_ROOTS)
938
+ #define V8_STATIC_ROOTS_BOOL false
939
+ #else
940
+ #define V8_STATIC_ROOTS_BOOL true
941
+ #endif
942
+
872
943
  #endif // V8CONFIG_H_
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: 19.9.0.0
4
+ version: 20.12.1.0
5
5
  platform: x86_64-darwin
6
6
  authors:
7
7
  - ''
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-23 00:00:00.000000000 Z
11
+ date: 2024-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -177,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
177
  - !ruby/object:Gem::Version
178
178
  version: '0'
179
179
  requirements: []
180
- rubygems_version: 3.3.20
180
+ rubygems_version: 3.5.6
181
181
  signing_key:
182
182
  specification_version: 4
183
183
  summary: Node.JS's V8 JavaScript engine