libv8-node 15.5.1.0.beta1-x86_64-linux → 16.10.0.0-x86_64-linux

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/ext/libv8-node/.location.yml +0 -1
  3. data/ext/libv8-node/location.rb +23 -38
  4. data/ext/libv8-node/paths.rb +2 -2
  5. data/lib/libv8/node/version.rb +3 -3
  6. data/vendor/v8/include/cppgc/allocation.h +104 -45
  7. data/vendor/v8/include/cppgc/common.h +9 -6
  8. data/vendor/v8/include/cppgc/cross-thread-persistent.h +384 -0
  9. data/vendor/v8/include/cppgc/custom-space.h +37 -2
  10. data/vendor/v8/include/cppgc/default-platform.h +47 -48
  11. data/vendor/v8/include/cppgc/ephemeron-pair.h +30 -0
  12. data/vendor/v8/include/cppgc/explicit-management.h +82 -0
  13. data/vendor/v8/include/cppgc/garbage-collected.h +4 -3
  14. data/vendor/v8/include/cppgc/heap-consistency.h +236 -0
  15. data/vendor/v8/include/cppgc/heap-state.h +70 -0
  16. data/vendor/v8/include/cppgc/heap-statistics.h +120 -0
  17. data/vendor/v8/include/cppgc/heap.h +68 -6
  18. data/vendor/v8/include/cppgc/internal/api-constants.h +3 -3
  19. data/vendor/v8/include/cppgc/internal/caged-heap-local-data.h +2 -1
  20. data/vendor/v8/include/cppgc/internal/compiler-specific.h +2 -2
  21. data/vendor/v8/include/cppgc/internal/gc-info.h +44 -13
  22. data/vendor/v8/include/cppgc/internal/name-trait.h +111 -0
  23. data/vendor/v8/include/cppgc/internal/persistent-node.h +57 -1
  24. data/vendor/v8/include/cppgc/internal/pointer-policies.h +69 -28
  25. data/vendor/v8/include/cppgc/internal/prefinalizer-handler.h +1 -1
  26. data/vendor/v8/include/cppgc/internal/write-barrier.h +353 -35
  27. data/vendor/v8/include/cppgc/liveness-broker.h +7 -1
  28. data/vendor/v8/include/cppgc/macros.h +2 -0
  29. data/vendor/v8/include/cppgc/member.h +85 -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 +33 -9
  33. data/vendor/v8/include/cppgc/platform.h +48 -25
  34. data/vendor/v8/include/cppgc/prefinalizer.h +1 -1
  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 +187 -23
  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-cppgc.h +258 -159
  45. data/vendor/v8/include/v8-fast-api-calls.h +562 -159
  46. data/vendor/v8/include/v8-inspector.h +23 -2
  47. data/vendor/v8/include/v8-internal.h +99 -27
  48. data/vendor/v8/include/v8-metrics.h +77 -8
  49. data/vendor/v8/include/v8-platform.h +47 -22
  50. data/vendor/v8/include/v8-profiler.h +75 -11
  51. data/vendor/v8/include/v8-unwinder-state.h +30 -0
  52. data/vendor/v8/include/v8-util.h +1 -1
  53. data/vendor/v8/include/v8-version.h +4 -4
  54. data/vendor/v8/include/v8.h +1192 -642
  55. data/vendor/v8/include/v8config.h +40 -9
  56. data/vendor/v8/{out.gn → x86_64-linux}/libv8/obj/libv8_monolith.a +0 -0
  57. metadata +33 -7
  58. 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: 24e798b2424e73d0e0c264a3b3132f72fbf158abd895e12a464dfff9cccb96a0
4
- data.tar.gz: e549d76b8156d96615f29a603e9dfcbc989ba6f0d82d33b234f6d7cf2582bed2
3
+ metadata.gz: 10d9bc2ea31b8588bfdebaa45157ce3de39308f7e12e137bea5f461b2e1f0d40
4
+ data.tar.gz: 8b11e8fac1a8c301136f575e2d6335df3f73e2c4d79b8ca1d9832934f631d8fe
5
5
  SHA512:
6
- metadata.gz: 5566fc1dce54b484606afe732572e159431bf4482600c0062f7a3793ea0795a1790870be0dadfd990a688fcf51bf32efa682087da5d15cf01a086912b30b3685
7
- data.tar.gz: 8a0003bbc063fa1ee8f1e653bbc1eb1d080d16ba6ae8976c9a2ab0ab376d989ef75a275bc9b265da8e37e48d25ecf6f8baa47fb8cebe6b35e161cb1b49547f02
6
+ metadata.gz: 30fb9c6db7c0045eabba05f03fe0b4db9ae5b3c3081b847be13e3d09a6a9fe151bfa04af6d608ce0a3c79a670b82db23cd89071232c95eb10d9b4938c9eb3f4f
7
+ data.tar.gz: feffdf7bcf57566b981ea5a767762ef0c8a3c5d81df0467a3602fd45aa9d06309fb5d163490b6654320a0c1f68a26408428f7a21c3828a1103054fd75eb39aa8
@@ -1,2 +1 @@
1
1
  --- !ruby/object:Libv8::Node::Location::Vendor {}
2
-
@@ -1,46 +1,56 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yaml'
2
4
  require 'pathname'
3
- require File.expand_path '../paths', __FILE__
5
+ require File.expand_path('paths', __dir__)
4
6
 
5
7
  module Libv8; end
6
8
 
7
9
  module Libv8::Node
8
10
  class Location
9
11
  def install!
10
- File.open(Pathname(__FILE__).dirname.join('.location.yml'), "w") do |f|
11
- f.write self.to_yaml
12
+ File.open(Pathname(__FILE__).dirname.join('.location.yml'), 'w') do |f|
13
+ f.write(to_yaml)
12
14
  end
13
- return 0
15
+
16
+ 0
14
17
  end
15
18
 
16
19
  def self.load!
17
20
  File.open(Pathname(__FILE__).dirname.join('.location.yml')) do |f|
18
- YAML.load f
21
+ YAML.respond_to?(:unsafe_load) ? YAML.unsafe_load(f) : YAML.load(f) # rubocop:disable Security/YAMLLoad
19
22
  end
20
23
  end
21
24
 
22
25
  class Vendor < Location
23
26
  def install!
24
- require File.expand_path '../builder', __FILE__
27
+ require File.expand_path('builder', __dir__)
28
+
25
29
  builder = Libv8::Node::Builder.new
26
30
  exit_status = builder.build_libv8!
31
+ builder.remove_intermediates!
32
+
27
33
  super if exit_status == 0
34
+
28
35
  verify_installation!
29
- return exit_status
36
+
37
+ exit_status
30
38
  end
31
39
 
32
40
  def configure(context = MkmfContext.new)
33
- context.incflags.insert 0, Libv8::Node::Paths.include_paths.map{ |p| "-I#{p}" }.join(" ") + " "
34
- context.ldflags.insert 0, Libv8::Node::Paths.object_paths.join(" ") + " "
41
+ context.incflags.insert(0, Libv8::Node::Paths.include_paths.map { |p| "-I#{p}" }.join(' ') << ' ')
42
+ context.ldflags.insert(0, Libv8::Node::Paths.object_paths.join(' ') << ' ')
35
43
  end
36
44
 
37
45
  def verify_installation!
38
46
  include_paths = Libv8::Node::Paths.include_paths
47
+
39
48
  unless include_paths.detect { |p| Pathname(p).join('v8.h').exist? }
40
- fail HeaderNotFound, "Unable to locate 'v8.h' in the libv8 header paths: #{include_paths.inspect}"
49
+ raise(HeaderNotFound, "Unable to locate 'v8.h' in the libv8 header paths: #{include_paths.inspect}")
41
50
  end
51
+
42
52
  Libv8::Node::Paths.object_paths.each do |p|
43
- fail ArchiveNotFound, p unless File.exist? p
53
+ raise(ArchiveNotFound, p) unless File.exist?(p)
44
54
  end
45
55
  end
46
56
 
@@ -53,38 +63,13 @@ module Libv8::Node
53
63
  end
54
64
  end
55
65
 
56
- class System < Location
57
- def configure(context = MkmfContext.new)
58
- context.send(:dir_config, 'v8')
59
- context.send(:find_header, 'v8.h') or fail NotFoundError
60
- context.send(:find_header, 'libplatform/libplatform.h') or fail NotFoundError
61
- context.send(:have_library, 'v8') or fail NotFoundError
62
- end
63
-
64
- class NotFoundError < StandardError
65
- def initialize(*args)
66
- super(<<-EOS)
67
- By using --with-system-v8, you have chosen to use the version
68
- of V8 found on your system and *not* the one that is bundled with
69
- the libv8 rubygem.
70
-
71
- However, your system version of v8 could not be located.
72
-
73
- Please make sure your system version of v8 that is compatible
74
- with #{Libv8::Node::VERSION} installed. You may need to use the
75
- --with-v8-dir option if it is installed in a non-standard location
76
- EOS
77
- end
78
- end
79
- end
80
-
81
66
  class MkmfContext
82
67
  def incflags
83
- $INCFLAGS
68
+ $INCFLAGS # rubocop:disable Style/GlobalVars
84
69
  end
85
70
 
86
71
  def ldflags
87
- $LDFLAGS
72
+ $LDFLAGS # rubocop:disable Style/GlobalVars
88
73
  end
89
74
  end
90
75
  end
@@ -13,7 +13,7 @@ module Libv8::Node
13
13
 
14
14
  def object_paths
15
15
  [Shellwords.escape(File.join(vendored_source_path,
16
- 'out.gn',
16
+ Gem::Platform.local.to_s,
17
17
  'libv8',
18
18
  'obj',
19
19
  "libv8_monolith.#{config['LIBEXT']}"))]
@@ -24,7 +24,7 @@ module Libv8::Node
24
24
  end
25
25
 
26
26
  def vendored_source_path
27
- File.expand_path "../../../vendor/v8", __FILE__
27
+ File.expand_path('../../vendor/v8', __dir__)
28
28
  end
29
29
  end
30
30
  end
@@ -1,7 +1,7 @@
1
1
  module Libv8; end
2
2
 
3
3
  module Libv8::Node
4
- VERSION = "15.5.1.0.beta1"
5
- NODE_VERSION = "15.5.1"
6
- LIBV8_VERSION = "8.6.395.17" # v8/include/v8-version.h
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
7
7
  end
@@ -5,24 +5,20 @@
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>
11
13
 
12
14
  #include "cppgc/custom-space.h"
13
- #include "cppgc/garbage-collected.h"
14
15
  #include "cppgc/internal/api-constants.h"
15
16
  #include "cppgc/internal/gc-info.h"
17
+ #include "cppgc/type-traits.h"
18
+ #include "v8config.h" // NOLINT(build/include_directory)
16
19
 
17
20
  namespace cppgc {
18
21
 
19
- template <typename T>
20
- class MakeGarbageCollectedTraitBase;
21
-
22
- namespace internal {
23
- class ObjectAllocator;
24
- } // namespace internal
25
-
26
22
  /**
27
23
  * AllocationHandle is used to allocate garbage-collected objects.
28
24
  */
@@ -39,11 +35,32 @@ class V8_EXPORT MakeGarbageCollectedTraitInternal {
39
35
  const_cast<uint16_t*>(reinterpret_cast<const uint16_t*>(
40
36
  reinterpret_cast<const uint8_t*>(payload) -
41
37
  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);
38
+ atomic_mutable_bitfield->fetch_or(api_constants::kFullyConstructedBitMask,
39
+ std::memory_order_release);
45
40
  }
46
41
 
42
+ template <typename U, typename CustomSpace>
43
+ struct SpacePolicy {
44
+ static void* Allocate(AllocationHandle& handle, size_t size) {
45
+ // Custom space.
46
+ static_assert(std::is_base_of<CustomSpaceBase, CustomSpace>::value,
47
+ "Custom space must inherit from CustomSpaceBase.");
48
+ return MakeGarbageCollectedTraitInternal::Allocate(
49
+ handle, size, internal::GCInfoTrait<U>::Index(),
50
+ CustomSpace::kSpaceIndex);
51
+ }
52
+ };
53
+
54
+ template <typename U>
55
+ struct SpacePolicy<U, void> {
56
+ static void* Allocate(AllocationHandle& handle, size_t size) {
57
+ // Default space.
58
+ return MakeGarbageCollectedTraitInternal::Allocate(
59
+ handle, size, internal::GCInfoTrait<U>::Index());
60
+ }
61
+ };
62
+
63
+ private:
47
64
  static void* Allocate(cppgc::AllocationHandle& handle, size_t size,
48
65
  GCInfoIndex index);
49
66
  static void* Allocate(cppgc::AllocationHandle& handle, size_t size,
@@ -65,26 +82,12 @@ template <typename T>
65
82
  class MakeGarbageCollectedTraitBase
66
83
  : private internal::MakeGarbageCollectedTraitInternal {
67
84
  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
- };
85
+ static_assert(internal::IsGarbageCollectedType<T>::value,
86
+ "T needs to be a garbage collected object");
87
+ static_assert(!IsGarbageCollectedWithMixinTypeV<T> ||
88
+ sizeof(T) <=
89
+ internal::api_constants::kLargeObjectSizeThreshold,
90
+ "GarbageCollectedMixin may not be a large object");
88
91
 
89
92
  protected:
90
93
  /**
@@ -95,9 +98,15 @@ class MakeGarbageCollectedTraitBase
95
98
  * \param size The size that should be reserved for the object.
96
99
  * \returns the memory to construct an object of type T on.
97
100
  */
98
- static void* Allocate(AllocationHandle& handle, size_t size) {
99
- return SpacePolicy<T, typename SpaceTrait<T>::Space>::Allocate(handle,
100
- size);
101
+ V8_INLINE static void* Allocate(AllocationHandle& handle, size_t size) {
102
+ static_assert(
103
+ std::is_base_of<typename T::ParentMostGarbageCollectedType, T>::value,
104
+ "U of GarbageCollected<U> must be a base of T. Check "
105
+ "GarbageCollected<T> base class inheritance.");
106
+ return SpacePolicy<
107
+ typename internal::GCInfoFolding<
108
+ T, typename T::ParentMostGarbageCollectedType>::ResultType,
109
+ typename SpaceTrait<T>::Space>::Allocate(handle, size);
101
110
  }
102
111
 
103
112
  /**
@@ -106,39 +115,70 @@ class MakeGarbageCollectedTraitBase
106
115
  *
107
116
  * \param payload The base pointer the object is allocated at.
108
117
  */
109
- static void MarkObjectAsFullyConstructed(const void* payload) {
118
+ V8_INLINE static void MarkObjectAsFullyConstructed(const void* payload) {
110
119
  internal::MakeGarbageCollectedTraitInternal::MarkObjectAsFullyConstructed(
111
120
  payload);
112
121
  }
113
122
  };
114
123
 
124
+ /**
125
+ * Passed to MakeGarbageCollected to specify how many bytes should be appended
126
+ * to the allocated object.
127
+ *
128
+ * Example:
129
+ * \code
130
+ * class InlinedArray final : public GarbageCollected<InlinedArray> {
131
+ * public:
132
+ * explicit InlinedArray(size_t bytes) : size(bytes), byte_array(this + 1) {}
133
+ * void Trace(Visitor*) const {}
134
+
135
+ * size_t size;
136
+ * char* byte_array;
137
+ * };
138
+ *
139
+ * auto* inlined_array = MakeGarbageCollected<InlinedArray(
140
+ * GetAllocationHandle(), AdditionalBytes(4), 4);
141
+ * for (size_t i = 0; i < 4; i++) {
142
+ * Process(inlined_array->byte_array[i]);
143
+ * }
144
+ * \endcode
145
+ */
146
+ struct AdditionalBytes {
147
+ constexpr explicit AdditionalBytes(size_t bytes) : value(bytes) {}
148
+ const size_t value;
149
+ };
150
+
115
151
  /**
116
152
  * Default trait class that specifies how to construct an object of type T.
117
153
  * Advanced users may override how an object is constructed using the utilities
118
154
  * that are provided through MakeGarbageCollectedTraitBase.
119
155
  *
120
156
  * Any trait overriding construction must
121
- * - allocate through MakeGarbageCollectedTraitBase<T>::Allocate;
157
+ * - allocate through `MakeGarbageCollectedTraitBase<T>::Allocate`;
122
158
  * - mark the object as fully constructed using
123
- * MakeGarbageCollectedTraitBase<T>::MarkObjectAsFullyConstructed;
159
+ * `MakeGarbageCollectedTraitBase<T>::MarkObjectAsFullyConstructed`;
124
160
  */
125
161
  template <typename T>
126
162
  class MakeGarbageCollectedTrait : public MakeGarbageCollectedTraitBase<T> {
127
163
  public:
128
164
  template <typename... Args>
129
165
  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
166
  void* memory =
137
167
  MakeGarbageCollectedTraitBase<T>::Allocate(handle, sizeof(T));
138
168
  T* object = ::new (memory) T(std::forward<Args>(args)...);
139
169
  MakeGarbageCollectedTraitBase<T>::MarkObjectAsFullyConstructed(object);
140
170
  return object;
141
171
  }
172
+
173
+ template <typename... Args>
174
+ static T* Call(AllocationHandle& handle, AdditionalBytes additional_bytes,
175
+ Args&&... args) {
176
+ void* memory = MakeGarbageCollectedTraitBase<T>::Allocate(
177
+ handle, sizeof(T) + additional_bytes.value);
178
+ T* object = ::new (memory) T(std::forward<Args>(args)...);
179
+ MakeGarbageCollectedTraitBase<T>::MarkObjectAsFullyConstructed(object);
180
+ return object;
181
+ }
142
182
  };
143
183
 
144
184
  /**
@@ -168,6 +208,25 @@ T* MakeGarbageCollected(AllocationHandle& handle, Args&&... args) {
168
208
  return object;
169
209
  }
170
210
 
211
+ /**
212
+ * Constructs a managed object of type T where T transitively inherits from
213
+ * GarbageCollected. Created objects will have additional bytes appended to
214
+ * it. Allocated memory would suffice for `sizeof(T) + additional_bytes`.
215
+ *
216
+ * \param additional_bytes Denotes how many bytes to append to T.
217
+ * \param args List of arguments with which an instance of T will be
218
+ * constructed.
219
+ * \returns an instance of type T.
220
+ */
221
+ template <typename T, typename... Args>
222
+ T* MakeGarbageCollected(AllocationHandle& handle,
223
+ AdditionalBytes additional_bytes, Args&&... args) {
224
+ T* object = MakeGarbageCollectedTrait<T>::Call(handle, additional_bytes,
225
+ std::forward<Args>(args)...);
226
+ PostConstructionCallbackTrait<T>::Call(object);
227
+ return object;
228
+ }
229
+
171
230
  } // namespace cppgc
172
231
 
173
232
  #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