libv8-node 16.19.0.1-aarch64-linux-musl → 17.9.1.1-aarch64-linux-musl
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/libv8/node/version.rb +3 -3
- data/vendor/v8/aarch64-linux-musl/libv8/obj/libv8_monolith.a +0 -0
- data/vendor/v8/include/cppgc/allocation.h +11 -5
- data/vendor/v8/include/cppgc/cross-thread-persistent.h +78 -26
- data/vendor/v8/include/cppgc/internal/caged-heap-local-data.h +2 -2
- data/vendor/v8/include/cppgc/internal/finalizer-trait.h +2 -0
- data/vendor/v8/include/cppgc/internal/gc-info.h +90 -10
- data/vendor/v8/include/cppgc/internal/name-trait.h +11 -0
- data/vendor/v8/include/cppgc/internal/persistent-node.h +44 -12
- data/vendor/v8/include/cppgc/internal/pointer-policies.h +22 -11
- data/vendor/v8/include/cppgc/internal/write-barrier.h +9 -1
- data/vendor/v8/include/cppgc/persistent.h +1 -1
- data/vendor/v8/include/cppgc/prefinalizer.h +1 -1
- 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 +5 -2
- 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 +63 -11
- 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 +11 -21
- data/vendor/v8/include/v8-internal.h +85 -22
- 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 +37 -1
- 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 +41 -17
- 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 +10 -11
- 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 +4 -3
- data/vendor/v8/include/v8-unwinder.h +129 -0
- data/vendor/v8/include/v8-util.h +7 -1
- 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 -12604
- metadata +43 -1
@@ -11,7 +11,9 @@
|
|
11
11
|
#include <unordered_set>
|
12
12
|
#include <vector>
|
13
13
|
|
14
|
-
#include "v8.h"
|
14
|
+
#include "v8-local-handle.h" // NOLINT(build/include_directory)
|
15
|
+
#include "v8-message.h" // NOLINT(build/include_directory)
|
16
|
+
#include "v8-persistent-handle.h" // NOLINT(build/include_directory)
|
15
17
|
|
16
18
|
/**
|
17
19
|
* Profiler support for the V8 JavaScript engine.
|
@@ -20,6 +22,7 @@ namespace v8 {
|
|
20
22
|
|
21
23
|
class HeapGraphNode;
|
22
24
|
struct HeapStatsUpdate;
|
25
|
+
class Object;
|
23
26
|
|
24
27
|
using NativeObject = void*;
|
25
28
|
using SnapshotObjectId = uint32_t;
|
@@ -289,8 +292,8 @@ class V8_EXPORT CpuProfilingOptions {
|
|
289
292
|
* interval, set via SetSamplingInterval(). If
|
290
293
|
* zero, the sampling interval will be equal to
|
291
294
|
* the profiler's sampling interval.
|
292
|
-
* \param filter_context
|
293
|
-
*
|
295
|
+
* \param filter_context If specified, profiles will only contain frames
|
296
|
+
* using this context. Other frames will be elided.
|
294
297
|
*/
|
295
298
|
CpuProfilingOptions(
|
296
299
|
CpuProfilingMode mode = kLeafNodeLineNumbers,
|
@@ -304,9 +307,13 @@ class V8_EXPORT CpuProfilingOptions {
|
|
304
307
|
private:
|
305
308
|
friend class internal::CpuProfile;
|
306
309
|
|
310
|
+
bool has_filter_context() const { return !filter_context_.IsEmpty(); }
|
311
|
+
void* raw_filter_context() const;
|
312
|
+
|
307
313
|
CpuProfilingMode mode_;
|
308
314
|
unsigned max_samples_;
|
309
315
|
int sampling_interval_us_;
|
316
|
+
CopyablePersistentTraits<Context>::CopyablePersistent filter_context_;
|
310
317
|
};
|
311
318
|
|
312
319
|
/**
|
@@ -896,14 +903,6 @@ class V8_EXPORT HeapProfiler {
|
|
896
903
|
* Takes a heap snapshot and returns it.
|
897
904
|
*/
|
898
905
|
const HeapSnapshot* TakeHeapSnapshot(
|
899
|
-
ActivityControl* control = nullptr,
|
900
|
-
ObjectNameResolver* global_object_name_resolver = nullptr,
|
901
|
-
bool treat_global_objects_as_roots = true);
|
902
|
-
|
903
|
-
/**
|
904
|
-
* Takes a heap snapshot and returns it.
|
905
|
-
*/
|
906
|
-
const HeapSnapshot* TakeHeapSnapshotV8_92(
|
907
906
|
ActivityControl* control = nullptr,
|
908
907
|
ObjectNameResolver* global_object_name_resolver = nullptr,
|
909
908
|
bool treat_global_objects_as_roots = true,
|
@@ -0,0 +1,174 @@
|
|
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_PROMISE_H_
|
6
|
+
#define INCLUDE_V8_PROMISE_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 Context;
|
15
|
+
|
16
|
+
#ifndef V8_PROMISE_INTERNAL_FIELD_COUNT
|
17
|
+
// The number of required internal fields can be defined by embedder.
|
18
|
+
#define V8_PROMISE_INTERNAL_FIELD_COUNT 0
|
19
|
+
#endif
|
20
|
+
|
21
|
+
/**
|
22
|
+
* An instance of the built-in Promise constructor (ES6 draft).
|
23
|
+
*/
|
24
|
+
class V8_EXPORT Promise : public Object {
|
25
|
+
public:
|
26
|
+
/**
|
27
|
+
* State of the promise. Each value corresponds to one of the possible values
|
28
|
+
* of the [[PromiseState]] field.
|
29
|
+
*/
|
30
|
+
enum PromiseState { kPending, kFulfilled, kRejected };
|
31
|
+
|
32
|
+
class V8_EXPORT Resolver : public Object {
|
33
|
+
public:
|
34
|
+
/**
|
35
|
+
* Create a new resolver, along with an associated promise in pending state.
|
36
|
+
*/
|
37
|
+
static V8_WARN_UNUSED_RESULT MaybeLocal<Resolver> New(
|
38
|
+
Local<Context> context);
|
39
|
+
|
40
|
+
/**
|
41
|
+
* Extract the associated promise.
|
42
|
+
*/
|
43
|
+
Local<Promise> GetPromise();
|
44
|
+
|
45
|
+
/**
|
46
|
+
* Resolve/reject the associated promise with a given value.
|
47
|
+
* Ignored if the promise is no longer pending.
|
48
|
+
*/
|
49
|
+
V8_WARN_UNUSED_RESULT Maybe<bool> Resolve(Local<Context> context,
|
50
|
+
Local<Value> value);
|
51
|
+
|
52
|
+
V8_WARN_UNUSED_RESULT Maybe<bool> Reject(Local<Context> context,
|
53
|
+
Local<Value> value);
|
54
|
+
|
55
|
+
V8_INLINE static Resolver* Cast(Value* value) {
|
56
|
+
#ifdef V8_ENABLE_CHECKS
|
57
|
+
CheckCast(value);
|
58
|
+
#endif
|
59
|
+
return static_cast<Promise::Resolver*>(value);
|
60
|
+
}
|
61
|
+
|
62
|
+
private:
|
63
|
+
Resolver();
|
64
|
+
static void CheckCast(Value* obj);
|
65
|
+
};
|
66
|
+
|
67
|
+
/**
|
68
|
+
* Register a resolution/rejection handler with a promise.
|
69
|
+
* The handler is given the respective resolution/rejection value as
|
70
|
+
* an argument. If the promise is already resolved/rejected, the handler is
|
71
|
+
* invoked at the end of turn.
|
72
|
+
*/
|
73
|
+
V8_WARN_UNUSED_RESULT MaybeLocal<Promise> Catch(Local<Context> context,
|
74
|
+
Local<Function> handler);
|
75
|
+
|
76
|
+
V8_WARN_UNUSED_RESULT MaybeLocal<Promise> Then(Local<Context> context,
|
77
|
+
Local<Function> handler);
|
78
|
+
|
79
|
+
V8_WARN_UNUSED_RESULT MaybeLocal<Promise> Then(Local<Context> context,
|
80
|
+
Local<Function> on_fulfilled,
|
81
|
+
Local<Function> on_rejected);
|
82
|
+
|
83
|
+
/**
|
84
|
+
* Returns true if the promise has at least one derived promise, and
|
85
|
+
* therefore resolve/reject handlers (including default handler).
|
86
|
+
*/
|
87
|
+
bool HasHandler() const;
|
88
|
+
|
89
|
+
/**
|
90
|
+
* Returns the content of the [[PromiseResult]] field. The Promise must not
|
91
|
+
* be pending.
|
92
|
+
*/
|
93
|
+
Local<Value> Result();
|
94
|
+
|
95
|
+
/**
|
96
|
+
* Returns the value of the [[PromiseState]] field.
|
97
|
+
*/
|
98
|
+
PromiseState State();
|
99
|
+
|
100
|
+
/**
|
101
|
+
* Marks this promise as handled to avoid reporting unhandled rejections.
|
102
|
+
*/
|
103
|
+
void MarkAsHandled();
|
104
|
+
|
105
|
+
/**
|
106
|
+
* Marks this promise as silent to prevent pausing the debugger when the
|
107
|
+
* promise is rejected.
|
108
|
+
*/
|
109
|
+
void MarkAsSilent();
|
110
|
+
|
111
|
+
V8_INLINE static Promise* Cast(Value* value) {
|
112
|
+
#ifdef V8_ENABLE_CHECKS
|
113
|
+
CheckCast(value);
|
114
|
+
#endif
|
115
|
+
return static_cast<Promise*>(value);
|
116
|
+
}
|
117
|
+
|
118
|
+
static const int kEmbedderFieldCount = V8_PROMISE_INTERNAL_FIELD_COUNT;
|
119
|
+
|
120
|
+
private:
|
121
|
+
Promise();
|
122
|
+
static void CheckCast(Value* obj);
|
123
|
+
};
|
124
|
+
|
125
|
+
/**
|
126
|
+
* PromiseHook with type kInit is called when a new promise is
|
127
|
+
* created. When a new promise is created as part of the chain in the
|
128
|
+
* case of Promise.then or in the intermediate promises created by
|
129
|
+
* Promise.{race, all}/AsyncFunctionAwait, we pass the parent promise
|
130
|
+
* otherwise we pass undefined.
|
131
|
+
*
|
132
|
+
* PromiseHook with type kResolve is called at the beginning of
|
133
|
+
* resolve or reject function defined by CreateResolvingFunctions.
|
134
|
+
*
|
135
|
+
* PromiseHook with type kBefore is called at the beginning of the
|
136
|
+
* PromiseReactionJob.
|
137
|
+
*
|
138
|
+
* PromiseHook with type kAfter is called right at the end of the
|
139
|
+
* PromiseReactionJob.
|
140
|
+
*/
|
141
|
+
enum class PromiseHookType { kInit, kResolve, kBefore, kAfter };
|
142
|
+
|
143
|
+
using PromiseHook = void (*)(PromiseHookType type, Local<Promise> promise,
|
144
|
+
Local<Value> parent);
|
145
|
+
|
146
|
+
// --- Promise Reject Callback ---
|
147
|
+
enum PromiseRejectEvent {
|
148
|
+
kPromiseRejectWithNoHandler = 0,
|
149
|
+
kPromiseHandlerAddedAfterReject = 1,
|
150
|
+
kPromiseRejectAfterResolved = 2,
|
151
|
+
kPromiseResolveAfterResolved = 3,
|
152
|
+
};
|
153
|
+
|
154
|
+
class PromiseRejectMessage {
|
155
|
+
public:
|
156
|
+
PromiseRejectMessage(Local<Promise> promise, PromiseRejectEvent event,
|
157
|
+
Local<Value> value)
|
158
|
+
: promise_(promise), event_(event), value_(value) {}
|
159
|
+
|
160
|
+
V8_INLINE Local<Promise> GetPromise() const { return promise_; }
|
161
|
+
V8_INLINE PromiseRejectEvent GetEvent() const { return event_; }
|
162
|
+
V8_INLINE Local<Value> GetValue() const { return value_; }
|
163
|
+
|
164
|
+
private:
|
165
|
+
Local<Promise> promise_;
|
166
|
+
PromiseRejectEvent event_;
|
167
|
+
Local<Value> value_;
|
168
|
+
};
|
169
|
+
|
170
|
+
using PromiseRejectCallback = void (*)(PromiseRejectMessage message);
|
171
|
+
|
172
|
+
} // namespace v8
|
173
|
+
|
174
|
+
#endif // INCLUDE_V8_PROMISE_H_
|
@@ -0,0 +1,50 @@
|
|
1
|
+
|
2
|
+
// Copyright 2021 the V8 project authors. All rights reserved.
|
3
|
+
// Use of this source code is governed by a BSD-style license that can be
|
4
|
+
// found in the LICENSE file.
|
5
|
+
|
6
|
+
#ifndef INCLUDE_V8_PROXY_H_
|
7
|
+
#define INCLUDE_V8_PROXY_H_
|
8
|
+
|
9
|
+
#include "v8-context.h" // NOLINT(build/include_directory)
|
10
|
+
#include "v8-local-handle.h" // NOLINT(build/include_directory)
|
11
|
+
#include "v8-object.h" // NOLINT(build/include_directory)
|
12
|
+
#include "v8config.h" // NOLINT(build/include_directory)
|
13
|
+
|
14
|
+
namespace v8 {
|
15
|
+
|
16
|
+
class Context;
|
17
|
+
|
18
|
+
/**
|
19
|
+
* An instance of the built-in Proxy constructor (ECMA-262, 6th Edition,
|
20
|
+
* 26.2.1).
|
21
|
+
*/
|
22
|
+
class V8_EXPORT Proxy : public Object {
|
23
|
+
public:
|
24
|
+
Local<Value> GetTarget();
|
25
|
+
Local<Value> GetHandler();
|
26
|
+
bool IsRevoked() const;
|
27
|
+
void Revoke();
|
28
|
+
|
29
|
+
/**
|
30
|
+
* Creates a new Proxy for the target object.
|
31
|
+
*/
|
32
|
+
static MaybeLocal<Proxy> New(Local<Context> context,
|
33
|
+
Local<Object> local_target,
|
34
|
+
Local<Object> local_handler);
|
35
|
+
|
36
|
+
V8_INLINE static Proxy* Cast(Value* value) {
|
37
|
+
#ifdef V8_ENABLE_CHECKS
|
38
|
+
CheckCast(value);
|
39
|
+
#endif
|
40
|
+
return static_cast<Proxy*>(value);
|
41
|
+
}
|
42
|
+
|
43
|
+
private:
|
44
|
+
Proxy();
|
45
|
+
static void CheckCast(Value* obj);
|
46
|
+
};
|
47
|
+
|
48
|
+
} // namespace v8
|
49
|
+
|
50
|
+
#endif // INCLUDE_V8_PROXY_H_
|
@@ -0,0 +1,105 @@
|
|
1
|
+
|
2
|
+
// Copyright 2021 the V8 project authors. All rights reserved.
|
3
|
+
// Use of this source code is governed by a BSD-style license that can be
|
4
|
+
// found in the LICENSE file.
|
5
|
+
|
6
|
+
#ifndef INCLUDE_V8_REGEXP_H_
|
7
|
+
#define INCLUDE_V8_REGEXP_H_
|
8
|
+
|
9
|
+
#include "v8-local-handle.h" // NOLINT(build/include_directory)
|
10
|
+
#include "v8-object.h" // NOLINT(build/include_directory)
|
11
|
+
#include "v8config.h" // NOLINT(build/include_directory)
|
12
|
+
|
13
|
+
namespace v8 {
|
14
|
+
|
15
|
+
class Context;
|
16
|
+
|
17
|
+
/**
|
18
|
+
* An instance of the built-in RegExp constructor (ECMA-262, 15.10).
|
19
|
+
*/
|
20
|
+
class V8_EXPORT RegExp : public Object {
|
21
|
+
public:
|
22
|
+
/**
|
23
|
+
* Regular expression flag bits. They can be or'ed to enable a set
|
24
|
+
* of flags.
|
25
|
+
* The kLinear value ('l') is experimental and can only be used with
|
26
|
+
* --enable-experimental-regexp-engine. RegExps with kLinear flag are
|
27
|
+
* guaranteed to be executed in asymptotic linear time wrt. the length of
|
28
|
+
* the subject string.
|
29
|
+
*/
|
30
|
+
enum Flags {
|
31
|
+
kNone = 0,
|
32
|
+
kGlobal = 1 << 0,
|
33
|
+
kIgnoreCase = 1 << 1,
|
34
|
+
kMultiline = 1 << 2,
|
35
|
+
kSticky = 1 << 3,
|
36
|
+
kUnicode = 1 << 4,
|
37
|
+
kDotAll = 1 << 5,
|
38
|
+
kLinear = 1 << 6,
|
39
|
+
kHasIndices = 1 << 7,
|
40
|
+
};
|
41
|
+
|
42
|
+
static constexpr int kFlagCount = 8;
|
43
|
+
|
44
|
+
/**
|
45
|
+
* Creates a regular expression from the given pattern string and
|
46
|
+
* the flags bit field. May throw a JavaScript exception as
|
47
|
+
* described in ECMA-262, 15.10.4.1.
|
48
|
+
*
|
49
|
+
* For example,
|
50
|
+
* RegExp::New(v8::String::New("foo"),
|
51
|
+
* static_cast<RegExp::Flags>(kGlobal | kMultiline))
|
52
|
+
* is equivalent to evaluating "/foo/gm".
|
53
|
+
*/
|
54
|
+
static V8_WARN_UNUSED_RESULT MaybeLocal<RegExp> New(Local<Context> context,
|
55
|
+
Local<String> pattern,
|
56
|
+
Flags flags);
|
57
|
+
|
58
|
+
/**
|
59
|
+
* Like New, but additionally specifies a backtrack limit. If the number of
|
60
|
+
* backtracks done in one Exec call hits the limit, a match failure is
|
61
|
+
* immediately returned.
|
62
|
+
*/
|
63
|
+
static V8_WARN_UNUSED_RESULT MaybeLocal<RegExp> NewWithBacktrackLimit(
|
64
|
+
Local<Context> context, Local<String> pattern, Flags flags,
|
65
|
+
uint32_t backtrack_limit);
|
66
|
+
|
67
|
+
/**
|
68
|
+
* Executes the current RegExp instance on the given subject string.
|
69
|
+
* Equivalent to RegExp.prototype.exec as described in
|
70
|
+
*
|
71
|
+
* https://tc39.es/ecma262/#sec-regexp.prototype.exec
|
72
|
+
*
|
73
|
+
* On success, an Array containing the matched strings is returned. On
|
74
|
+
* failure, returns Null.
|
75
|
+
*
|
76
|
+
* Note: modifies global context state, accessible e.g. through RegExp.input.
|
77
|
+
*/
|
78
|
+
V8_WARN_UNUSED_RESULT MaybeLocal<Object> Exec(Local<Context> context,
|
79
|
+
Local<String> subject);
|
80
|
+
|
81
|
+
/**
|
82
|
+
* Returns the value of the source property: a string representing
|
83
|
+
* the regular expression.
|
84
|
+
*/
|
85
|
+
Local<String> GetSource() const;
|
86
|
+
|
87
|
+
/**
|
88
|
+
* Returns the flags bit field.
|
89
|
+
*/
|
90
|
+
Flags GetFlags() const;
|
91
|
+
|
92
|
+
V8_INLINE static RegExp* Cast(Value* value) {
|
93
|
+
#ifdef V8_ENABLE_CHECKS
|
94
|
+
CheckCast(value);
|
95
|
+
#endif
|
96
|
+
return static_cast<RegExp*>(value);
|
97
|
+
}
|
98
|
+
|
99
|
+
private:
|
100
|
+
static void CheckCast(Value* obj);
|
101
|
+
};
|
102
|
+
|
103
|
+
} // namespace v8
|
104
|
+
|
105
|
+
#endif // INCLUDE_V8_REGEXP_H_
|