libv8-node 15.14.0.1-x86_64-linux → 17.9.1.0-x86_64-linux

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) 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 +110 -44
  6. data/vendor/v8/include/cppgc/common.h +9 -6
  7. data/vendor/v8/include/cppgc/cross-thread-persistent.h +465 -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 +4 -3
  19. data/vendor/v8/include/cppgc/internal/compiler-specific.h +2 -2
  20. data/vendor/v8/include/cppgc/internal/finalizer-trait.h +2 -0
  21. data/vendor/v8/include/cppgc/internal/gc-info.h +124 -13
  22. data/vendor/v8/include/cppgc/internal/name-trait.h +122 -0
  23. data/vendor/v8/include/cppgc/internal/persistent-node.h +94 -6
  24. data/vendor/v8/include/cppgc/internal/pointer-policies.h +81 -29
  25. data/vendor/v8/include/cppgc/internal/prefinalizer-handler.h +1 -1
  26. data/vendor/v8/include/cppgc/internal/write-barrier.h +398 -35
  27. data/vendor/v8/include/cppgc/liveness-broker.h +11 -2
  28. data/vendor/v8/include/cppgc/macros.h +2 -0
  29. data/vendor/v8/include/cppgc/member.h +87 -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 +41 -11
  33. data/vendor/v8/include/cppgc/platform.h +49 -25
  34. data/vendor/v8/include/cppgc/prefinalizer.h +2 -2
  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 +194 -28
  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-array-buffer.h +433 -0
  45. data/vendor/v8/include/v8-callbacks.h +377 -0
  46. data/vendor/v8/include/v8-container.h +129 -0
  47. data/vendor/v8/include/v8-context.h +418 -0
  48. data/vendor/v8/include/v8-cppgc.h +261 -159
  49. data/vendor/v8/include/v8-data.h +65 -0
  50. data/vendor/v8/include/v8-date.h +43 -0
  51. data/vendor/v8/include/v8-debug.h +151 -0
  52. data/vendor/v8/include/v8-embedder-heap.h +238 -0
  53. data/vendor/v8/include/v8-exception.h +224 -0
  54. data/vendor/v8/include/v8-extension.h +62 -0
  55. data/vendor/v8/include/v8-external.h +37 -0
  56. data/vendor/v8/include/v8-fast-api-calls.h +652 -152
  57. data/vendor/v8/include/v8-forward.h +81 -0
  58. data/vendor/v8/include/v8-function-callback.h +475 -0
  59. data/vendor/v8/include/v8-function.h +122 -0
  60. data/vendor/v8/include/v8-initialization.h +282 -0
  61. data/vendor/v8/include/v8-inspector.h +33 -25
  62. data/vendor/v8/include/v8-internal.h +178 -31
  63. data/vendor/v8/include/v8-isolate.h +1662 -0
  64. data/vendor/v8/include/v8-json.h +47 -0
  65. data/vendor/v8/include/v8-local-handle.h +459 -0
  66. data/vendor/v8/include/v8-locker.h +148 -0
  67. data/vendor/v8/include/v8-maybe.h +137 -0
  68. data/vendor/v8/include/v8-memory-span.h +43 -0
  69. data/vendor/v8/include/v8-message.h +241 -0
  70. data/vendor/v8/include/v8-metrics.h +114 -9
  71. data/vendor/v8/include/v8-microtask-queue.h +152 -0
  72. data/vendor/v8/include/v8-microtask.h +28 -0
  73. data/vendor/v8/include/v8-object.h +770 -0
  74. data/vendor/v8/include/v8-persistent-handle.h +590 -0
  75. data/vendor/v8/include/v8-platform.h +74 -25
  76. data/vendor/v8/include/v8-primitive-object.h +118 -0
  77. data/vendor/v8/include/v8-primitive.h +858 -0
  78. data/vendor/v8/include/v8-profiler.h +72 -9
  79. data/vendor/v8/include/v8-promise.h +174 -0
  80. data/vendor/v8/include/v8-proxy.h +50 -0
  81. data/vendor/v8/include/v8-regexp.h +105 -0
  82. data/vendor/v8/include/v8-script.h +771 -0
  83. data/vendor/v8/include/v8-snapshot.h +198 -0
  84. data/vendor/v8/include/v8-statistics.h +215 -0
  85. data/vendor/v8/include/v8-template.h +1052 -0
  86. data/vendor/v8/include/v8-traced-handle.h +605 -0
  87. data/vendor/v8/include/v8-typed-array.h +282 -0
  88. data/vendor/v8/include/v8-unwinder-state.h +31 -0
  89. data/vendor/v8/include/v8-unwinder.h +129 -0
  90. data/vendor/v8/include/v8-util.h +8 -2
  91. data/vendor/v8/include/v8-value-serializer.h +249 -0
  92. data/vendor/v8/include/v8-value.h +526 -0
  93. data/vendor/v8/include/v8-version.h +3 -3
  94. data/vendor/v8/include/v8-wasm.h +245 -0
  95. data/vendor/v8/include/v8-weak-callback-info.h +73 -0
  96. data/vendor/v8/include/v8.h +41 -12050
  97. data/vendor/v8/include/v8config.h +87 -11
  98. data/vendor/v8/{out.gn → x86_64-linux}/libv8/obj/libv8_monolith.a +0 -0
  99. metadata +60 -6
  100. data/vendor/v8/include/cppgc/internal/process-heap.h +0 -34
@@ -175,9 +175,14 @@ class JobDelegate {
175
175
  * Returns a task_id unique among threads currently running this job, such
176
176
  * that GetTaskId() < worker count. To achieve this, the same task_id may be
177
177
  * reused by a different thread after a worker_task returns.
178
- * TODO(etiennep): Make pure virtual once custom embedders implement it.
179
178
  */
180
- virtual uint8_t GetTaskId() { return 0; }
179
+ virtual uint8_t GetTaskId() = 0;
180
+
181
+ /**
182
+ * Returns true if the current task is called from the thread currently
183
+ * running JobHandle::Join().
184
+ */
185
+ virtual bool IsJoiningThread() const = 0;
181
186
  };
182
187
 
183
188
  /**
@@ -210,17 +215,34 @@ class JobHandle {
210
215
  */
211
216
  virtual void Cancel() = 0;
212
217
 
218
+ /*
219
+ * Forces all existing workers to yield ASAP but doesn’t wait for them.
220
+ * Warning, this is dangerous if the Job's callback is bound to or has access
221
+ * to state which may be deleted after this call.
222
+ */
223
+ virtual void CancelAndDetach() = 0;
224
+
213
225
  /**
214
- * Returns true if there's no work pending and no worker running.
215
- * TODO(etiennep): Make pure virtual once custom embedders implement it.
226
+ * Returns true if there's any work pending or any worker running.
216
227
  */
217
- virtual bool IsCompleted() { return true; }
228
+ virtual bool IsActive() = 0;
218
229
 
219
230
  /**
220
231
  * Returns true if associated with a Job and other methods may be called.
221
- * Returns false after Join() or Cancel() was called.
232
+ * Returns false after Join() or Cancel() was called. This may return true
233
+ * even if no workers are running and IsCompleted() returns true
234
+ */
235
+ virtual bool IsValid() = 0;
236
+
237
+ /**
238
+ * Returns true if job priority can be changed.
222
239
  */
223
- virtual bool IsRunning() = 0;
240
+ virtual bool UpdatePriorityEnabled() const { return false; }
241
+
242
+ /**
243
+ * Update this Job's priority.
244
+ */
245
+ virtual void UpdatePriority(TaskPriority new_priority) {}
224
246
  };
225
247
 
226
248
  /**
@@ -233,23 +255,13 @@ class JobTask {
233
255
  virtual void Run(JobDelegate* delegate) = 0;
234
256
 
235
257
  /**
236
- * Controls the maximum number of threads calling Run() concurrently. Run() is
237
- * only invoked if the number of threads previously running Run() was less
238
- * than the value returned. Since GetMaxConcurrency() is a leaf function, it
239
- * must not call back any JobHandle methods.
258
+ * Controls the maximum number of threads calling Run() concurrently, given
259
+ * the number of threads currently assigned to this job and executing Run().
260
+ * Run() is only invoked if the number of threads previously running Run() was
261
+ * less than the value returned. Since GetMaxConcurrency() is a leaf function,
262
+ * it must not call back any JobHandle methods.
240
263
  */
241
- virtual size_t GetMaxConcurrency() const = 0;
242
-
243
- /*
244
- * Meant to replace the version above, given the number of threads currently
245
- * assigned to this job and executing Run(). This is useful when the result
246
- * must include local work items not visible globaly by other workers.
247
- * TODO(etiennep): Replace the version above by this once custom embedders are
248
- * migrated.
249
- */
250
- size_t GetMaxConcurrency(size_t worker_count) const {
251
- return GetMaxConcurrency();
252
- }
264
+ virtual size_t GetMaxConcurrency(size_t worker_count) const = 0;
253
265
  };
254
266
 
255
267
  /**
@@ -382,7 +394,6 @@ class PageAllocator {
382
394
  kNoAccess,
383
395
  kRead,
384
396
  kReadWrite,
385
- // TODO(hpayer): Remove this flag. Memory should never be rwx.
386
397
  kReadWriteExecute,
387
398
  kReadExecute,
388
399
  // Set this when reserving memory that will later require kReadWriteExecute
@@ -419,10 +430,28 @@ class PageAllocator {
419
430
  /**
420
431
  * Frees memory in the given [address, address + size) range. address and size
421
432
  * should be operating system page-aligned. The next write to this
422
- * memory area brings the memory transparently back.
433
+ * memory area brings the memory transparently back. This should be treated as
434
+ * a hint to the OS that the pages are no longer needed. It does not guarantee
435
+ * that the pages will be discarded immediately or at all.
423
436
  */
424
437
  virtual bool DiscardSystemPages(void* address, size_t size) { return true; }
425
438
 
439
+ /**
440
+ * Decommits any wired memory pages in the given range, allowing the OS to
441
+ * reclaim them, and marks the region as inacessible (kNoAccess). The address
442
+ * range stays reserved and can be accessed again later by changing its
443
+ * permissions. However, in that case the memory content is guaranteed to be
444
+ * zero-initialized again. The memory must have been previously allocated by a
445
+ * call to AllocatePages. Returns true on success, false otherwise.
446
+ */
447
+ #ifdef V8_VIRTUAL_MEMORY_CAGE
448
+ // Implementing this API is required when the virtual memory cage is enabled.
449
+ virtual bool DecommitPages(void* address, size_t size) = 0;
450
+ #else
451
+ // Otherwise, it is optional for now.
452
+ virtual bool DecommitPages(void* address, size_t size) { return false; }
453
+ #endif
454
+
426
455
  /**
427
456
  * INTERNAL ONLY: This interface has not been stabilised and may change
428
457
  * without notice from one release to another without being deprecated first.
@@ -487,6 +516,18 @@ class PageAllocator {
487
516
  virtual bool CanAllocateSharedPages() { return false; }
488
517
  };
489
518
 
519
+ /**
520
+ * V8 Allocator used for allocating zone backings.
521
+ */
522
+ class ZoneBackingAllocator {
523
+ public:
524
+ using MallocFn = void* (*)(size_t);
525
+ using FreeFn = void (*)(void*);
526
+
527
+ virtual MallocFn GetMallocFn() const { return ::malloc; }
528
+ virtual FreeFn GetFreeFn() const { return ::free; }
529
+ };
530
+
490
531
  /**
491
532
  * V8 Platform abstraction layer.
492
533
  *
@@ -505,6 +546,14 @@ class Platform {
505
546
  return nullptr;
506
547
  }
507
548
 
549
+ /**
550
+ * Allows the embedder to specify a custom allocator used for zones.
551
+ */
552
+ virtual ZoneBackingAllocator* GetZoneBackingAllocator() {
553
+ static ZoneBackingAllocator default_allocator;
554
+ return &default_allocator;
555
+ }
556
+
508
557
  /**
509
558
  * Enables the embedder to respond in cases where V8 can't allocate large
510
559
  * blocks of memory. V8 retries the failed allocation once after calling this
@@ -0,0 +1,118 @@
1
+ // Copyright 2021 the V8 project authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ #ifndef INCLUDE_V8_PRIMITIVE_OBJECT_H_
6
+ #define INCLUDE_V8_PRIMITIVE_OBJECT_H_
7
+
8
+ #include "v8-local-handle.h" // NOLINT(build/include_directory)
9
+ #include "v8-object.h" // NOLINT(build/include_directory)
10
+ #include "v8config.h" // NOLINT(build/include_directory)
11
+
12
+ namespace v8 {
13
+
14
+ class Isolate;
15
+
16
+ /**
17
+ * A Number object (ECMA-262, 4.3.21).
18
+ */
19
+ class V8_EXPORT NumberObject : public Object {
20
+ public:
21
+ static Local<Value> New(Isolate* isolate, double value);
22
+
23
+ double ValueOf() const;
24
+
25
+ V8_INLINE static NumberObject* Cast(Value* value) {
26
+ #ifdef V8_ENABLE_CHECKS
27
+ CheckCast(value);
28
+ #endif
29
+ return static_cast<NumberObject*>(value);
30
+ }
31
+
32
+ private:
33
+ static void CheckCast(Value* obj);
34
+ };
35
+
36
+ /**
37
+ * A BigInt object (https://tc39.github.io/proposal-bigint)
38
+ */
39
+ class V8_EXPORT BigIntObject : public Object {
40
+ public:
41
+ static Local<Value> New(Isolate* isolate, int64_t value);
42
+
43
+ Local<BigInt> ValueOf() const;
44
+
45
+ V8_INLINE static BigIntObject* Cast(Value* value) {
46
+ #ifdef V8_ENABLE_CHECKS
47
+ CheckCast(value);
48
+ #endif
49
+ return static_cast<BigIntObject*>(value);
50
+ }
51
+
52
+ private:
53
+ static void CheckCast(Value* obj);
54
+ };
55
+
56
+ /**
57
+ * A Boolean object (ECMA-262, 4.3.15).
58
+ */
59
+ class V8_EXPORT BooleanObject : public Object {
60
+ public:
61
+ static Local<Value> New(Isolate* isolate, bool value);
62
+
63
+ bool ValueOf() const;
64
+
65
+ V8_INLINE static BooleanObject* Cast(Value* value) {
66
+ #ifdef V8_ENABLE_CHECKS
67
+ CheckCast(value);
68
+ #endif
69
+ return static_cast<BooleanObject*>(value);
70
+ }
71
+
72
+ private:
73
+ static void CheckCast(Value* obj);
74
+ };
75
+
76
+ /**
77
+ * A String object (ECMA-262, 4.3.18).
78
+ */
79
+ class V8_EXPORT StringObject : public Object {
80
+ public:
81
+ static Local<Value> New(Isolate* isolate, Local<String> value);
82
+
83
+ Local<String> ValueOf() const;
84
+
85
+ V8_INLINE static StringObject* Cast(Value* value) {
86
+ #ifdef V8_ENABLE_CHECKS
87
+ CheckCast(value);
88
+ #endif
89
+ return static_cast<StringObject*>(value);
90
+ }
91
+
92
+ private:
93
+ static void CheckCast(Value* obj);
94
+ };
95
+
96
+ /**
97
+ * A Symbol object (ECMA-262 edition 6).
98
+ */
99
+ class V8_EXPORT SymbolObject : public Object {
100
+ public:
101
+ static Local<Value> New(Isolate* isolate, Local<Symbol> value);
102
+
103
+ Local<Symbol> ValueOf() const;
104
+
105
+ V8_INLINE static SymbolObject* Cast(Value* value) {
106
+ #ifdef V8_ENABLE_CHECKS
107
+ CheckCast(value);
108
+ #endif
109
+ return static_cast<SymbolObject*>(value);
110
+ }
111
+
112
+ private:
113
+ static void CheckCast(Value* obj);
114
+ };
115
+
116
+ } // namespace v8
117
+
118
+ #endif // INCLUDE_V8_PRIMITIVE_OBJECT_H_