libv8-node 15.12.0.0.beta1-aarch64-linux-musl → 17.9.1.0-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/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-musl}/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 +65 -11
- data/vendor/v8/include/cppgc/internal/process-heap.h +0 -34
@@ -0,0 +1,137 @@
|
|
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_MAYBE_H_
|
6
|
+
#define INCLUDE_V8_MAYBE_H_
|
7
|
+
|
8
|
+
#include "v8-internal.h" // NOLINT(build/include_directory)
|
9
|
+
#include "v8config.h" // NOLINT(build/include_directory)
|
10
|
+
|
11
|
+
namespace v8 {
|
12
|
+
|
13
|
+
namespace api_internal {
|
14
|
+
// Called when ToChecked is called on an empty Maybe.
|
15
|
+
V8_EXPORT void FromJustIsNothing();
|
16
|
+
} // namespace api_internal
|
17
|
+
|
18
|
+
/**
|
19
|
+
* A simple Maybe type, representing an object which may or may not have a
|
20
|
+
* value, see https://hackage.haskell.org/package/base/docs/Data-Maybe.html.
|
21
|
+
*
|
22
|
+
* If an API method returns a Maybe<>, the API method can potentially fail
|
23
|
+
* either because an exception is thrown, or because an exception is pending,
|
24
|
+
* e.g. because a previous API call threw an exception that hasn't been caught
|
25
|
+
* yet, or because a TerminateExecution exception was thrown. In that case, a
|
26
|
+
* "Nothing" value is returned.
|
27
|
+
*/
|
28
|
+
template <class T>
|
29
|
+
class Maybe {
|
30
|
+
public:
|
31
|
+
V8_INLINE bool IsNothing() const { return !has_value_; }
|
32
|
+
V8_INLINE bool IsJust() const { return has_value_; }
|
33
|
+
|
34
|
+
/**
|
35
|
+
* An alias for |FromJust|. Will crash if the Maybe<> is nothing.
|
36
|
+
*/
|
37
|
+
V8_INLINE T ToChecked() const { return FromJust(); }
|
38
|
+
|
39
|
+
/**
|
40
|
+
* Short-hand for ToChecked(), which doesn't return a value. To be used, where
|
41
|
+
* the actual value of the Maybe is not needed like Object::Set.
|
42
|
+
*/
|
43
|
+
V8_INLINE void Check() const {
|
44
|
+
if (V8_UNLIKELY(!IsJust())) api_internal::FromJustIsNothing();
|
45
|
+
}
|
46
|
+
|
47
|
+
/**
|
48
|
+
* Converts this Maybe<> to a value of type T. If this Maybe<> is
|
49
|
+
* nothing (empty), |false| is returned and |out| is left untouched.
|
50
|
+
*/
|
51
|
+
V8_WARN_UNUSED_RESULT V8_INLINE bool To(T* out) const {
|
52
|
+
if (V8_LIKELY(IsJust())) *out = value_;
|
53
|
+
return IsJust();
|
54
|
+
}
|
55
|
+
|
56
|
+
/**
|
57
|
+
* Converts this Maybe<> to a value of type T. If this Maybe<> is
|
58
|
+
* nothing (empty), V8 will crash the process.
|
59
|
+
*/
|
60
|
+
V8_INLINE T FromJust() const {
|
61
|
+
if (V8_UNLIKELY(!IsJust())) api_internal::FromJustIsNothing();
|
62
|
+
return value_;
|
63
|
+
}
|
64
|
+
|
65
|
+
/**
|
66
|
+
* Converts this Maybe<> to a value of type T, using a default value if this
|
67
|
+
* Maybe<> is nothing (empty).
|
68
|
+
*/
|
69
|
+
V8_INLINE T FromMaybe(const T& default_value) const {
|
70
|
+
return has_value_ ? value_ : default_value;
|
71
|
+
}
|
72
|
+
|
73
|
+
V8_INLINE bool operator==(const Maybe& other) const {
|
74
|
+
return (IsJust() == other.IsJust()) &&
|
75
|
+
(!IsJust() || FromJust() == other.FromJust());
|
76
|
+
}
|
77
|
+
|
78
|
+
V8_INLINE bool operator!=(const Maybe& other) const {
|
79
|
+
return !operator==(other);
|
80
|
+
}
|
81
|
+
|
82
|
+
private:
|
83
|
+
Maybe() : has_value_(false) {}
|
84
|
+
explicit Maybe(const T& t) : has_value_(true), value_(t) {}
|
85
|
+
|
86
|
+
bool has_value_;
|
87
|
+
T value_;
|
88
|
+
|
89
|
+
template <class U>
|
90
|
+
friend Maybe<U> Nothing();
|
91
|
+
template <class U>
|
92
|
+
friend Maybe<U> Just(const U& u);
|
93
|
+
};
|
94
|
+
|
95
|
+
template <class T>
|
96
|
+
inline Maybe<T> Nothing() {
|
97
|
+
return Maybe<T>();
|
98
|
+
}
|
99
|
+
|
100
|
+
template <class T>
|
101
|
+
inline Maybe<T> Just(const T& t) {
|
102
|
+
return Maybe<T>(t);
|
103
|
+
}
|
104
|
+
|
105
|
+
// A template specialization of Maybe<T> for the case of T = void.
|
106
|
+
template <>
|
107
|
+
class Maybe<void> {
|
108
|
+
public:
|
109
|
+
V8_INLINE bool IsNothing() const { return !is_valid_; }
|
110
|
+
V8_INLINE bool IsJust() const { return is_valid_; }
|
111
|
+
|
112
|
+
V8_INLINE bool operator==(const Maybe& other) const {
|
113
|
+
return IsJust() == other.IsJust();
|
114
|
+
}
|
115
|
+
|
116
|
+
V8_INLINE bool operator!=(const Maybe& other) const {
|
117
|
+
return !operator==(other);
|
118
|
+
}
|
119
|
+
|
120
|
+
private:
|
121
|
+
struct JustTag {};
|
122
|
+
|
123
|
+
Maybe() : is_valid_(false) {}
|
124
|
+
explicit Maybe(JustTag) : is_valid_(true) {}
|
125
|
+
|
126
|
+
bool is_valid_;
|
127
|
+
|
128
|
+
template <class U>
|
129
|
+
friend Maybe<U> Nothing();
|
130
|
+
friend Maybe<void> JustVoid();
|
131
|
+
};
|
132
|
+
|
133
|
+
inline Maybe<void> JustVoid() { return Maybe<void>(Maybe<void>::JustTag()); }
|
134
|
+
|
135
|
+
} // namespace v8
|
136
|
+
|
137
|
+
#endif // INCLUDE_V8_MAYBE_H_
|
@@ -0,0 +1,43 @@
|
|
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_MEMORY_SPAN_H_
|
6
|
+
#define INCLUDE_V8_MEMORY_SPAN_H_
|
7
|
+
|
8
|
+
#include <stddef.h>
|
9
|
+
|
10
|
+
#include "v8config.h" // NOLINT(build/include_directory)
|
11
|
+
|
12
|
+
namespace v8 {
|
13
|
+
|
14
|
+
/**
|
15
|
+
* Points to an unowned continous buffer holding a known number of elements.
|
16
|
+
*
|
17
|
+
* This is similar to std::span (under consideration for C++20), but does not
|
18
|
+
* require advanced C++ support. In the (far) future, this may be replaced with
|
19
|
+
* or aliased to std::span.
|
20
|
+
*
|
21
|
+
* To facilitate future migration, this class exposes a subset of the interface
|
22
|
+
* implemented by std::span.
|
23
|
+
*/
|
24
|
+
template <typename T>
|
25
|
+
class V8_EXPORT MemorySpan {
|
26
|
+
public:
|
27
|
+
/** The default constructor creates an empty span. */
|
28
|
+
constexpr MemorySpan() = default;
|
29
|
+
|
30
|
+
constexpr MemorySpan(T* data, size_t size) : data_(data), size_(size) {}
|
31
|
+
|
32
|
+
/** Returns a pointer to the beginning of the buffer. */
|
33
|
+
constexpr T* data() const { return data_; }
|
34
|
+
/** Returns the number of elements that the buffer holds. */
|
35
|
+
constexpr size_t size() const { return size_; }
|
36
|
+
|
37
|
+
private:
|
38
|
+
T* data_ = nullptr;
|
39
|
+
size_t size_ = 0;
|
40
|
+
};
|
41
|
+
|
42
|
+
} // namespace v8
|
43
|
+
#endif // INCLUDE_V8_MEMORY_SPAN_H_
|
@@ -0,0 +1,241 @@
|
|
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_MESSAGE_H_
|
6
|
+
#define INCLUDE_V8_MESSAGE_H_
|
7
|
+
|
8
|
+
#include <stdio.h>
|
9
|
+
|
10
|
+
#include <iosfwd>
|
11
|
+
|
12
|
+
#include "v8-local-handle.h" // NOLINT(build/include_directory)
|
13
|
+
#include "v8-maybe.h" // NOLINT(build/include_directory)
|
14
|
+
#include "v8config.h" // NOLINT(build/include_directory)
|
15
|
+
|
16
|
+
namespace v8 {
|
17
|
+
|
18
|
+
class Integer;
|
19
|
+
class PrimitiveArray;
|
20
|
+
class StackTrace;
|
21
|
+
class String;
|
22
|
+
class Value;
|
23
|
+
|
24
|
+
/**
|
25
|
+
* The optional attributes of ScriptOrigin.
|
26
|
+
*/
|
27
|
+
class ScriptOriginOptions {
|
28
|
+
public:
|
29
|
+
V8_INLINE ScriptOriginOptions(bool is_shared_cross_origin = false,
|
30
|
+
bool is_opaque = false, bool is_wasm = false,
|
31
|
+
bool is_module = false)
|
32
|
+
: flags_((is_shared_cross_origin ? kIsSharedCrossOrigin : 0) |
|
33
|
+
(is_wasm ? kIsWasm : 0) | (is_opaque ? kIsOpaque : 0) |
|
34
|
+
(is_module ? kIsModule : 0)) {}
|
35
|
+
V8_INLINE ScriptOriginOptions(int flags)
|
36
|
+
: flags_(flags &
|
37
|
+
(kIsSharedCrossOrigin | kIsOpaque | kIsWasm | kIsModule)) {}
|
38
|
+
|
39
|
+
bool IsSharedCrossOrigin() const {
|
40
|
+
return (flags_ & kIsSharedCrossOrigin) != 0;
|
41
|
+
}
|
42
|
+
bool IsOpaque() const { return (flags_ & kIsOpaque) != 0; }
|
43
|
+
bool IsWasm() const { return (flags_ & kIsWasm) != 0; }
|
44
|
+
bool IsModule() const { return (flags_ & kIsModule) != 0; }
|
45
|
+
|
46
|
+
int Flags() const { return flags_; }
|
47
|
+
|
48
|
+
private:
|
49
|
+
enum {
|
50
|
+
kIsSharedCrossOrigin = 1,
|
51
|
+
kIsOpaque = 1 << 1,
|
52
|
+
kIsWasm = 1 << 2,
|
53
|
+
kIsModule = 1 << 3
|
54
|
+
};
|
55
|
+
const int flags_;
|
56
|
+
};
|
57
|
+
|
58
|
+
/**
|
59
|
+
* The origin, within a file, of a script.
|
60
|
+
*/
|
61
|
+
class V8_EXPORT ScriptOrigin {
|
62
|
+
public:
|
63
|
+
#if defined(_MSC_VER) && _MSC_VER >= 1910 /* Disable on VS2015 */
|
64
|
+
V8_DEPRECATE_SOON("Use constructor with primitive C++ types")
|
65
|
+
#endif
|
66
|
+
ScriptOrigin(
|
67
|
+
Local<Value> resource_name, Local<Integer> resource_line_offset,
|
68
|
+
Local<Integer> resource_column_offset,
|
69
|
+
Local<Boolean> resource_is_shared_cross_origin = Local<Boolean>(),
|
70
|
+
Local<Integer> script_id = Local<Integer>(),
|
71
|
+
Local<Value> source_map_url = Local<Value>(),
|
72
|
+
Local<Boolean> resource_is_opaque = Local<Boolean>(),
|
73
|
+
Local<Boolean> is_wasm = Local<Boolean>(),
|
74
|
+
Local<Boolean> is_module = Local<Boolean>(),
|
75
|
+
Local<PrimitiveArray> host_defined_options = Local<PrimitiveArray>());
|
76
|
+
#if defined(_MSC_VER) && _MSC_VER >= 1910 /* Disable on VS2015 */
|
77
|
+
V8_DEPRECATE_SOON("Use constructor that takes an isolate")
|
78
|
+
#endif
|
79
|
+
explicit ScriptOrigin(
|
80
|
+
Local<Value> resource_name, int resource_line_offset = 0,
|
81
|
+
int resource_column_offset = 0,
|
82
|
+
bool resource_is_shared_cross_origin = false, int script_id = -1,
|
83
|
+
Local<Value> source_map_url = Local<Value>(),
|
84
|
+
bool resource_is_opaque = false, bool is_wasm = false,
|
85
|
+
bool is_module = false,
|
86
|
+
Local<PrimitiveArray> host_defined_options = Local<PrimitiveArray>());
|
87
|
+
V8_INLINE ScriptOrigin(
|
88
|
+
Isolate* isolate, Local<Value> resource_name,
|
89
|
+
int resource_line_offset = 0, int resource_column_offset = 0,
|
90
|
+
bool resource_is_shared_cross_origin = false, int script_id = -1,
|
91
|
+
Local<Value> source_map_url = Local<Value>(),
|
92
|
+
bool resource_is_opaque = false, bool is_wasm = false,
|
93
|
+
bool is_module = false,
|
94
|
+
Local<PrimitiveArray> host_defined_options = Local<PrimitiveArray>())
|
95
|
+
: isolate_(isolate),
|
96
|
+
resource_name_(resource_name),
|
97
|
+
resource_line_offset_(resource_line_offset),
|
98
|
+
resource_column_offset_(resource_column_offset),
|
99
|
+
options_(resource_is_shared_cross_origin, resource_is_opaque, is_wasm,
|
100
|
+
is_module),
|
101
|
+
script_id_(script_id),
|
102
|
+
source_map_url_(source_map_url),
|
103
|
+
host_defined_options_(host_defined_options) {}
|
104
|
+
|
105
|
+
V8_INLINE Local<Value> ResourceName() const;
|
106
|
+
V8_DEPRECATE_SOON("Use getter with primitive C++ types.")
|
107
|
+
V8_INLINE Local<Integer> ResourceLineOffset() const;
|
108
|
+
V8_DEPRECATE_SOON("Use getter with primitive C++ types.")
|
109
|
+
V8_INLINE Local<Integer> ResourceColumnOffset() const;
|
110
|
+
V8_DEPRECATE_SOON("Use getter with primitive C++ types.")
|
111
|
+
V8_INLINE Local<Integer> ScriptID() const;
|
112
|
+
V8_INLINE int LineOffset() const;
|
113
|
+
V8_INLINE int ColumnOffset() const;
|
114
|
+
V8_INLINE int ScriptId() const;
|
115
|
+
V8_INLINE Local<Value> SourceMapUrl() const;
|
116
|
+
V8_INLINE Local<PrimitiveArray> HostDefinedOptions() const;
|
117
|
+
V8_INLINE ScriptOriginOptions Options() const { return options_; }
|
118
|
+
|
119
|
+
private:
|
120
|
+
Isolate* isolate_;
|
121
|
+
Local<Value> resource_name_;
|
122
|
+
int resource_line_offset_;
|
123
|
+
int resource_column_offset_;
|
124
|
+
ScriptOriginOptions options_;
|
125
|
+
int script_id_;
|
126
|
+
Local<Value> source_map_url_;
|
127
|
+
Local<PrimitiveArray> host_defined_options_;
|
128
|
+
};
|
129
|
+
|
130
|
+
/**
|
131
|
+
* An error message.
|
132
|
+
*/
|
133
|
+
class V8_EXPORT Message {
|
134
|
+
public:
|
135
|
+
Local<String> Get() const;
|
136
|
+
|
137
|
+
/**
|
138
|
+
* Return the isolate to which the Message belongs.
|
139
|
+
*/
|
140
|
+
Isolate* GetIsolate() const;
|
141
|
+
|
142
|
+
V8_WARN_UNUSED_RESULT MaybeLocal<String> GetSource(
|
143
|
+
Local<Context> context) const;
|
144
|
+
V8_WARN_UNUSED_RESULT MaybeLocal<String> GetSourceLine(
|
145
|
+
Local<Context> context) const;
|
146
|
+
|
147
|
+
/**
|
148
|
+
* Returns the origin for the script from where the function causing the
|
149
|
+
* error originates.
|
150
|
+
*/
|
151
|
+
ScriptOrigin GetScriptOrigin() const;
|
152
|
+
|
153
|
+
/**
|
154
|
+
* Returns the resource name for the script from where the function causing
|
155
|
+
* the error originates.
|
156
|
+
*/
|
157
|
+
Local<Value> GetScriptResourceName() const;
|
158
|
+
|
159
|
+
/**
|
160
|
+
* Exception stack trace. By default stack traces are not captured for
|
161
|
+
* uncaught exceptions. SetCaptureStackTraceForUncaughtExceptions allows
|
162
|
+
* to change this option.
|
163
|
+
*/
|
164
|
+
Local<StackTrace> GetStackTrace() const;
|
165
|
+
|
166
|
+
/**
|
167
|
+
* Returns the number, 1-based, of the line where the error occurred.
|
168
|
+
*/
|
169
|
+
V8_WARN_UNUSED_RESULT Maybe<int> GetLineNumber(Local<Context> context) const;
|
170
|
+
|
171
|
+
/**
|
172
|
+
* Returns the index within the script of the first character where
|
173
|
+
* the error occurred.
|
174
|
+
*/
|
175
|
+
int GetStartPosition() const;
|
176
|
+
|
177
|
+
/**
|
178
|
+
* Returns the index within the script of the last character where
|
179
|
+
* the error occurred.
|
180
|
+
*/
|
181
|
+
int GetEndPosition() const;
|
182
|
+
|
183
|
+
/**
|
184
|
+
* Returns the Wasm function index where the error occurred. Returns -1 if
|
185
|
+
* message is not from a Wasm script.
|
186
|
+
*/
|
187
|
+
int GetWasmFunctionIndex() const;
|
188
|
+
|
189
|
+
/**
|
190
|
+
* Returns the error level of the message.
|
191
|
+
*/
|
192
|
+
int ErrorLevel() const;
|
193
|
+
|
194
|
+
/**
|
195
|
+
* Returns the index within the line of the first character where
|
196
|
+
* the error occurred.
|
197
|
+
*/
|
198
|
+
int GetStartColumn() const;
|
199
|
+
V8_WARN_UNUSED_RESULT Maybe<int> GetStartColumn(Local<Context> context) const;
|
200
|
+
|
201
|
+
/**
|
202
|
+
* Returns the index within the line of the last character where
|
203
|
+
* the error occurred.
|
204
|
+
*/
|
205
|
+
int GetEndColumn() const;
|
206
|
+
V8_WARN_UNUSED_RESULT Maybe<int> GetEndColumn(Local<Context> context) const;
|
207
|
+
|
208
|
+
/**
|
209
|
+
* Passes on the value set by the embedder when it fed the script from which
|
210
|
+
* this Message was generated to V8.
|
211
|
+
*/
|
212
|
+
bool IsSharedCrossOrigin() const;
|
213
|
+
bool IsOpaque() const;
|
214
|
+
|
215
|
+
V8_DEPRECATE_SOON("Use the version that takes a std::ostream&.")
|
216
|
+
static void PrintCurrentStackTrace(Isolate* isolate, FILE* out);
|
217
|
+
static void PrintCurrentStackTrace(Isolate* isolate, std::ostream& out);
|
218
|
+
|
219
|
+
static const int kNoLineNumberInfo = 0;
|
220
|
+
static const int kNoColumnInfo = 0;
|
221
|
+
static const int kNoScriptIdInfo = 0;
|
222
|
+
static const int kNoWasmFunctionIndexInfo = -1;
|
223
|
+
};
|
224
|
+
|
225
|
+
Local<Value> ScriptOrigin::ResourceName() const { return resource_name_; }
|
226
|
+
|
227
|
+
Local<PrimitiveArray> ScriptOrigin::HostDefinedOptions() const {
|
228
|
+
return host_defined_options_;
|
229
|
+
}
|
230
|
+
|
231
|
+
int ScriptOrigin::LineOffset() const { return resource_line_offset_; }
|
232
|
+
|
233
|
+
int ScriptOrigin::ColumnOffset() const { return resource_column_offset_; }
|
234
|
+
|
235
|
+
int ScriptOrigin::ScriptId() const { return script_id_; }
|
236
|
+
|
237
|
+
Local<Value> ScriptOrigin::SourceMapUrl() const { return source_map_url_; }
|
238
|
+
|
239
|
+
} // namespace v8
|
240
|
+
|
241
|
+
#endif // INCLUDE_V8_MESSAGE_H_
|
@@ -5,18 +5,89 @@
|
|
5
5
|
#ifndef V8_METRICS_H_
|
6
6
|
#define V8_METRICS_H_
|
7
7
|
|
8
|
-
#include
|
8
|
+
#include <stddef.h>
|
9
|
+
#include <stdint.h>
|
10
|
+
|
11
|
+
#include <vector>
|
12
|
+
|
13
|
+
#include "v8-internal.h" // NOLINT(build/include_directory)
|
14
|
+
#include "v8-local-handle.h" // NOLINT(build/include_directory)
|
9
15
|
|
10
16
|
namespace v8 {
|
17
|
+
|
18
|
+
class Context;
|
19
|
+
class Isolate;
|
20
|
+
|
11
21
|
namespace metrics {
|
12
22
|
|
23
|
+
struct GarbageCollectionPhases {
|
24
|
+
int64_t compact_wall_clock_duration_in_us = -1;
|
25
|
+
int64_t mark_wall_clock_duration_in_us = -1;
|
26
|
+
int64_t sweep_wall_clock_duration_in_us = -1;
|
27
|
+
int64_t weak_wall_clock_duration_in_us = -1;
|
28
|
+
};
|
29
|
+
|
30
|
+
struct GarbageCollectionSizes {
|
31
|
+
int64_t bytes_before = -1;
|
32
|
+
int64_t bytes_after = -1;
|
33
|
+
int64_t bytes_freed = -1;
|
34
|
+
};
|
35
|
+
|
36
|
+
struct GarbageCollectionFullCycle {
|
37
|
+
GarbageCollectionPhases total;
|
38
|
+
GarbageCollectionPhases total_cpp;
|
39
|
+
GarbageCollectionPhases main_thread;
|
40
|
+
GarbageCollectionPhases main_thread_cpp;
|
41
|
+
GarbageCollectionPhases main_thread_atomic;
|
42
|
+
GarbageCollectionPhases main_thread_atomic_cpp;
|
43
|
+
GarbageCollectionPhases main_thread_incremental;
|
44
|
+
GarbageCollectionPhases main_thread_incremental_cpp;
|
45
|
+
GarbageCollectionSizes objects;
|
46
|
+
GarbageCollectionSizes objects_cpp;
|
47
|
+
GarbageCollectionSizes memory;
|
48
|
+
GarbageCollectionSizes memory_cpp;
|
49
|
+
double collection_rate_in_percent;
|
50
|
+
double collection_rate_cpp_in_percent;
|
51
|
+
double efficiency_in_bytes_per_us;
|
52
|
+
double efficiency_cpp_in_bytes_per_us;
|
53
|
+
double main_thread_efficiency_in_bytes_per_us;
|
54
|
+
double main_thread_efficiency_cpp_in_bytes_per_us;
|
55
|
+
};
|
56
|
+
|
57
|
+
struct GarbageCollectionFullMainThreadIncrementalMark {
|
58
|
+
int64_t wall_clock_duration_in_us = -1;
|
59
|
+
int64_t cpp_wall_clock_duration_in_us = -1;
|
60
|
+
};
|
61
|
+
|
62
|
+
struct GarbageCollectionFullMainThreadBatchedIncrementalMark {
|
63
|
+
std::vector<GarbageCollectionFullMainThreadIncrementalMark> events;
|
64
|
+
};
|
65
|
+
|
66
|
+
struct GarbageCollectionFullMainThreadIncrementalSweep {
|
67
|
+
int64_t wall_clock_duration_in_us = -1;
|
68
|
+
int64_t cpp_wall_clock_duration_in_us = -1;
|
69
|
+
};
|
70
|
+
|
71
|
+
struct GarbageCollectionFullMainThreadBatchedIncrementalSweep {
|
72
|
+
std::vector<GarbageCollectionFullMainThreadIncrementalSweep> events;
|
73
|
+
};
|
74
|
+
|
75
|
+
struct GarbageCollectionYoungCycle {
|
76
|
+
int64_t total_wall_clock_duration_in_us = -1;
|
77
|
+
int64_t main_thread_wall_clock_duration_in_us = -1;
|
78
|
+
double collection_rate_in_percent;
|
79
|
+
double efficiency_in_bytes_per_us;
|
80
|
+
double main_thread_efficiency_in_bytes_per_us;
|
81
|
+
};
|
82
|
+
|
13
83
|
struct WasmModuleDecoded {
|
14
84
|
bool async = false;
|
15
85
|
bool streamed = false;
|
16
86
|
bool success = false;
|
17
87
|
size_t module_size_in_bytes = 0;
|
18
88
|
size_t function_count = 0;
|
19
|
-
int64_t
|
89
|
+
int64_t wall_clock_duration_in_us = -1;
|
90
|
+
int64_t cpu_duration_in_us = -1;
|
20
91
|
};
|
21
92
|
|
22
93
|
struct WasmModuleCompiled {
|
@@ -28,30 +99,38 @@ struct WasmModuleCompiled {
|
|
28
99
|
bool success = false;
|
29
100
|
size_t code_size_in_bytes = 0;
|
30
101
|
size_t liftoff_bailout_count = 0;
|
31
|
-
int64_t
|
102
|
+
int64_t wall_clock_duration_in_us = -1;
|
103
|
+
int64_t cpu_duration_in_us = -1;
|
32
104
|
};
|
33
105
|
|
34
106
|
struct WasmModuleInstantiated {
|
35
107
|
bool async = false;
|
36
108
|
bool success = false;
|
37
109
|
size_t imported_function_count = 0;
|
38
|
-
int64_t
|
110
|
+
int64_t wall_clock_duration_in_us = -1;
|
39
111
|
};
|
40
112
|
|
41
113
|
struct WasmModuleTieredUp {
|
42
114
|
bool lazy = false;
|
43
115
|
size_t code_size_in_bytes = 0;
|
44
|
-
int64_t
|
116
|
+
int64_t wall_clock_duration_in_us = -1;
|
117
|
+
int64_t cpu_duration_in_us = -1;
|
45
118
|
};
|
46
119
|
|
47
120
|
struct WasmModulesPerIsolate {
|
48
121
|
size_t count = 0;
|
49
122
|
};
|
50
123
|
|
51
|
-
#define V8_MAIN_THREAD_METRICS_EVENTS(V)
|
52
|
-
V(
|
53
|
-
V(
|
54
|
-
V(
|
124
|
+
#define V8_MAIN_THREAD_METRICS_EVENTS(V) \
|
125
|
+
V(GarbageCollectionFullCycle) \
|
126
|
+
V(GarbageCollectionFullMainThreadIncrementalMark) \
|
127
|
+
V(GarbageCollectionFullMainThreadBatchedIncrementalMark) \
|
128
|
+
V(GarbageCollectionFullMainThreadIncrementalSweep) \
|
129
|
+
V(GarbageCollectionFullMainThreadBatchedIncrementalSweep) \
|
130
|
+
V(GarbageCollectionYoungCycle) \
|
131
|
+
V(WasmModuleDecoded) \
|
132
|
+
V(WasmModuleCompiled) \
|
133
|
+
V(WasmModuleInstantiated) \
|
55
134
|
V(WasmModuleTieredUp)
|
56
135
|
|
57
136
|
#define V8_THREAD_SAFE_METRICS_EVENTS(V) V(WasmModulesPerIsolate)
|
@@ -127,6 +206,32 @@ class V8_EXPORT Recorder {
|
|
127
206
|
static ContextId GetContextId(Local<Context> context);
|
128
207
|
};
|
129
208
|
|
209
|
+
/**
|
210
|
+
* Experimental API intended for the LongTasks UKM (crbug.com/1173527).
|
211
|
+
* The Reset() method should be called at the start of a potential
|
212
|
+
* long task. The Get() method returns durations of V8 work that
|
213
|
+
* happened during the task.
|
214
|
+
*
|
215
|
+
* This API is experimental and may be removed/changed in the future.
|
216
|
+
*/
|
217
|
+
struct V8_EXPORT LongTaskStats {
|
218
|
+
/**
|
219
|
+
* Resets durations of V8 work for the new task.
|
220
|
+
*/
|
221
|
+
V8_INLINE static void Reset(Isolate* isolate) {
|
222
|
+
v8::internal::Internals::IncrementLongTasksStatsCounter(isolate);
|
223
|
+
}
|
224
|
+
|
225
|
+
/**
|
226
|
+
* Returns durations of V8 work that happened since the last Reset().
|
227
|
+
*/
|
228
|
+
static LongTaskStats Get(Isolate* isolate);
|
229
|
+
|
230
|
+
int64_t gc_full_atomic_wall_clock_duration_us = 0;
|
231
|
+
int64_t gc_full_incremental_wall_clock_duration_us = 0;
|
232
|
+
int64_t gc_young_wall_clock_duration_us = 0;
|
233
|
+
};
|
234
|
+
|
130
235
|
} // namespace metrics
|
131
236
|
} // namespace v8
|
132
237
|
|