libv8 3.16.14.19-universal-darwin-17 → 6.2.414.42.1-universal-darwin-17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/ext/libv8/arch.rb +10 -33
  3. data/ext/libv8/location.rb +15 -7
  4. data/ext/libv8/paths.rb +3 -3
  5. data/lib/libv8/version.rb +1 -1
  6. data/vendor/v8/include/libplatform/libplatform-export.h +29 -0
  7. data/vendor/v8/include/libplatform/libplatform.h +83 -0
  8. data/vendor/v8/include/libplatform/v8-tracing.h +284 -0
  9. data/vendor/v8/include/v8-debug.h +104 -257
  10. data/vendor/v8/include/v8-inspector-protocol.h +13 -0
  11. data/vendor/v8/include/v8-inspector.h +267 -0
  12. data/vendor/v8/include/v8-platform.h +241 -0
  13. data/vendor/v8/include/v8-profiler.h +514 -185
  14. data/vendor/v8/include/v8-testing.h +5 -62
  15. data/vendor/v8/include/v8-util.h +655 -0
  16. data/vendor/v8/include/v8-value-serializer-version.h +24 -0
  17. data/vendor/v8/include/v8-version-string.h +33 -0
  18. data/vendor/v8/include/v8-version.h +20 -0
  19. data/vendor/v8/include/v8.h +8944 -3504
  20. data/vendor/v8/include/v8config.h +417 -0
  21. data/vendor/v8/out/x64.release/libv8_base.a +0 -0
  22. data/vendor/v8/out/x64.release/libv8_builtins_generators.a +0 -0
  23. data/vendor/v8/out/x64.release/libv8_builtins_setup.a +0 -0
  24. data/vendor/v8/out/x64.release/libv8_libbase.a +0 -0
  25. data/vendor/v8/out/x64.release/libv8_libplatform.a +0 -0
  26. data/vendor/v8/out/x64.release/libv8_libsampler.a +0 -0
  27. data/vendor/v8/out/x64.release/libv8_nosnapshot.a +0 -0
  28. data/vendor/v8/out/x64.release/libv8_snapshot.a +0 -0
  29. metadata +22 -23
  30. data/vendor/v8/include/v8-preparser.h +0 -118
  31. data/vendor/v8/include/v8stdint.h +0 -54
  32. data/vendor/v8/out/x64.release/libpreparser_lib.a +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3f78361f74842c6d10b9c6fe62cbf9334143c6b0
4
- data.tar.gz: 53fbe262c56a597871935e2d5e6795a7d0b27f49
3
+ metadata.gz: 9c982ada7c4b3198aeea59327fca855468d71b75
4
+ data.tar.gz: a2645f931623c5f79e43068606607232fa0e7c9a
5
5
  SHA512:
6
- metadata.gz: f2437827687546f6dfbe4db0712afd7dfe3440c4d7ac720d735f273e7db8f374916aa6d8a110249607b77f14401433b8dccd640131e1b462feb8e5bf1133ad3d
7
- data.tar.gz: 825719b5d07a8d384384cb7a81d72bb4fc70637c0edc76623da46ed3946af4e95804369b4715d355406d4630803618e01279e588a42194ff3209223c6b19692c
6
+ metadata.gz: ea21131729748413b3a851004b0d4d2fdd12057869b8a44248e6c34af12c5ce71ae6634e9376fb8857096a97688f6cc489a45a0e7c5abcf1eee3716c19fd3000
7
+ data.tar.gz: 8e93726a8cdfdffe5d2790a59b9b8080c0676e01507726ad172ccfff4eedb9caaea8da0f47ca981c36bf3072041fd10037903c9a3cda5e17c4788d47e2b92626
@@ -1,42 +1,19 @@
1
- require 'rbconfig'
1
+ require 'rubygems'
2
2
 
3
3
  module Libv8
4
4
  module Arch
5
5
  module_function
6
6
 
7
- def x86_64_from_build_cpu
8
- RbConfig::MAKEFILE_CONFIG['build_cpu'] == 'x86_64'
9
- end
10
-
11
- def x86_64_from_byte_length
12
- ['foo'].pack('p').size == 8
13
- end
14
-
15
- def x86_64_from_arch_flag
16
- RbConfig::MAKEFILE_CONFIG['ARCH_FLAG'] =~ /x86_64/
17
- end
18
-
19
- def rubinius?
20
- Object.const_defined?(:RUBY_ENGINE) && RUBY_ENGINE == "rbx"
21
- end
22
-
23
- # TODO fix false positive on 64-bit ARM
24
- def x64?
25
- if rubinius?
26
- x86_64_from_build_cpu || x86_64_from_arch_flag
27
- else
28
- x86_64_from_byte_length
29
- end
30
- end
31
-
32
- def arm?
33
- RbConfig::MAKEFILE_CONFIG['build_cpu'] =~ /^arm/
34
- end
35
-
36
7
  def libv8_arch
37
- if arm? then "arm"
38
- elsif x64? then "x64"
39
- else "ia32"
8
+ case Gem::Platform.local.cpu
9
+ when /^arm(v6.*|v7.*)*$/ then 'arm'
10
+ when /^a(rm|arch)64$/ then 'arm64'
11
+ when /^x86$/ then 'ia32'
12
+ when /^(x86_64|amd64)$/ then 'x64'
13
+ when /^universal$/ then 'x64' # OS X
14
+ else
15
+ warn "Unsupported target: #{Gem::Platform.local.cpu}"
16
+ Gem::Platform.local.cpu
40
17
  end
41
18
  end
42
19
  end
@@ -26,17 +26,24 @@ module Libv8
26
26
  verify_installation!
27
27
  return exit_status
28
28
  end
29
+
29
30
  def configure(context = MkmfContext.new)
30
- context.incflags.insert 0, Libv8::Paths.include_paths.map{|p| "-I#{p}"}.join(" ") + " "
31
+ context.incflags.insert 0, Libv8::Paths.include_paths.map{ |p| "-I#{p}" }.join(" ") + " "
31
32
  context.ldflags.insert 0, Libv8::Paths.object_paths.join(" ") + " "
32
33
  end
33
34
 
34
35
  def verify_installation!
36
+ include_paths = Libv8::Paths.include_paths
37
+ unless include_paths.detect { |p| Pathname(p).join('v8.h').exist? }
38
+ fail HeaderNotFound, "Unable to locate 'v8.h' in the libv8 header paths: #{include_paths.inspect}"
39
+ end
35
40
  Libv8::Paths.object_paths.each do |p|
36
41
  fail ArchiveNotFound, p unless File.exist? p
37
42
  end
38
43
  end
39
44
 
45
+ class HeaderNotFound < StandardError; end
46
+
40
47
  class ArchiveNotFound < StandardError
41
48
  def initialize(filename)
42
49
  super "libv8 did not install properly, expected binary v8 archive '#{filename}'to exist, but it was not found"
@@ -48,20 +55,21 @@ module Libv8
48
55
  def configure(context = MkmfContext.new)
49
56
  context.send(:dir_config, 'v8')
50
57
  context.send(:find_header, 'v8.h') or fail NotFoundError
58
+ context.send(:find_header, 'libplatform/libplatform.h') or fail NotFoundError
51
59
  context.send(:have_library, 'v8') or fail NotFoundError
52
60
  end
53
61
 
54
62
  class NotFoundError < StandardError
55
63
  def initialize(*args)
56
64
  super(<<-EOS)
57
- By using --with-system-v8, you have chosen to use the version
58
- of V8 found on your system and *not* the one that is bundled with
59
- the libv8 rubygem.
65
+ By using --with-system-v8, you have chosen to use the version
66
+ of V8 found on your system and *not* the one that is bundled with
67
+ the libv8 rubygem.
60
68
 
61
- However, your system version of v8 could not be located.
69
+ However, your system version of v8 could not be located.
62
70
 
63
- Please make sure your system version of v8 that is compatible
64
- with #{Libv8::VERSION} installed. You may need to use the
71
+ Please make sure your system version of v8 that is compatible
72
+ with #{Libv8::VERSION} installed. You may need to use the
65
73
  --with-v8-dir option if it is installed in a non-standard location
66
74
  EOS
67
75
  end
@@ -7,12 +7,12 @@ module Libv8
7
7
  module_function
8
8
 
9
9
  def include_paths
10
- [Shellwords.escape("#{vendored_source_path}/include")]
10
+ [Shellwords.escape(File.join(vendored_source_path, 'include'))]
11
11
  end
12
12
 
13
13
  def object_paths
14
- [libv8_object(:base), libv8_object(:snapshot)].map do |path|
15
- Shellwords.escape path
14
+ [:base, :libplatform, :libsampler, :libbase, :snapshot].map do |name|
15
+ Shellwords.escape libv8_object(name)
16
16
  end
17
17
  end
18
18
 
@@ -1,3 +1,3 @@
1
1
  module Libv8
2
- VERSION = "3.16.14.19"
2
+ VERSION = "6.2.414.42.1"
3
3
  end
@@ -0,0 +1,29 @@
1
+ // Copyright 2016 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 V8_LIBPLATFORM_LIBPLATFORM_EXPORT_H_
6
+ #define V8_LIBPLATFORM_LIBPLATFORM_EXPORT_H_
7
+
8
+ #if defined(_WIN32)
9
+
10
+ #ifdef BUILDING_V8_PLATFORM_SHARED
11
+ #define V8_PLATFORM_EXPORT __declspec(dllexport)
12
+ #elif USING_V8_PLATFORM_SHARED
13
+ #define V8_PLATFORM_EXPORT __declspec(dllimport)
14
+ #else
15
+ #define V8_PLATFORM_EXPORT
16
+ #endif // BUILDING_V8_PLATFORM_SHARED
17
+
18
+ #else // defined(_WIN32)
19
+
20
+ // Setup for Linux shared library export.
21
+ #ifdef BUILDING_V8_PLATFORM_SHARED
22
+ #define V8_PLATFORM_EXPORT __attribute__((visibility("default")))
23
+ #else
24
+ #define V8_PLATFORM_EXPORT
25
+ #endif
26
+
27
+ #endif // defined(_WIN32)
28
+
29
+ #endif // V8_LIBPLATFORM_LIBPLATFORM_EXPORT_H_
@@ -0,0 +1,83 @@
1
+ // Copyright 2014 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 V8_LIBPLATFORM_LIBPLATFORM_H_
6
+ #define V8_LIBPLATFORM_LIBPLATFORM_H_
7
+
8
+ #include "libplatform/libplatform-export.h"
9
+ #include "libplatform/v8-tracing.h"
10
+ #include "v8-platform.h" // NOLINT(build/include)
11
+
12
+ namespace v8 {
13
+ namespace platform {
14
+
15
+ enum class IdleTaskSupport { kDisabled, kEnabled };
16
+ enum class InProcessStackDumping { kDisabled, kEnabled };
17
+
18
+ enum class MessageLoopBehavior : bool {
19
+ kDoNotWait = false,
20
+ kWaitForWork = true
21
+ };
22
+
23
+ /**
24
+ * Returns a new instance of the default v8::Platform implementation.
25
+ *
26
+ * The caller will take ownership of the returned pointer. |thread_pool_size|
27
+ * is the number of worker threads to allocate for background jobs. If a value
28
+ * of zero is passed, a suitable default based on the current number of
29
+ * processors online will be chosen.
30
+ * If |idle_task_support| is enabled then the platform will accept idle
31
+ * tasks (IdleTasksEnabled will return true) and will rely on the embedder
32
+ * calling v8::platform::RunIdleTasks to process the idle tasks.
33
+ * If |tracing_controller| is nullptr, the default platform will create a
34
+ * v8::platform::TracingController instance and use it.
35
+ */
36
+ V8_PLATFORM_EXPORT v8::Platform* CreateDefaultPlatform(
37
+ int thread_pool_size = 0,
38
+ IdleTaskSupport idle_task_support = IdleTaskSupport::kDisabled,
39
+ InProcessStackDumping in_process_stack_dumping =
40
+ InProcessStackDumping::kEnabled,
41
+ v8::TracingController* tracing_controller = nullptr);
42
+
43
+ /**
44
+ * Pumps the message loop for the given isolate.
45
+ *
46
+ * The caller has to make sure that this is called from the right thread.
47
+ * Returns true if a task was executed, and false otherwise. Unless requested
48
+ * through the |behavior| parameter, this call does not block if no task is
49
+ * pending. The |platform| has to be created using |CreateDefaultPlatform|.
50
+ */
51
+ V8_PLATFORM_EXPORT bool PumpMessageLoop(
52
+ v8::Platform* platform, v8::Isolate* isolate,
53
+ MessageLoopBehavior behavior = MessageLoopBehavior::kDoNotWait);
54
+
55
+ V8_PLATFORM_EXPORT void EnsureEventLoopInitialized(v8::Platform* platform,
56
+ v8::Isolate* isolate);
57
+
58
+ /**
59
+ * Runs pending idle tasks for at most |idle_time_in_seconds| seconds.
60
+ *
61
+ * The caller has to make sure that this is called from the right thread.
62
+ * This call does not block if no task is pending. The |platform| has to be
63
+ * created using |CreateDefaultPlatform|.
64
+ */
65
+ V8_PLATFORM_EXPORT void RunIdleTasks(v8::Platform* platform,
66
+ v8::Isolate* isolate,
67
+ double idle_time_in_seconds);
68
+
69
+ /**
70
+ * Attempts to set the tracing controller for the given platform.
71
+ *
72
+ * The |platform| has to be created using |CreateDefaultPlatform|.
73
+ *
74
+ * DEPRECATED: Will be removed soon.
75
+ */
76
+ V8_PLATFORM_EXPORT void SetTracingController(
77
+ v8::Platform* platform,
78
+ v8::platform::tracing::TracingController* tracing_controller);
79
+
80
+ } // namespace platform
81
+ } // namespace v8
82
+
83
+ #endif // V8_LIBPLATFORM_LIBPLATFORM_H_
@@ -0,0 +1,284 @@
1
+ // Copyright 2016 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 V8_LIBPLATFORM_V8_TRACING_H_
6
+ #define V8_LIBPLATFORM_V8_TRACING_H_
7
+
8
+ #include <fstream>
9
+ #include <memory>
10
+ #include <unordered_set>
11
+ #include <vector>
12
+
13
+ #include "libplatform/libplatform-export.h"
14
+ #include "v8-platform.h" // NOLINT(build/include)
15
+
16
+ namespace v8 {
17
+
18
+ namespace base {
19
+ class Mutex;
20
+ } // namespace base
21
+
22
+ namespace platform {
23
+ namespace tracing {
24
+
25
+ const int kTraceMaxNumArgs = 2;
26
+
27
+ class V8_PLATFORM_EXPORT TraceObject {
28
+ public:
29
+ union ArgValue {
30
+ bool as_bool;
31
+ uint64_t as_uint;
32
+ int64_t as_int;
33
+ double as_double;
34
+ const void* as_pointer;
35
+ const char* as_string;
36
+ };
37
+
38
+ TraceObject() {}
39
+ ~TraceObject();
40
+ void Initialize(
41
+ char phase, const uint8_t* category_enabled_flag, const char* name,
42
+ const char* scope, uint64_t id, uint64_t bind_id, int num_args,
43
+ const char** arg_names, const uint8_t* arg_types,
44
+ const uint64_t* arg_values,
45
+ std::unique_ptr<v8::ConvertableToTraceFormat>* arg_convertables,
46
+ unsigned int flags);
47
+ void UpdateDuration();
48
+ void InitializeForTesting(
49
+ char phase, const uint8_t* category_enabled_flag, const char* name,
50
+ const char* scope, uint64_t id, uint64_t bind_id, int num_args,
51
+ const char** arg_names, const uint8_t* arg_types,
52
+ const uint64_t* arg_values,
53
+ std::unique_ptr<v8::ConvertableToTraceFormat>* arg_convertables,
54
+ unsigned int flags, int pid, int tid, int64_t ts, int64_t tts,
55
+ uint64_t duration, uint64_t cpu_duration);
56
+
57
+ int pid() const { return pid_; }
58
+ int tid() const { return tid_; }
59
+ char phase() const { return phase_; }
60
+ const uint8_t* category_enabled_flag() const {
61
+ return category_enabled_flag_;
62
+ }
63
+ const char* name() const { return name_; }
64
+ const char* scope() const { return scope_; }
65
+ uint64_t id() const { return id_; }
66
+ uint64_t bind_id() const { return bind_id_; }
67
+ int num_args() const { return num_args_; }
68
+ const char** arg_names() { return arg_names_; }
69
+ uint8_t* arg_types() { return arg_types_; }
70
+ ArgValue* arg_values() { return arg_values_; }
71
+ std::unique_ptr<v8::ConvertableToTraceFormat>* arg_convertables() {
72
+ return arg_convertables_;
73
+ }
74
+ unsigned int flags() const { return flags_; }
75
+ int64_t ts() { return ts_; }
76
+ int64_t tts() { return tts_; }
77
+ uint64_t duration() { return duration_; }
78
+ uint64_t cpu_duration() { return cpu_duration_; }
79
+
80
+ private:
81
+ int pid_;
82
+ int tid_;
83
+ char phase_;
84
+ const char* name_;
85
+ const char* scope_;
86
+ const uint8_t* category_enabled_flag_;
87
+ uint64_t id_;
88
+ uint64_t bind_id_;
89
+ int num_args_ = 0;
90
+ const char* arg_names_[kTraceMaxNumArgs];
91
+ uint8_t arg_types_[kTraceMaxNumArgs];
92
+ ArgValue arg_values_[kTraceMaxNumArgs];
93
+ std::unique_ptr<v8::ConvertableToTraceFormat>
94
+ arg_convertables_[kTraceMaxNumArgs];
95
+ char* parameter_copy_storage_ = nullptr;
96
+ unsigned int flags_;
97
+ int64_t ts_;
98
+ int64_t tts_;
99
+ uint64_t duration_;
100
+ uint64_t cpu_duration_;
101
+
102
+ // Disallow copy and assign
103
+ TraceObject(const TraceObject&) = delete;
104
+ void operator=(const TraceObject&) = delete;
105
+ };
106
+
107
+ class V8_PLATFORM_EXPORT TraceWriter {
108
+ public:
109
+ TraceWriter() {}
110
+ virtual ~TraceWriter() {}
111
+ virtual void AppendTraceEvent(TraceObject* trace_event) = 0;
112
+ virtual void Flush() = 0;
113
+
114
+ static TraceWriter* CreateJSONTraceWriter(std::ostream& stream);
115
+
116
+ private:
117
+ // Disallow copy and assign
118
+ TraceWriter(const TraceWriter&) = delete;
119
+ void operator=(const TraceWriter&) = delete;
120
+ };
121
+
122
+ class V8_PLATFORM_EXPORT TraceBufferChunk {
123
+ public:
124
+ explicit TraceBufferChunk(uint32_t seq);
125
+
126
+ void Reset(uint32_t new_seq);
127
+ bool IsFull() const { return next_free_ == kChunkSize; }
128
+ TraceObject* AddTraceEvent(size_t* event_index);
129
+ TraceObject* GetEventAt(size_t index) { return &chunk_[index]; }
130
+
131
+ uint32_t seq() const { return seq_; }
132
+ size_t size() const { return next_free_; }
133
+
134
+ static const size_t kChunkSize = 64;
135
+
136
+ private:
137
+ size_t next_free_ = 0;
138
+ TraceObject chunk_[kChunkSize];
139
+ uint32_t seq_;
140
+
141
+ // Disallow copy and assign
142
+ TraceBufferChunk(const TraceBufferChunk&) = delete;
143
+ void operator=(const TraceBufferChunk&) = delete;
144
+ };
145
+
146
+ class V8_PLATFORM_EXPORT TraceBuffer {
147
+ public:
148
+ TraceBuffer() {}
149
+ virtual ~TraceBuffer() {}
150
+
151
+ virtual TraceObject* AddTraceEvent(uint64_t* handle) = 0;
152
+ virtual TraceObject* GetEventByHandle(uint64_t handle) = 0;
153
+ virtual bool Flush() = 0;
154
+
155
+ static const size_t kRingBufferChunks = 1024;
156
+
157
+ static TraceBuffer* CreateTraceBufferRingBuffer(size_t max_chunks,
158
+ TraceWriter* trace_writer);
159
+
160
+ private:
161
+ // Disallow copy and assign
162
+ TraceBuffer(const TraceBuffer&) = delete;
163
+ void operator=(const TraceBuffer&) = delete;
164
+ };
165
+
166
+ // Options determines how the trace buffer stores data.
167
+ enum TraceRecordMode {
168
+ // Record until the trace buffer is full.
169
+ RECORD_UNTIL_FULL,
170
+
171
+ // Record until the user ends the trace. The trace buffer is a fixed size
172
+ // and we use it as a ring buffer during recording.
173
+ RECORD_CONTINUOUSLY,
174
+
175
+ // Record until the trace buffer is full, but with a huge buffer size.
176
+ RECORD_AS_MUCH_AS_POSSIBLE,
177
+
178
+ // Echo to console. Events are discarded.
179
+ ECHO_TO_CONSOLE,
180
+ };
181
+
182
+ class V8_PLATFORM_EXPORT TraceConfig {
183
+ public:
184
+ typedef std::vector<std::string> StringList;
185
+
186
+ static TraceConfig* CreateDefaultTraceConfig();
187
+
188
+ TraceConfig() : enable_systrace_(false), enable_argument_filter_(false) {}
189
+ TraceRecordMode GetTraceRecordMode() const { return record_mode_; }
190
+ bool IsSystraceEnabled() const { return enable_systrace_; }
191
+ bool IsArgumentFilterEnabled() const { return enable_argument_filter_; }
192
+
193
+ void SetTraceRecordMode(TraceRecordMode mode) { record_mode_ = mode; }
194
+ void EnableSystrace() { enable_systrace_ = true; }
195
+ void EnableArgumentFilter() { enable_argument_filter_ = true; }
196
+
197
+ void AddIncludedCategory(const char* included_category);
198
+
199
+ bool IsCategoryGroupEnabled(const char* category_group) const;
200
+
201
+ private:
202
+ TraceRecordMode record_mode_;
203
+ bool enable_systrace_ : 1;
204
+ bool enable_argument_filter_ : 1;
205
+ StringList included_categories_;
206
+
207
+ // Disallow copy and assign
208
+ TraceConfig(const TraceConfig&) = delete;
209
+ void operator=(const TraceConfig&) = delete;
210
+ };
211
+
212
+ #if defined(_MSC_VER)
213
+ #define V8_PLATFORM_NON_EXPORTED_BASE(code) \
214
+ __pragma(warning(suppress : 4275)) code
215
+ #else
216
+ #define V8_PLATFORM_NON_EXPORTED_BASE(code) code
217
+ #endif // defined(_MSC_VER)
218
+
219
+ class V8_PLATFORM_EXPORT TracingController
220
+ : public V8_PLATFORM_NON_EXPORTED_BASE(v8::TracingController) {
221
+ public:
222
+ enum Mode { DISABLED = 0, RECORDING_MODE };
223
+
224
+ // The pointer returned from GetCategoryGroupEnabledInternal() points to a
225
+ // value with zero or more of the following bits. Used in this class only.
226
+ // The TRACE_EVENT macros should only use the value as a bool.
227
+ // These values must be in sync with macro values in TraceEvent.h in Blink.
228
+ enum CategoryGroupEnabledFlags {
229
+ // Category group enabled for the recording mode.
230
+ ENABLED_FOR_RECORDING = 1 << 0,
231
+ // Category group enabled by SetEventCallbackEnabled().
232
+ ENABLED_FOR_EVENT_CALLBACK = 1 << 2,
233
+ // Category group enabled to export events to ETW.
234
+ ENABLED_FOR_ETW_EXPORT = 1 << 3
235
+ };
236
+
237
+ TracingController();
238
+ ~TracingController() override;
239
+ void Initialize(TraceBuffer* trace_buffer);
240
+
241
+ // v8::TracingController implementation.
242
+ const uint8_t* GetCategoryGroupEnabled(const char* category_group) override;
243
+ uint64_t AddTraceEvent(
244
+ char phase, const uint8_t* category_enabled_flag, const char* name,
245
+ const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args,
246
+ const char** arg_names, const uint8_t* arg_types,
247
+ const uint64_t* arg_values,
248
+ std::unique_ptr<v8::ConvertableToTraceFormat>* arg_convertables,
249
+ unsigned int flags) override;
250
+ void UpdateTraceEventDuration(const uint8_t* category_enabled_flag,
251
+ const char* name, uint64_t handle) override;
252
+ void AddTraceStateObserver(
253
+ v8::TracingController::TraceStateObserver* observer) override;
254
+ void RemoveTraceStateObserver(
255
+ v8::TracingController::TraceStateObserver* observer) override;
256
+
257
+ void StartTracing(TraceConfig* trace_config);
258
+ void StopTracing();
259
+
260
+ static const char* GetCategoryGroupName(const uint8_t* category_enabled_flag);
261
+
262
+ private:
263
+ const uint8_t* GetCategoryGroupEnabledInternal(const char* category_group);
264
+ void UpdateCategoryGroupEnabledFlag(size_t category_index);
265
+ void UpdateCategoryGroupEnabledFlags();
266
+
267
+ std::unique_ptr<TraceBuffer> trace_buffer_;
268
+ std::unique_ptr<TraceConfig> trace_config_;
269
+ std::unique_ptr<base::Mutex> mutex_;
270
+ std::unordered_set<v8::TracingController::TraceStateObserver*> observers_;
271
+ Mode mode_ = DISABLED;
272
+
273
+ // Disallow copy and assign
274
+ TracingController(const TracingController&) = delete;
275
+ void operator=(const TracingController&) = delete;
276
+ };
277
+
278
+ #undef V8_PLATFORM_NON_EXPORTED_BASE
279
+
280
+ } // namespace tracing
281
+ } // namespace platform
282
+ } // namespace v8
283
+
284
+ #endif // V8_LIBPLATFORM_V8_TRACING_H_