libv8-node 15.14.0.1-aarch64-linux → 17.9.1.0-aarch64-linux
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/libv8-node/location.rb +1 -1
- data/ext/libv8-node/paths.rb +5 -1
- data/lib/libv8/node/version.rb +3 -3
- data/vendor/v8/{out.gn → aarch64-linux}/libv8/obj/libv8_monolith.a +0 -0
- data/vendor/v8/include/cppgc/allocation.h +110 -44
- data/vendor/v8/include/cppgc/common.h +9 -6
- data/vendor/v8/include/cppgc/cross-thread-persistent.h +465 -0
- data/vendor/v8/include/cppgc/custom-space.h +37 -2
- data/vendor/v8/include/cppgc/default-platform.h +47 -48
- data/vendor/v8/include/cppgc/ephemeron-pair.h +30 -0
- data/vendor/v8/include/cppgc/explicit-management.h +82 -0
- data/vendor/v8/include/cppgc/garbage-collected.h +4 -3
- data/vendor/v8/include/cppgc/heap-consistency.h +253 -0
- data/vendor/v8/include/cppgc/heap-state.h +70 -0
- data/vendor/v8/include/cppgc/heap-statistics.h +120 -0
- data/vendor/v8/include/cppgc/heap.h +68 -6
- data/vendor/v8/include/cppgc/internal/api-constants.h +3 -3
- data/vendor/v8/include/cppgc/internal/caged-heap-local-data.h +4 -3
- data/vendor/v8/include/cppgc/internal/compiler-specific.h +2 -2
- data/vendor/v8/include/cppgc/internal/finalizer-trait.h +2 -0
- data/vendor/v8/include/cppgc/internal/gc-info.h +124 -13
- data/vendor/v8/include/cppgc/internal/name-trait.h +122 -0
- data/vendor/v8/include/cppgc/internal/persistent-node.h +94 -6
- data/vendor/v8/include/cppgc/internal/pointer-policies.h +81 -29
- data/vendor/v8/include/cppgc/internal/prefinalizer-handler.h +1 -1
- data/vendor/v8/include/cppgc/internal/write-barrier.h +398 -35
- data/vendor/v8/include/cppgc/liveness-broker.h +11 -2
- data/vendor/v8/include/cppgc/macros.h +2 -0
- data/vendor/v8/include/cppgc/member.h +87 -25
- data/vendor/v8/include/cppgc/name-provider.h +65 -0
- data/vendor/v8/include/cppgc/object-size-trait.h +58 -0
- data/vendor/v8/include/cppgc/persistent.h +41 -11
- data/vendor/v8/include/cppgc/platform.h +49 -25
- data/vendor/v8/include/cppgc/prefinalizer.h +2 -2
- data/vendor/v8/include/cppgc/process-heap-statistics.h +36 -0
- data/vendor/v8/include/cppgc/sentinel-pointer.h +32 -0
- data/vendor/v8/include/cppgc/source-location.h +2 -1
- data/vendor/v8/include/cppgc/testing.h +99 -0
- data/vendor/v8/include/cppgc/trace-trait.h +8 -3
- data/vendor/v8/include/cppgc/type-traits.h +157 -19
- data/vendor/v8/include/cppgc/visitor.h +194 -28
- data/vendor/v8/include/libplatform/libplatform.h +11 -0
- data/vendor/v8/include/libplatform/v8-tracing.h +2 -0
- data/vendor/v8/include/v8-array-buffer.h +433 -0
- data/vendor/v8/include/v8-callbacks.h +377 -0
- data/vendor/v8/include/v8-container.h +129 -0
- data/vendor/v8/include/v8-context.h +418 -0
- data/vendor/v8/include/v8-cppgc.h +261 -159
- data/vendor/v8/include/v8-data.h +65 -0
- data/vendor/v8/include/v8-date.h +43 -0
- data/vendor/v8/include/v8-debug.h +151 -0
- data/vendor/v8/include/v8-embedder-heap.h +238 -0
- data/vendor/v8/include/v8-exception.h +224 -0
- data/vendor/v8/include/v8-extension.h +62 -0
- data/vendor/v8/include/v8-external.h +37 -0
- data/vendor/v8/include/v8-fast-api-calls.h +652 -152
- data/vendor/v8/include/v8-forward.h +81 -0
- data/vendor/v8/include/v8-function-callback.h +475 -0
- data/vendor/v8/include/v8-function.h +122 -0
- data/vendor/v8/include/v8-initialization.h +282 -0
- data/vendor/v8/include/v8-inspector.h +33 -25
- data/vendor/v8/include/v8-internal.h +178 -31
- data/vendor/v8/include/v8-isolate.h +1662 -0
- data/vendor/v8/include/v8-json.h +47 -0
- data/vendor/v8/include/v8-local-handle.h +459 -0
- data/vendor/v8/include/v8-locker.h +148 -0
- data/vendor/v8/include/v8-maybe.h +137 -0
- data/vendor/v8/include/v8-memory-span.h +43 -0
- data/vendor/v8/include/v8-message.h +241 -0
- data/vendor/v8/include/v8-metrics.h +114 -9
- data/vendor/v8/include/v8-microtask-queue.h +152 -0
- data/vendor/v8/include/v8-microtask.h +28 -0
- data/vendor/v8/include/v8-object.h +770 -0
- data/vendor/v8/include/v8-persistent-handle.h +590 -0
- data/vendor/v8/include/v8-platform.h +74 -25
- data/vendor/v8/include/v8-primitive-object.h +118 -0
- data/vendor/v8/include/v8-primitive.h +858 -0
- data/vendor/v8/include/v8-profiler.h +72 -9
- data/vendor/v8/include/v8-promise.h +174 -0
- data/vendor/v8/include/v8-proxy.h +50 -0
- data/vendor/v8/include/v8-regexp.h +105 -0
- data/vendor/v8/include/v8-script.h +771 -0
- data/vendor/v8/include/v8-snapshot.h +198 -0
- data/vendor/v8/include/v8-statistics.h +215 -0
- data/vendor/v8/include/v8-template.h +1052 -0
- data/vendor/v8/include/v8-traced-handle.h +605 -0
- data/vendor/v8/include/v8-typed-array.h +282 -0
- data/vendor/v8/include/v8-unwinder-state.h +31 -0
- data/vendor/v8/include/v8-unwinder.h +129 -0
- data/vendor/v8/include/v8-util.h +8 -2
- data/vendor/v8/include/v8-value-serializer.h +249 -0
- data/vendor/v8/include/v8-value.h +526 -0
- data/vendor/v8/include/v8-version.h +3 -3
- data/vendor/v8/include/v8-wasm.h +245 -0
- data/vendor/v8/include/v8-weak-callback-info.h +73 -0
- data/vendor/v8/include/v8.h +41 -12050
- data/vendor/v8/include/v8config.h +87 -11
- metadata +60 -6
- data/vendor/v8/include/cppgc/internal/process-heap.h +0 -34
@@ -0,0 +1,152 @@
|
|
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_MICROTASKS_QUEUE_H_
|
6
|
+
#define INCLUDE_V8_MICROTASKS_QUEUE_H_
|
7
|
+
|
8
|
+
#include <stddef.h>
|
9
|
+
|
10
|
+
#include <memory>
|
11
|
+
|
12
|
+
#include "v8-local-handle.h" // NOLINT(build/include_directory)
|
13
|
+
#include "v8-microtask.h" // NOLINT(build/include_directory)
|
14
|
+
#include "v8config.h" // NOLINT(build/include_directory)
|
15
|
+
|
16
|
+
namespace v8 {
|
17
|
+
|
18
|
+
class Function;
|
19
|
+
|
20
|
+
namespace internal {
|
21
|
+
class Isolate;
|
22
|
+
class MicrotaskQueue;
|
23
|
+
} // namespace internal
|
24
|
+
|
25
|
+
/**
|
26
|
+
* Represents the microtask queue, where microtasks are stored and processed.
|
27
|
+
* https://html.spec.whatwg.org/multipage/webappapis.html#microtask-queue
|
28
|
+
* https://html.spec.whatwg.org/multipage/webappapis.html#enqueuejob(queuename,-job,-arguments)
|
29
|
+
* https://html.spec.whatwg.org/multipage/webappapis.html#perform-a-microtask-checkpoint
|
30
|
+
*
|
31
|
+
* A MicrotaskQueue instance may be associated to multiple Contexts by passing
|
32
|
+
* it to Context::New(), and they can be detached by Context::DetachGlobal().
|
33
|
+
* The embedder must keep the MicrotaskQueue instance alive until all associated
|
34
|
+
* Contexts are gone or detached.
|
35
|
+
*
|
36
|
+
* Use the same instance of MicrotaskQueue for all Contexts that may access each
|
37
|
+
* other synchronously. E.g. for Web embedding, use the same instance for all
|
38
|
+
* origins that share the same URL scheme and eTLD+1.
|
39
|
+
*/
|
40
|
+
class V8_EXPORT MicrotaskQueue {
|
41
|
+
public:
|
42
|
+
/**
|
43
|
+
* Creates an empty MicrotaskQueue instance.
|
44
|
+
*/
|
45
|
+
static std::unique_ptr<MicrotaskQueue> New(
|
46
|
+
Isolate* isolate, MicrotasksPolicy policy = MicrotasksPolicy::kAuto);
|
47
|
+
|
48
|
+
virtual ~MicrotaskQueue() = default;
|
49
|
+
|
50
|
+
/**
|
51
|
+
* Enqueues the callback to the queue.
|
52
|
+
*/
|
53
|
+
virtual void EnqueueMicrotask(Isolate* isolate,
|
54
|
+
Local<Function> microtask) = 0;
|
55
|
+
|
56
|
+
/**
|
57
|
+
* Enqueues the callback to the queue.
|
58
|
+
*/
|
59
|
+
virtual void EnqueueMicrotask(v8::Isolate* isolate,
|
60
|
+
MicrotaskCallback callback,
|
61
|
+
void* data = nullptr) = 0;
|
62
|
+
|
63
|
+
/**
|
64
|
+
* Adds a callback to notify the embedder after microtasks were run. The
|
65
|
+
* callback is triggered by explicit RunMicrotasks call or automatic
|
66
|
+
* microtasks execution (see Isolate::SetMicrotasksPolicy).
|
67
|
+
*
|
68
|
+
* Callback will trigger even if microtasks were attempted to run,
|
69
|
+
* but the microtasks queue was empty and no single microtask was actually
|
70
|
+
* executed.
|
71
|
+
*
|
72
|
+
* Executing scripts inside the callback will not re-trigger microtasks and
|
73
|
+
* the callback.
|
74
|
+
*/
|
75
|
+
virtual void AddMicrotasksCompletedCallback(
|
76
|
+
MicrotasksCompletedCallbackWithData callback, void* data = nullptr) = 0;
|
77
|
+
|
78
|
+
/**
|
79
|
+
* Removes callback that was installed by AddMicrotasksCompletedCallback.
|
80
|
+
*/
|
81
|
+
virtual void RemoveMicrotasksCompletedCallback(
|
82
|
+
MicrotasksCompletedCallbackWithData callback, void* data = nullptr) = 0;
|
83
|
+
|
84
|
+
/**
|
85
|
+
* Runs microtasks if no microtask is running on this MicrotaskQueue instance.
|
86
|
+
*/
|
87
|
+
virtual void PerformCheckpoint(Isolate* isolate) = 0;
|
88
|
+
|
89
|
+
/**
|
90
|
+
* Returns true if a microtask is running on this MicrotaskQueue instance.
|
91
|
+
*/
|
92
|
+
virtual bool IsRunningMicrotasks() const = 0;
|
93
|
+
|
94
|
+
/**
|
95
|
+
* Returns the current depth of nested MicrotasksScope that has
|
96
|
+
* kRunMicrotasks.
|
97
|
+
*/
|
98
|
+
virtual int GetMicrotasksScopeDepth() const = 0;
|
99
|
+
|
100
|
+
MicrotaskQueue(const MicrotaskQueue&) = delete;
|
101
|
+
MicrotaskQueue& operator=(const MicrotaskQueue&) = delete;
|
102
|
+
|
103
|
+
private:
|
104
|
+
friend class internal::MicrotaskQueue;
|
105
|
+
MicrotaskQueue() = default;
|
106
|
+
};
|
107
|
+
|
108
|
+
/**
|
109
|
+
* This scope is used to control microtasks when MicrotasksPolicy::kScoped
|
110
|
+
* is used on Isolate. In this mode every non-primitive call to V8 should be
|
111
|
+
* done inside some MicrotasksScope.
|
112
|
+
* Microtasks are executed when topmost MicrotasksScope marked as kRunMicrotasks
|
113
|
+
* exits.
|
114
|
+
* kDoNotRunMicrotasks should be used to annotate calls not intended to trigger
|
115
|
+
* microtasks.
|
116
|
+
*/
|
117
|
+
class V8_EXPORT V8_NODISCARD MicrotasksScope {
|
118
|
+
public:
|
119
|
+
enum Type { kRunMicrotasks, kDoNotRunMicrotasks };
|
120
|
+
|
121
|
+
MicrotasksScope(Isolate* isolate, Type type);
|
122
|
+
MicrotasksScope(Isolate* isolate, MicrotaskQueue* microtask_queue, Type type);
|
123
|
+
~MicrotasksScope();
|
124
|
+
|
125
|
+
/**
|
126
|
+
* Runs microtasks if no kRunMicrotasks scope is currently active.
|
127
|
+
*/
|
128
|
+
static void PerformCheckpoint(Isolate* isolate);
|
129
|
+
|
130
|
+
/**
|
131
|
+
* Returns current depth of nested kRunMicrotasks scopes.
|
132
|
+
*/
|
133
|
+
static int GetCurrentDepth(Isolate* isolate);
|
134
|
+
|
135
|
+
/**
|
136
|
+
* Returns true while microtasks are being executed.
|
137
|
+
*/
|
138
|
+
static bool IsRunningMicrotasks(Isolate* isolate);
|
139
|
+
|
140
|
+
// Prevent copying.
|
141
|
+
MicrotasksScope(const MicrotasksScope&) = delete;
|
142
|
+
MicrotasksScope& operator=(const MicrotasksScope&) = delete;
|
143
|
+
|
144
|
+
private:
|
145
|
+
internal::Isolate* const isolate_;
|
146
|
+
internal::MicrotaskQueue* const microtask_queue_;
|
147
|
+
bool run_;
|
148
|
+
};
|
149
|
+
|
150
|
+
} // namespace v8
|
151
|
+
|
152
|
+
#endif // INCLUDE_V8_MICROTASKS_QUEUE_H_
|
@@ -0,0 +1,28 @@
|
|
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_MICROTASK_H_
|
6
|
+
#define INCLUDE_V8_MICROTASK_H_
|
7
|
+
|
8
|
+
namespace v8 {
|
9
|
+
|
10
|
+
class Isolate;
|
11
|
+
|
12
|
+
// --- Microtasks Callbacks ---
|
13
|
+
using MicrotasksCompletedCallbackWithData = void (*)(Isolate*, void*);
|
14
|
+
using MicrotaskCallback = void (*)(void* data);
|
15
|
+
|
16
|
+
/**
|
17
|
+
* Policy for running microtasks:
|
18
|
+
* - explicit: microtasks are invoked with the
|
19
|
+
* Isolate::PerformMicrotaskCheckpoint() method;
|
20
|
+
* - scoped: microtasks invocation is controlled by MicrotasksScope objects;
|
21
|
+
* - auto: microtasks are invoked when the script call depth decrements
|
22
|
+
* to zero.
|
23
|
+
*/
|
24
|
+
enum class MicrotasksPolicy { kExplicit, kScoped, kAuto };
|
25
|
+
|
26
|
+
} // namespace v8
|
27
|
+
|
28
|
+
#endif // INCLUDE_V8_MICROTASK_H_
|