libv8-node 22.7.0.4-x86_64-linux → 23.6.1.0-x86_64-linux

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/lib/libv8/node/version.rb +3 -3
  3. data/vendor/v8/include/cppgc/allocation.h +10 -11
  4. data/vendor/v8/include/cppgc/garbage-collected.h +8 -0
  5. data/vendor/v8/include/cppgc/heap-statistics.h +2 -0
  6. data/vendor/v8/include/cppgc/internal/api-constants.h +6 -1
  7. data/vendor/v8/include/cppgc/internal/compiler-specific.h +9 -1
  8. data/vendor/v8/include/cppgc/internal/gc-info.h +12 -10
  9. data/vendor/v8/include/cppgc/internal/member-storage.h +6 -0
  10. data/vendor/v8/include/cppgc/internal/name-trait.h +5 -1
  11. data/vendor/v8/include/cppgc/name-provider.h +7 -0
  12. data/vendor/v8/include/v8-array-buffer.h +44 -24
  13. data/vendor/v8/include/v8-callbacks.h +10 -5
  14. data/vendor/v8/include/v8-context.h +41 -9
  15. data/vendor/v8/include/v8-cppgc.h +3 -55
  16. data/vendor/v8/include/v8-date.h +9 -0
  17. data/vendor/v8/include/v8-embedder-heap.h +4 -1
  18. data/vendor/v8/include/v8-exception.h +70 -0
  19. data/vendor/v8/include/v8-fast-api-calls.h +31 -38
  20. data/vendor/v8/include/v8-function-callback.h +203 -62
  21. data/vendor/v8/include/v8-function.h +4 -3
  22. data/vendor/v8/include/v8-handle-base.h +2 -2
  23. data/vendor/v8/include/v8-initialization.h +18 -1
  24. data/vendor/v8/include/v8-inspector.h +6 -3
  25. data/vendor/v8/include/v8-internal.h +303 -58
  26. data/vendor/v8/include/v8-isolate.h +58 -39
  27. data/vendor/v8/include/v8-local-handle.h +18 -19
  28. data/vendor/v8/include/v8-message.h +0 -21
  29. data/vendor/v8/include/v8-metrics.h +4 -0
  30. data/vendor/v8/include/v8-microtask-queue.h +0 -5
  31. data/vendor/v8/include/v8-object.h +284 -35
  32. data/vendor/v8/include/v8-persistent-handle.h +0 -19
  33. data/vendor/v8/include/v8-platform.h +21 -35
  34. data/vendor/v8/include/v8-primitive.h +92 -1
  35. data/vendor/v8/include/v8-profiler.h +38 -1
  36. data/vendor/v8/include/v8-promise.h +2 -2
  37. data/vendor/v8/include/v8-sandbox.h +173 -0
  38. data/vendor/v8/include/v8-script.h +44 -14
  39. data/vendor/v8/include/v8-snapshot.h +38 -2
  40. data/vendor/v8/include/v8-template.h +105 -263
  41. data/vendor/v8/include/v8-traced-handle.h +4 -15
  42. data/vendor/v8/include/v8-unwinder.h +2 -1
  43. data/vendor/v8/include/v8-util.h +1 -117
  44. data/vendor/v8/include/v8-value.h +3 -2
  45. data/vendor/v8/include/v8-version.h +3 -3
  46. data/vendor/v8/include/v8-wasm.h +3 -0
  47. data/vendor/v8/include/v8config.h +51 -7
  48. data/vendor/v8/x86_64-linux/libv8/obj/libv8_monolith.a +0 -0
  49. metadata +3 -2
@@ -182,7 +182,7 @@ class PersistentValueMapBase {
182
182
  */
183
183
  Local<V> Get(const K& key) {
184
184
  V* p = FromVal(Traits::Get(&impl_, key));
185
- #ifdef V8_ENABLE_DIRECT_LOCAL
185
+ #ifdef V8_ENABLE_DIRECT_HANDLE
186
186
  if (p == nullptr) return Local<V>();
187
187
  #endif
188
188
  return Local<V>::New(isolate_, p);
@@ -544,122 +544,6 @@ class StdGlobalValueMap : public GlobalValueMap<K, V, Traits> {
544
544
  : GlobalValueMap<K, V, Traits>(isolate) {}
545
545
  };
546
546
 
547
- class DefaultPersistentValueVectorTraits {
548
- public:
549
- typedef std::vector<PersistentContainerValue> Impl;
550
-
551
- static void Append(Impl* impl, PersistentContainerValue value) {
552
- impl->push_back(value);
553
- }
554
- static bool IsEmpty(const Impl* impl) {
555
- return impl->empty();
556
- }
557
- static size_t Size(const Impl* impl) {
558
- return impl->size();
559
- }
560
- static PersistentContainerValue Get(const Impl* impl, size_t i) {
561
- return (i < impl->size()) ? impl->at(i) : kPersistentContainerNotFound;
562
- }
563
- static void ReserveCapacity(Impl* impl, size_t capacity) {
564
- impl->reserve(capacity);
565
- }
566
- static void Clear(Impl* impl) {
567
- impl->clear();
568
- }
569
- };
570
-
571
- /**
572
- * A vector wrapper that safely stores Global values.
573
- * C++11 embedders don't need this class, as they can use Global
574
- * directly in std containers.
575
- *
576
- * This class relies on a backing vector implementation, whose type and methods
577
- * are described by the Traits class. The backing map will handle values of type
578
- * PersistentContainerValue, with all conversion into and out of V8
579
- * handles being transparently handled by this class.
580
- */
581
- template <typename V, typename Traits = DefaultPersistentValueVectorTraits>
582
- class V8_DEPRECATE_SOON("Use std::vector<Global<V>>.") PersistentValueVector {
583
- public:
584
- explicit PersistentValueVector(Isolate* isolate) : isolate_(isolate) { }
585
-
586
- ~PersistentValueVector() {
587
- Clear();
588
- }
589
-
590
- /**
591
- * Append a value to the vector.
592
- */
593
- void Append(Local<V> value) {
594
- Global<V> persistent(isolate_, value);
595
- Traits::Append(&impl_, ClearAndLeak(&persistent));
596
- }
597
-
598
- /**
599
- * Append a persistent's value to the vector.
600
- */
601
- void Append(Global<V> persistent) {
602
- Traits::Append(&impl_, ClearAndLeak(&persistent));
603
- }
604
-
605
- /**
606
- * Are there any values in the vector?
607
- */
608
- bool IsEmpty() const {
609
- return Traits::IsEmpty(&impl_);
610
- }
611
-
612
- /**
613
- * How many elements are in the vector?
614
- */
615
- size_t Size() const {
616
- return Traits::Size(&impl_);
617
- }
618
-
619
- /**
620
- * Retrieve the i-th value in the vector.
621
- */
622
- Local<V> Get(size_t index) const {
623
- return Local<V>::New(isolate_, internal::ValueHelper::SlotAsValue<V>(
624
- Traits::Get(&impl_, index)));
625
- }
626
-
627
- /**
628
- * Remove all elements from the vector.
629
- */
630
- void Clear() {
631
- size_t length = Traits::Size(&impl_);
632
- for (size_t i = 0; i < length; i++) {
633
- Global<V> p;
634
- p.slot() = reinterpret_cast<internal::Address>(Traits::Get(&impl_, i));
635
- }
636
- Traits::Clear(&impl_);
637
- }
638
-
639
- /**
640
- * Reserve capacity in the vector.
641
- * (Efficiency gains depend on the backing implementation.)
642
- */
643
- void ReserveCapacity(size_t capacity) {
644
- Traits::ReserveCapacity(&impl_, capacity);
645
- }
646
-
647
- private:
648
- static PersistentContainerValue ClearAndLeak(Global<V>* persistent) {
649
- auto slot = persistent->slot();
650
- persistent->Clear();
651
- return reinterpret_cast<PersistentContainerValue>(slot);
652
- }
653
-
654
- static V* FromVal(PersistentContainerValue v) {
655
- return internal::ValueHelper::SlotAsValue<V>(
656
- reinterpret_cast<internal::Address*>(v));
657
- }
658
-
659
- Isolate* isolate_;
660
- typename Traits::Impl impl_;
661
- };
662
-
663
547
  } // namespace v8
664
548
 
665
549
  #endif // V8_UTIL_H
@@ -635,8 +635,9 @@ bool Value::QuickIsString() const {
635
635
  A obj = internal::ValueHelper::ValueAsAddress(this);
636
636
  if (!I::HasHeapObjectTag(obj)) return false;
637
637
  #if V8_STATIC_ROOTS_BOOL && !V8_MAP_PACKING
638
- return I::CheckInstanceMapRange(obj, I::StaticReadOnlyRoot::kFirstStringMap,
639
- I::StaticReadOnlyRoot::kLastStringMap);
638
+ return I::CheckInstanceMapRange(obj,
639
+ I::StaticReadOnlyRoot::kStringMapLowerBound,
640
+ I::StaticReadOnlyRoot::kStringMapUpperBound);
640
641
  #else
641
642
  return (I::GetInstanceType(obj) < I::kFirstNonstringType);
642
643
  #endif // V8_STATIC_ROOTS_BOOL
@@ -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 12
12
- #define V8_MINOR_VERSION 4
13
- #define V8_BUILD_NUMBER 254
14
- #define V8_PATCH_LEVEL 21
12
+ #define V8_MINOR_VERSION 9
13
+ #define V8_BUILD_NUMBER 202
14
+ #define V8_PATCH_LEVEL 28
15
15
 
16
16
  // Use 1 for candidates and 0 otherwise.
17
17
  // (Boolean macro values are not supported by all preprocessors.)
@@ -9,6 +9,7 @@
9
9
  #include <memory>
10
10
  #include <string>
11
11
 
12
+ #include "v8-internal.h" // NOLINT(build/include_directory)
12
13
  #include "v8-local-handle.h" // NOLINT(build/include_directory)
13
14
  #include "v8-memory-span.h" // NOLINT(build/include_directory)
14
15
  #include "v8-object.h" // NOLINT(build/include_directory)
@@ -129,6 +130,8 @@ class V8_EXPORT WasmModuleObject : public Object {
129
130
  */
130
131
  class V8_EXPORT WasmStreaming final {
131
132
  public:
133
+ static constexpr internal::ExternalPointerTag kManagedTag =
134
+ internal::kWasmWasmStreamingTag;
132
135
  class WasmStreamingImpl;
133
136
 
134
137
  explicit WasmStreaming(std::unique_ptr<WasmStreamingImpl> impl);
@@ -5,8 +5,16 @@
5
5
  #ifndef V8CONFIG_H_
6
6
  #define V8CONFIG_H_
7
7
 
8
+ // gcc 10 defines __cplusplus to "an unspecified value strictly larger than
9
+ // 201703L" for its experimental -std=gnu++2a config.
10
+ // TODO(leszeks): Change to `__cplusplus <= 202002L` once we only support
11
+ // compilers with full C++20 support.
12
+ #if __cplusplus <= 201703L
13
+ #error "C++20 or later required."
14
+ #endif
15
+
8
16
  #ifdef V8_GN_HEADER
9
- #if __cplusplus >= 201703L && !__has_include("v8-gn.h")
17
+ #if !__has_include("v8-gn.h")
10
18
  #error Missing v8-gn.h. The configuration for v8 is missing from the include \
11
19
  path. Add it with -I<path> to the command line
12
20
  #endif
@@ -23,6 +31,8 @@ path. Add it with -I<path> to the command line
23
31
  # include <TargetConditionals.h>
24
32
  #elif defined(__linux__)
25
33
  # include <features.h>
34
+ #elif defined(__MVS__)
35
+ # include "zos-base.h"
26
36
  #endif
27
37
 
28
38
 
@@ -83,6 +93,7 @@ path. Add it with -I<path> to the command line
83
93
  // V8_OS_STARBOARD - Starboard (platform abstraction for Cobalt)
84
94
  // V8_OS_AIX - AIX
85
95
  // V8_OS_WIN - Microsoft Windows
96
+ // V8_OS_ZOS - z/OS
86
97
 
87
98
  #if defined(__ANDROID__)
88
99
  # define V8_OS_ANDROID 1
@@ -163,6 +174,11 @@ path. Add it with -I<path> to the command line
163
174
  #elif defined(_WIN32)
164
175
  # define V8_OS_WIN 1
165
176
  # define V8_OS_STRING "windows"
177
+
178
+ #elif defined(__MVS__)
179
+ # define V8_OS_POSIX 1
180
+ # define V8_OS_ZOS 1
181
+ # define V8_OS_STRING "zos"
166
182
  #endif
167
183
 
168
184
  // -----------------------------------------------------------------------------
@@ -376,8 +392,14 @@ path. Add it with -I<path> to the command line
376
392
  # define V8_HAS_ATTRIBUTE_WEAK (__has_attribute(weak))
377
393
 
378
394
  # define V8_HAS_CPP_ATTRIBUTE_NODISCARD (V8_HAS_CPP_ATTRIBUTE(nodiscard))
395
+ #if defined(V8_CC_MSVC)
396
+ # define V8_HAS_CPP_ATTRIBUTE_NO_UNIQUE_ADDRESS \
397
+ (V8_HAS_CPP_ATTRIBUTE(msvc::no_unique_address) || \
398
+ V8_HAS_CPP_ATTRIBUTE(no_unique_address))
399
+ #else
379
400
  # define V8_HAS_CPP_ATTRIBUTE_NO_UNIQUE_ADDRESS \
380
401
  (V8_HAS_CPP_ATTRIBUTE(no_unique_address))
402
+ #endif
381
403
 
382
404
  # define V8_HAS_BUILTIN_ADD_OVERFLOW (__has_builtin(__builtin_add_overflow))
383
405
  # define V8_HAS_BUILTIN_ASSUME (__has_builtin(__builtin_assume))
@@ -477,22 +499,32 @@ path. Add it with -I<path> to the command line
477
499
  # define V8_INLINE inline
478
500
  #endif
479
501
 
502
+ #if V8_HAS_BUILTIN_ASSUME
480
503
  #ifdef DEBUG
481
- // In debug mode, check assumptions instead of actually adding annotations.
482
- # define V8_ASSUME DCHECK
483
- #elif V8_HAS_BUILTIN_ASSUME
504
+ // In debug mode, check assumptions in addition to adding annotations.
505
+ // This helps GCC (and maybe other compilers) figure out that certain
506
+ // situations are unreachable.
507
+ # define V8_ASSUME(condition) \
508
+ do { \
509
+ DCHECK(condition); \
510
+ __builtin_assume(condition); \
511
+ } while (false)
512
+ #else // DEBUG
484
513
  # define V8_ASSUME __builtin_assume
514
+ #endif // DEBUG
485
515
  #elif V8_HAS_BUILTIN_UNREACHABLE
486
516
  # define V8_ASSUME(condition) \
487
517
  do { \
518
+ DCHECK(condition); \
488
519
  if (!(condition)) __builtin_unreachable(); \
489
520
  } while (false)
490
521
  #else
491
522
  # define V8_ASSUME USE
492
523
  #endif
493
524
 
494
- // Prefer c++20 std::assume_aligned
495
- #if __cplusplus >= 202002L && defined(__cpp_lib_assume_aligned)
525
+ // Prefer c++20 std::assume_aligned. Don't use it on MSVC though, because it's
526
+ // not happy with our large 4GB alignment values.
527
+ #if __cplusplus >= 202002L && defined(__cpp_lib_assume_aligned) && !V8_CC_MSVC
496
528
  # define V8_ASSUME_ALIGNED(ptr, alignment) \
497
529
  std::assume_aligned<(alignment)>(ptr)
498
530
  #elif V8_HAS_BUILTIN_ASSUME_ALIGNED
@@ -549,11 +581,15 @@ path. Add it with -I<path> to the command line
549
581
  // functions.
550
582
  // Use like:
551
583
  // V8_NOINLINE V8_PRESERVE_MOST void UnlikelyMethod();
584
+ #if V8_OS_WIN
585
+ # define V8_PRESERVE_MOST
586
+ #else
552
587
  #if V8_HAS_ATTRIBUTE_PRESERVE_MOST
553
588
  # define V8_PRESERVE_MOST __attribute__((preserve_most))
554
589
  #else
555
590
  # define V8_PRESERVE_MOST /* NOT SUPPORTED */
556
591
  #endif
592
+ #endif
557
593
 
558
594
 
559
595
  // A macro (V8_DEPRECATED) to mark classes or functions as deprecated.
@@ -645,7 +681,7 @@ path. Add it with -I<path> to the command line
645
681
  // V8_NODISCARD Foo() { ... };
646
682
  // [[nodiscard]] comes in C++17 but supported in clang with -std >= c++11.
647
683
  #if V8_HAS_CPP_ATTRIBUTE_NODISCARD
648
- #define V8_NODISCARD [[nodiscard]]
684
+ #define V8_NODISCARD
649
685
  #else
650
686
  #define V8_NODISCARD /* NOT SUPPORTED */
651
687
  #endif
@@ -666,7 +702,15 @@ path. Add it with -I<path> to the command line
666
702
  // [[no_unique_address]] comes in C++20 but supported in clang with
667
703
  // -std >= c++11.
668
704
  #if V8_HAS_CPP_ATTRIBUTE_NO_UNIQUE_ADDRESS
705
+ #if defined(V8_CC_MSVC) && V8_HAS_CPP_ATTRIBUTE(msvc::no_unique_address)
706
+ // Unfortunately MSVC ignores [[no_unique_address]] (see
707
+ // https://devblogs.microsoft.com/cppblog/msvc-cpp20-and-the-std-cpp20-switch/#msvc-extensions-and-abi),
708
+ // and clang-cl matches it for ABI compatibility reasons. We need to prefer
709
+ // [[msvc::no_unique_address]] when available if we actually want any effect.
710
+ #define V8_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
711
+ #else
669
712
  #define V8_NO_UNIQUE_ADDRESS [[no_unique_address]]
713
+ #endif
670
714
  #else
671
715
  #define V8_NO_UNIQUE_ADDRESS /* NOT SUPPORTED */
672
716
  #endif
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: 22.7.0.4
4
+ version: 23.6.1.0
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - ''
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-14 00:00:00.000000000 Z
11
+ date: 2025-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -137,6 +137,7 @@ files:
137
137
  - vendor/v8/include/v8-promise.h
138
138
  - vendor/v8/include/v8-proxy.h
139
139
  - vendor/v8/include/v8-regexp.h
140
+ - vendor/v8/include/v8-sandbox.h
140
141
  - vendor/v8/include/v8-script.h
141
142
  - vendor/v8/include/v8-snapshot.h
142
143
  - vendor/v8/include/v8-source-location.h