libv8 7.8.279.23.0beta1-x86_64-linux → 8.4.255.0.1-x86_64-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/location.rb +1 -1
- data/lib/libv8/version.rb +1 -1
- data/vendor/v8/include/cppgc/allocation.h +124 -0
- data/vendor/v8/include/cppgc/garbage-collected.h +192 -0
- data/vendor/v8/include/cppgc/heap.h +50 -0
- data/vendor/v8/include/cppgc/internal/accessors.h +26 -0
- data/vendor/v8/include/cppgc/internal/api-constants.h +44 -0
- data/vendor/v8/include/cppgc/internal/compiler-specific.h +26 -0
- data/vendor/v8/include/cppgc/internal/finalizer-trait.h +90 -0
- data/vendor/v8/include/cppgc/internal/gc-info.h +43 -0
- data/vendor/v8/include/cppgc/internal/logging.h +50 -0
- data/vendor/v8/include/cppgc/internal/persistent-node.h +109 -0
- data/vendor/v8/include/cppgc/internal/pointer-policies.h +133 -0
- data/vendor/v8/include/cppgc/internal/prefinalizer-handler.h +31 -0
- data/vendor/v8/include/cppgc/liveness-broker.h +50 -0
- data/vendor/v8/include/cppgc/macros.h +26 -0
- data/vendor/v8/include/cppgc/member.h +206 -0
- data/vendor/v8/include/cppgc/persistent.h +304 -0
- data/vendor/v8/include/cppgc/platform.h +31 -0
- data/vendor/v8/include/cppgc/prefinalizer.h +54 -0
- data/vendor/v8/include/cppgc/source-location.h +59 -0
- data/vendor/v8/include/cppgc/trace-trait.h +67 -0
- data/vendor/v8/include/cppgc/type-traits.h +109 -0
- data/vendor/v8/include/cppgc/visitor.h +137 -0
- data/vendor/v8/include/libplatform/libplatform.h +13 -10
- data/vendor/v8/include/libplatform/v8-tracing.h +36 -22
- data/vendor/v8/include/v8-fast-api-calls.h +412 -0
- data/vendor/v8/include/v8-inspector-protocol.h +4 -4
- data/vendor/v8/include/v8-inspector.h +57 -27
- data/vendor/v8/include/v8-internal.h +23 -21
- data/vendor/v8/include/v8-platform.h +164 -40
- data/vendor/v8/include/v8-profiler.h +27 -23
- data/vendor/v8/include/v8-util.h +1 -1
- data/vendor/v8/include/v8-version-string.h +1 -1
- data/vendor/v8/include/v8-version.h +4 -4
- data/vendor/v8/include/v8-wasm-trap-handler-posix.h +1 -1
- data/vendor/v8/include/v8-wasm-trap-handler-win.h +1 -1
- data/vendor/v8/include/v8.h +1219 -484
- data/vendor/v8/include/v8config.h +105 -51
- data/vendor/v8/out.gn/libv8/obj/libv8_libbase.a +0 -0
- data/vendor/v8/out.gn/libv8/obj/libv8_libplatform.a +0 -0
- data/vendor/v8/out.gn/libv8/obj/libv8_monolith.a +0 -0
- data/vendor/v8/out.gn/libv8/obj/third_party/icu/libicui18n.a +0 -0
- data/vendor/v8/out.gn/libv8/obj/third_party/icu/libicuuc.a +0 -0
- data/vendor/v8/out.gn/libv8/obj/third_party/zlib/google/libcompression_utils_portable.a +0 -0
- data/vendor/v8/out.gn/libv8/obj/third_party/zlib/libchrome_zlib.a +0 -0
- metadata +31 -9
- data/vendor/v8/include/v8-testing.h +0 -48
- data/vendor/v8/out.gn/libv8/obj/third_party/inspector_protocol/libbindings.a +0 -0
- data/vendor/v8/out.gn/libv8/obj/third_party/inspector_protocol/libencoding.a +0 -0
@@ -0,0 +1,137 @@
|
|
1
|
+
// Copyright 2020 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_CPPGC_VISITOR_H_
|
6
|
+
#define INCLUDE_CPPGC_VISITOR_H_
|
7
|
+
|
8
|
+
#include "cppgc/garbage-collected.h"
|
9
|
+
#include "cppgc/internal/logging.h"
|
10
|
+
#include "cppgc/internal/pointer-policies.h"
|
11
|
+
#include "cppgc/liveness-broker.h"
|
12
|
+
#include "cppgc/member.h"
|
13
|
+
#include "cppgc/source-location.h"
|
14
|
+
#include "cppgc/trace-trait.h"
|
15
|
+
|
16
|
+
namespace cppgc {
|
17
|
+
namespace internal {
|
18
|
+
class VisitorBase;
|
19
|
+
} // namespace internal
|
20
|
+
|
21
|
+
using WeakCallback = void (*)(const LivenessBroker&, const void*);
|
22
|
+
|
23
|
+
/**
|
24
|
+
* Visitor passed to trace methods. All managed pointers must have called the
|
25
|
+
* visitor's trace method on them.
|
26
|
+
*/
|
27
|
+
class Visitor {
|
28
|
+
public:
|
29
|
+
template <typename T>
|
30
|
+
void Trace(const Member<T>& member) {
|
31
|
+
const T* value = member.GetRawAtomic();
|
32
|
+
CPPGC_DCHECK(value != kSentinelPointer);
|
33
|
+
Trace(value);
|
34
|
+
}
|
35
|
+
|
36
|
+
template <typename T>
|
37
|
+
void Trace(const WeakMember<T>& weak_member) {
|
38
|
+
static_assert(sizeof(T), "T must be fully defined");
|
39
|
+
static_assert(internal::IsGarbageCollectedType<T>::value,
|
40
|
+
"T must be GarabgeCollected or GarbageCollectedMixin type");
|
41
|
+
|
42
|
+
const T* value = weak_member.GetRawAtomic();
|
43
|
+
|
44
|
+
// Bailout assumes that WeakMember emits write barrier.
|
45
|
+
if (!value) {
|
46
|
+
return;
|
47
|
+
}
|
48
|
+
|
49
|
+
// TODO(chromium:1056170): DCHECK (or similar) for deleted values as they
|
50
|
+
// should come in at a different path.
|
51
|
+
VisitWeak(value, TraceTrait<T>::GetTraceDescriptor(value),
|
52
|
+
&HandleWeak<WeakMember<T>>, &weak_member);
|
53
|
+
}
|
54
|
+
|
55
|
+
template <typename Persistent,
|
56
|
+
std::enable_if_t<Persistent::IsStrongPersistent::value>* = nullptr>
|
57
|
+
void TraceRoot(const Persistent& p, const SourceLocation& loc) {
|
58
|
+
using PointeeType = typename Persistent::PointeeType;
|
59
|
+
static_assert(sizeof(PointeeType),
|
60
|
+
"Persistent's pointee type must be fully defined");
|
61
|
+
static_assert(internal::IsGarbageCollectedType<PointeeType>::value,
|
62
|
+
"Persisent's pointee type must be GarabgeCollected or "
|
63
|
+
"GarbageCollectedMixin");
|
64
|
+
if (!p.Get()) {
|
65
|
+
return;
|
66
|
+
}
|
67
|
+
VisitRoot(p.Get(), TraceTrait<PointeeType>::GetTraceDescriptor(p.Get()),
|
68
|
+
loc);
|
69
|
+
}
|
70
|
+
|
71
|
+
template <typename Persistent,
|
72
|
+
std::enable_if_t<!Persistent::IsStrongPersistent::value>* = nullptr>
|
73
|
+
void TraceRoot(const Persistent& p, const SourceLocation& loc) {
|
74
|
+
using PointeeType = typename Persistent::PointeeType;
|
75
|
+
static_assert(sizeof(PointeeType),
|
76
|
+
"Persistent's pointee type must be fully defined");
|
77
|
+
static_assert(internal::IsGarbageCollectedType<PointeeType>::value,
|
78
|
+
"Persisent's pointee type must be GarabgeCollected or "
|
79
|
+
"GarbageCollectedMixin");
|
80
|
+
VisitWeakRoot(&p, &HandleWeak<Persistent>);
|
81
|
+
}
|
82
|
+
|
83
|
+
template <typename T, void (T::*method)(const LivenessBroker&)>
|
84
|
+
void RegisterWeakCallbackMethod(const T* obj) {
|
85
|
+
RegisterWeakCallback(&WeakCallbackMethodDelegate<T, method>, obj);
|
86
|
+
}
|
87
|
+
|
88
|
+
virtual void RegisterWeakCallback(WeakCallback, const void*) {}
|
89
|
+
|
90
|
+
protected:
|
91
|
+
virtual void Visit(const void* self, TraceDescriptor) {}
|
92
|
+
virtual void VisitWeak(const void* self, TraceDescriptor, WeakCallback,
|
93
|
+
const void* weak_member) {}
|
94
|
+
virtual void VisitRoot(const void*, TraceDescriptor,
|
95
|
+
const SourceLocation& loc) {}
|
96
|
+
virtual void VisitWeakRoot(const void*, WeakCallback) {}
|
97
|
+
|
98
|
+
private:
|
99
|
+
template <typename T, void (T::*method)(const LivenessBroker&)>
|
100
|
+
static void WeakCallbackMethodDelegate(const LivenessBroker& info,
|
101
|
+
const void* self) {
|
102
|
+
// Callback is registered through a potential const Trace method but needs
|
103
|
+
// to be able to modify fields. See HandleWeak.
|
104
|
+
(const_cast<T*>(static_cast<const T*>(self))->*method)(info);
|
105
|
+
}
|
106
|
+
|
107
|
+
template <typename PointerType>
|
108
|
+
static void HandleWeak(const LivenessBroker& info, const void* object) {
|
109
|
+
const PointerType* weak = static_cast<const PointerType*>(object);
|
110
|
+
const auto* raw = weak->Get();
|
111
|
+
if (raw && !info.IsHeapObjectAlive(raw)) {
|
112
|
+
// Object is passed down through the marker as const. Alternatives are
|
113
|
+
// - non-const Trace method;
|
114
|
+
// - mutable pointer in MemberBase;
|
115
|
+
const_cast<PointerType*>(weak)->Clear();
|
116
|
+
}
|
117
|
+
}
|
118
|
+
|
119
|
+
Visitor() = default;
|
120
|
+
|
121
|
+
template <typename T>
|
122
|
+
void Trace(const T* t) {
|
123
|
+
static_assert(sizeof(T), "T must be fully defined");
|
124
|
+
static_assert(internal::IsGarbageCollectedType<T>::value,
|
125
|
+
"T must be GarabgeCollected or GarbageCollectedMixin type");
|
126
|
+
if (!t) {
|
127
|
+
return;
|
128
|
+
}
|
129
|
+
Visit(t, TraceTrait<T>::GetTraceDescriptor(t));
|
130
|
+
}
|
131
|
+
|
132
|
+
friend class internal::VisitorBase;
|
133
|
+
};
|
134
|
+
|
135
|
+
} // namespace cppgc
|
136
|
+
|
137
|
+
#endif // INCLUDE_CPPGC_VISITOR_H_
|
@@ -5,10 +5,12 @@
|
|
5
5
|
#ifndef V8_LIBPLATFORM_LIBPLATFORM_H_
|
6
6
|
#define V8_LIBPLATFORM_LIBPLATFORM_H_
|
7
7
|
|
8
|
+
#include <memory>
|
9
|
+
|
8
10
|
#include "libplatform/libplatform-export.h"
|
9
11
|
#include "libplatform/v8-tracing.h"
|
10
|
-
#include "v8-platform.h" // NOLINT(build/
|
11
|
-
#include "v8config.h" // NOLINT(build/
|
12
|
+
#include "v8-platform.h" // NOLINT(build/include_directory)
|
13
|
+
#include "v8config.h" // NOLINT(build/include_directory)
|
12
14
|
|
13
15
|
namespace v8 {
|
14
16
|
namespace platform {
|
@@ -45,9 +47,11 @@ V8_PLATFORM_EXPORT std::unique_ptr<v8::Platform> NewDefaultPlatform(
|
|
45
47
|
* Pumps the message loop for the given isolate.
|
46
48
|
*
|
47
49
|
* The caller has to make sure that this is called from the right thread.
|
48
|
-
* Returns true if a task was executed, and false otherwise.
|
49
|
-
*
|
50
|
-
*
|
50
|
+
* Returns true if a task was executed, and false otherwise. If the call to
|
51
|
+
* PumpMessageLoop is nested within another call to PumpMessageLoop, only
|
52
|
+
* nestable tasks may run. Otherwise, any task may run. Unless requested through
|
53
|
+
* the |behavior| parameter, this call does not block if no task is pending. The
|
54
|
+
* |platform| has to be created using |NewDefaultPlatform|.
|
51
55
|
*/
|
52
56
|
V8_PLATFORM_EXPORT bool PumpMessageLoop(
|
53
57
|
v8::Platform* platform, v8::Isolate* isolate,
|
@@ -70,11 +74,10 @@ V8_PLATFORM_EXPORT void RunIdleTasks(v8::Platform* platform,
|
|
70
74
|
* The |platform| has to be created using |NewDefaultPlatform|.
|
71
75
|
*
|
72
76
|
*/
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
v8::platform::tracing::TracingController* tracing_controller));
|
77
|
+
V8_DEPRECATE_SOON("Access the DefaultPlatform directly")
|
78
|
+
V8_PLATFORM_EXPORT void SetTracingController(
|
79
|
+
v8::Platform* platform,
|
80
|
+
v8::platform::tracing::TracingController* tracing_controller);
|
78
81
|
|
79
82
|
} // namespace platform
|
80
83
|
} // namespace v8
|
@@ -12,9 +12,12 @@
|
|
12
12
|
#include <vector>
|
13
13
|
|
14
14
|
#include "libplatform/libplatform-export.h"
|
15
|
-
#include "v8-platform.h" // NOLINT(build/
|
15
|
+
#include "v8-platform.h" // NOLINT(build/include_directory)
|
16
16
|
|
17
17
|
namespace perfetto {
|
18
|
+
namespace trace_processor {
|
19
|
+
class TraceProcessorStorage;
|
20
|
+
}
|
18
21
|
class TracingSession;
|
19
22
|
}
|
20
23
|
|
@@ -28,14 +31,13 @@ namespace platform {
|
|
28
31
|
namespace tracing {
|
29
32
|
|
30
33
|
class TraceEventListener;
|
31
|
-
class JSONTraceEventListener;
|
32
34
|
|
33
35
|
const int kTraceMaxNumArgs = 2;
|
34
36
|
|
35
37
|
class V8_PLATFORM_EXPORT TraceObject {
|
36
38
|
public:
|
37
39
|
union ArgValue {
|
38
|
-
bool as_bool;
|
40
|
+
V8_DEPRECATED("use as_uint ? true : false") bool as_bool;
|
39
41
|
uint64_t as_uint;
|
40
42
|
int64_t as_int;
|
41
43
|
double as_double;
|
@@ -197,6 +199,9 @@ class V8_PLATFORM_EXPORT TraceConfig {
|
|
197
199
|
|
198
200
|
TraceConfig() : enable_systrace_(false), enable_argument_filter_(false) {}
|
199
201
|
TraceRecordMode GetTraceRecordMode() const { return record_mode_; }
|
202
|
+
const StringList& GetEnabledCategories() const {
|
203
|
+
return included_categories_;
|
204
|
+
}
|
200
205
|
bool IsSystraceEnabled() const { return enable_systrace_; }
|
201
206
|
bool IsArgumentFilterEnabled() const { return enable_argument_filter_; }
|
202
207
|
|
@@ -229,6 +234,17 @@ class V8_PLATFORM_EXPORT TraceConfig {
|
|
229
234
|
class V8_PLATFORM_EXPORT TracingController
|
230
235
|
: public V8_PLATFORM_NON_EXPORTED_BASE(v8::TracingController) {
|
231
236
|
public:
|
237
|
+
TracingController();
|
238
|
+
~TracingController() override;
|
239
|
+
|
240
|
+
#if defined(V8_USE_PERFETTO)
|
241
|
+
// Must be called before StartTracing() if V8_USE_PERFETTO is true. Provides
|
242
|
+
// the output stream for the JSON trace data.
|
243
|
+
void InitializeForPerfetto(std::ostream* output_stream);
|
244
|
+
// Provide an optional listener for testing that will receive trace events.
|
245
|
+
// Must be called before StartTracing().
|
246
|
+
void SetTraceEventListenerForTesting(TraceEventListener* listener);
|
247
|
+
#else // defined(V8_USE_PERFETTO)
|
232
248
|
// The pointer returned from GetCategoryGroupEnabled() points to a value with
|
233
249
|
// zero or more of the following bits. Used in this class only. The
|
234
250
|
// TRACE_EVENT macros should only use the value as a bool. These values must
|
@@ -242,19 +258,8 @@ class V8_PLATFORM_EXPORT TracingController
|
|
242
258
|
ENABLED_FOR_ETW_EXPORT = 1 << 3
|
243
259
|
};
|
244
260
|
|
245
|
-
TracingController();
|
246
|
-
~TracingController() override;
|
247
|
-
|
248
261
|
// Takes ownership of |trace_buffer|.
|
249
262
|
void Initialize(TraceBuffer* trace_buffer);
|
250
|
-
#ifdef V8_USE_PERFETTO
|
251
|
-
// Must be called before StartTracing() if V8_USE_PERFETTO is true. Provides
|
252
|
-
// the output stream for the JSON trace data.
|
253
|
-
void InitializeForPerfetto(std::ostream* output_stream);
|
254
|
-
// Provide an optional listener for testing that will receive trace events.
|
255
|
-
// Must be called before StartTracing().
|
256
|
-
void SetTraceEventListenerForTesting(TraceEventListener* listener);
|
257
|
-
#endif
|
258
263
|
|
259
264
|
// v8::TracingController implementation.
|
260
265
|
const uint8_t* GetCategoryGroupEnabled(const char* category_group) override;
|
@@ -274,6 +279,10 @@ class V8_PLATFORM_EXPORT TracingController
|
|
274
279
|
unsigned int flags, int64_t timestamp) override;
|
275
280
|
void UpdateTraceEventDuration(const uint8_t* category_enabled_flag,
|
276
281
|
const char* name, uint64_t handle) override;
|
282
|
+
|
283
|
+
static const char* GetCategoryGroupName(const uint8_t* category_enabled_flag);
|
284
|
+
#endif // !defined(V8_USE_PERFETTO)
|
285
|
+
|
277
286
|
void AddTraceStateObserver(
|
278
287
|
v8::TracingController::TraceStateObserver* observer) override;
|
279
288
|
void RemoveTraceStateObserver(
|
@@ -282,27 +291,32 @@ class V8_PLATFORM_EXPORT TracingController
|
|
282
291
|
void StartTracing(TraceConfig* trace_config);
|
283
292
|
void StopTracing();
|
284
293
|
|
285
|
-
static const char* GetCategoryGroupName(const uint8_t* category_enabled_flag);
|
286
|
-
|
287
294
|
protected:
|
295
|
+
#if !defined(V8_USE_PERFETTO)
|
288
296
|
virtual int64_t CurrentTimestampMicroseconds();
|
289
297
|
virtual int64_t CurrentCpuTimestampMicroseconds();
|
298
|
+
#endif // !defined(V8_USE_PERFETTO)
|
290
299
|
|
291
300
|
private:
|
301
|
+
#if !defined(V8_USE_PERFETTO)
|
292
302
|
void UpdateCategoryGroupEnabledFlag(size_t category_index);
|
293
303
|
void UpdateCategoryGroupEnabledFlags();
|
304
|
+
#endif // !defined(V8_USE_PERFETTO)
|
294
305
|
|
295
|
-
std::unique_ptr<TraceBuffer> trace_buffer_;
|
296
|
-
std::unique_ptr<TraceConfig> trace_config_;
|
297
306
|
std::unique_ptr<base::Mutex> mutex_;
|
298
|
-
std::
|
307
|
+
std::unique_ptr<TraceConfig> trace_config_;
|
299
308
|
std::atomic_bool recording_{false};
|
300
|
-
|
309
|
+
std::unordered_set<v8::TracingController::TraceStateObserver*> observers_;
|
310
|
+
|
311
|
+
#if defined(V8_USE_PERFETTO)
|
301
312
|
std::ostream* output_stream_ = nullptr;
|
302
|
-
std::unique_ptr<
|
313
|
+
std::unique_ptr<perfetto::trace_processor::TraceProcessorStorage>
|
314
|
+
trace_processor_;
|
303
315
|
TraceEventListener* listener_for_testing_ = nullptr;
|
304
316
|
std::unique_ptr<perfetto::TracingSession> tracing_session_;
|
305
|
-
#
|
317
|
+
#else // !defined(V8_USE_PERFETTO)
|
318
|
+
std::unique_ptr<TraceBuffer> trace_buffer_;
|
319
|
+
#endif // !defined(V8_USE_PERFETTO)
|
306
320
|
|
307
321
|
// Disallow copy and assign
|
308
322
|
TracingController(const TracingController&) = delete;
|