libv8-node 16.10.0.0-x86_64-darwin

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +7 -0
  2. data/ext/libv8-node/.location.yml +1 -0
  3. data/ext/libv8-node/location.rb +76 -0
  4. data/ext/libv8-node/paths.rb +34 -0
  5. data/lib/libv8/node/version.rb +7 -0
  6. data/lib/libv8/node.rb +11 -0
  7. data/lib/libv8-node.rb +1 -0
  8. data/vendor/v8/include/cppgc/allocation.h +232 -0
  9. data/vendor/v8/include/cppgc/common.h +29 -0
  10. data/vendor/v8/include/cppgc/cross-thread-persistent.h +384 -0
  11. data/vendor/v8/include/cppgc/custom-space.h +97 -0
  12. data/vendor/v8/include/cppgc/default-platform.h +75 -0
  13. data/vendor/v8/include/cppgc/ephemeron-pair.h +30 -0
  14. data/vendor/v8/include/cppgc/explicit-management.h +82 -0
  15. data/vendor/v8/include/cppgc/garbage-collected.h +117 -0
  16. data/vendor/v8/include/cppgc/heap-consistency.h +236 -0
  17. data/vendor/v8/include/cppgc/heap-state.h +70 -0
  18. data/vendor/v8/include/cppgc/heap-statistics.h +120 -0
  19. data/vendor/v8/include/cppgc/heap.h +201 -0
  20. data/vendor/v8/include/cppgc/internal/api-constants.h +47 -0
  21. data/vendor/v8/include/cppgc/internal/atomic-entry-flag.h +48 -0
  22. data/vendor/v8/include/cppgc/internal/caged-heap-local-data.h +68 -0
  23. data/vendor/v8/include/cppgc/internal/compiler-specific.h +38 -0
  24. data/vendor/v8/include/cppgc/internal/finalizer-trait.h +90 -0
  25. data/vendor/v8/include/cppgc/internal/gc-info.h +76 -0
  26. data/vendor/v8/include/cppgc/internal/logging.h +50 -0
  27. data/vendor/v8/include/cppgc/internal/name-trait.h +111 -0
  28. data/vendor/v8/include/cppgc/internal/persistent-node.h +172 -0
  29. data/vendor/v8/include/cppgc/internal/pointer-policies.h +175 -0
  30. data/vendor/v8/include/cppgc/internal/prefinalizer-handler.h +30 -0
  31. data/vendor/v8/include/cppgc/internal/write-barrier.h +396 -0
  32. data/vendor/v8/include/cppgc/liveness-broker.h +74 -0
  33. data/vendor/v8/include/cppgc/macros.h +26 -0
  34. data/vendor/v8/include/cppgc/member.h +286 -0
  35. data/vendor/v8/include/cppgc/name-provider.h +65 -0
  36. data/vendor/v8/include/cppgc/object-size-trait.h +58 -0
  37. data/vendor/v8/include/cppgc/persistent.h +365 -0
  38. data/vendor/v8/include/cppgc/platform.h +153 -0
  39. data/vendor/v8/include/cppgc/prefinalizer.h +52 -0
  40. data/vendor/v8/include/cppgc/process-heap-statistics.h +36 -0
  41. data/vendor/v8/include/cppgc/sentinel-pointer.h +32 -0
  42. data/vendor/v8/include/cppgc/source-location.h +92 -0
  43. data/vendor/v8/include/cppgc/testing.h +99 -0
  44. data/vendor/v8/include/cppgc/trace-trait.h +116 -0
  45. data/vendor/v8/include/cppgc/type-traits.h +247 -0
  46. data/vendor/v8/include/cppgc/visitor.h +377 -0
  47. data/vendor/v8/include/libplatform/libplatform-export.h +29 -0
  48. data/vendor/v8/include/libplatform/libplatform.h +117 -0
  49. data/vendor/v8/include/libplatform/v8-tracing.h +334 -0
  50. data/vendor/v8/include/v8-cppgc.h +325 -0
  51. data/vendor/v8/include/v8-fast-api-calls.h +791 -0
  52. data/vendor/v8/include/v8-inspector-protocol.h +13 -0
  53. data/vendor/v8/include/v8-inspector.h +348 -0
  54. data/vendor/v8/include/v8-internal.h +499 -0
  55. data/vendor/v8/include/v8-metrics.h +202 -0
  56. data/vendor/v8/include/v8-platform.h +709 -0
  57. data/vendor/v8/include/v8-profiler.h +1123 -0
  58. data/vendor/v8/include/v8-unwinder-state.h +30 -0
  59. data/vendor/v8/include/v8-util.h +652 -0
  60. data/vendor/v8/include/v8-value-serializer-version.h +24 -0
  61. data/vendor/v8/include/v8-version-string.h +38 -0
  62. data/vendor/v8/include/v8-version.h +20 -0
  63. data/vendor/v8/include/v8-wasm-trap-handler-posix.h +31 -0
  64. data/vendor/v8/include/v8-wasm-trap-handler-win.h +28 -0
  65. data/vendor/v8/include/v8.h +12648 -0
  66. data/vendor/v8/include/v8config.h +515 -0
  67. data/vendor/v8/x86_64-darwin/libv8/obj/libv8_monolith.a +0 -0
  68. metadata +138 -0
@@ -0,0 +1,13 @@
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_V8_INSPECTOR_PROTOCOL_H_
6
+ #define V8_V8_INSPECTOR_PROTOCOL_H_
7
+
8
+ #include "inspector/Debugger.h" // NOLINT(build/include_directory)
9
+ #include "inspector/Runtime.h" // NOLINT(build/include_directory)
10
+ #include "inspector/Schema.h" // NOLINT(build/include_directory)
11
+ #include "v8-inspector.h" // NOLINT(build/include_directory)
12
+
13
+ #endif // V8_V8_INSPECTOR_PROTOCOL_H_
@@ -0,0 +1,348 @@
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_V8_INSPECTOR_H_
6
+ #define V8_V8_INSPECTOR_H_
7
+
8
+ #include <stdint.h>
9
+ #include <cctype>
10
+
11
+ #include <memory>
12
+ #include <unordered_map>
13
+
14
+ #include "v8.h" // NOLINT(build/include_directory)
15
+
16
+ namespace v8_inspector {
17
+
18
+ namespace protocol {
19
+ namespace Debugger {
20
+ namespace API {
21
+ class SearchMatch;
22
+ }
23
+ }
24
+ namespace Runtime {
25
+ namespace API {
26
+ class RemoteObject;
27
+ class StackTrace;
28
+ class StackTraceId;
29
+ }
30
+ }
31
+ namespace Schema {
32
+ namespace API {
33
+ class Domain;
34
+ }
35
+ }
36
+ } // namespace protocol
37
+
38
+ class V8_EXPORT StringView {
39
+ public:
40
+ StringView() : m_is8Bit(true), m_length(0), m_characters8(nullptr) {}
41
+
42
+ StringView(const uint8_t* characters, size_t length)
43
+ : m_is8Bit(true), m_length(length), m_characters8(characters) {}
44
+
45
+ StringView(const uint16_t* characters, size_t length)
46
+ : m_is8Bit(false), m_length(length), m_characters16(characters) {}
47
+
48
+ bool is8Bit() const { return m_is8Bit; }
49
+ size_t length() const { return m_length; }
50
+
51
+ // TODO(dgozman): add DCHECK(m_is8Bit) to accessors once platform can be used
52
+ // here.
53
+ const uint8_t* characters8() const { return m_characters8; }
54
+ const uint16_t* characters16() const { return m_characters16; }
55
+
56
+ private:
57
+ bool m_is8Bit;
58
+ size_t m_length;
59
+ union {
60
+ const uint8_t* m_characters8;
61
+ const uint16_t* m_characters16;
62
+ };
63
+ };
64
+
65
+ class V8_EXPORT StringBuffer {
66
+ public:
67
+ virtual ~StringBuffer() = default;
68
+ virtual StringView string() const = 0;
69
+ // This method copies contents.
70
+ static std::unique_ptr<StringBuffer> create(StringView);
71
+ };
72
+
73
+ class V8_EXPORT V8ContextInfo {
74
+ public:
75
+ V8ContextInfo(v8::Local<v8::Context> context, int contextGroupId,
76
+ StringView humanReadableName)
77
+ : context(context),
78
+ contextGroupId(contextGroupId),
79
+ humanReadableName(humanReadableName),
80
+ hasMemoryOnConsole(false) {}
81
+
82
+ v8::Local<v8::Context> context;
83
+ // Each v8::Context is a part of a group. The group id must be non-zero.
84
+ int contextGroupId;
85
+ StringView humanReadableName;
86
+ StringView origin;
87
+ StringView auxData;
88
+ bool hasMemoryOnConsole;
89
+
90
+ static int executionContextId(v8::Local<v8::Context> context);
91
+
92
+ // Disallow copying and allocating this one.
93
+ enum NotNullTagEnum { NotNullLiteral };
94
+ void* operator new(size_t) = delete;
95
+ void* operator new(size_t, NotNullTagEnum, void*) = delete;
96
+ void* operator new(size_t, void*) = delete;
97
+ V8ContextInfo(const V8ContextInfo&) = delete;
98
+ V8ContextInfo& operator=(const V8ContextInfo&) = delete;
99
+ };
100
+
101
+ class V8_EXPORT V8StackTrace {
102
+ public:
103
+ virtual StringView firstNonEmptySourceURL() const = 0;
104
+ virtual bool isEmpty() const = 0;
105
+ virtual StringView topSourceURL() const = 0;
106
+ virtual int topLineNumber() const = 0;
107
+ virtual int topColumnNumber() const = 0;
108
+ virtual int topScriptId() const = 0;
109
+ V8_DEPRECATE_SOON("Use V8::StackTrace::topScriptId() instead.")
110
+ int topScriptIdAsInteger() const { return topScriptId(); }
111
+ virtual StringView topFunctionName() const = 0;
112
+
113
+ virtual ~V8StackTrace() = default;
114
+ virtual std::unique_ptr<protocol::Runtime::API::StackTrace>
115
+ buildInspectorObject() const = 0;
116
+ virtual std::unique_ptr<protocol::Runtime::API::StackTrace>
117
+ buildInspectorObject(int maxAsyncDepth) const = 0;
118
+ virtual std::unique_ptr<StringBuffer> toString() const = 0;
119
+
120
+ // Safe to pass between threads, drops async chain.
121
+ virtual std::unique_ptr<V8StackTrace> clone() = 0;
122
+ };
123
+
124
+ class V8_EXPORT V8InspectorSession {
125
+ public:
126
+ virtual ~V8InspectorSession() = default;
127
+
128
+ // Cross-context inspectable values (DOM nodes in different worlds, etc.).
129
+ class V8_EXPORT Inspectable {
130
+ public:
131
+ virtual v8::Local<v8::Value> get(v8::Local<v8::Context>) = 0;
132
+ virtual ~Inspectable() = default;
133
+ };
134
+ class V8_EXPORT CommandLineAPIScope {
135
+ public:
136
+ virtual ~CommandLineAPIScope() = default;
137
+ };
138
+ virtual void addInspectedObject(std::unique_ptr<Inspectable>) = 0;
139
+
140
+ // Dispatching protocol messages.
141
+ static bool canDispatchMethod(StringView method);
142
+ virtual void dispatchProtocolMessage(StringView message) = 0;
143
+ virtual std::vector<uint8_t> state() = 0;
144
+ virtual std::vector<std::unique_ptr<protocol::Schema::API::Domain>>
145
+ supportedDomains() = 0;
146
+
147
+ virtual std::unique_ptr<V8InspectorSession::CommandLineAPIScope>
148
+ initializeCommandLineAPIScope(int executionContextId) = 0;
149
+
150
+ // Debugger actions.
151
+ virtual void schedulePauseOnNextStatement(StringView breakReason,
152
+ StringView breakDetails) = 0;
153
+ virtual void cancelPauseOnNextStatement() = 0;
154
+ virtual void breakProgram(StringView breakReason,
155
+ StringView breakDetails) = 0;
156
+ virtual void setSkipAllPauses(bool) = 0;
157
+ virtual void resume(bool setTerminateOnResume = false) = 0;
158
+ virtual void stepOver() = 0;
159
+ virtual std::vector<std::unique_ptr<protocol::Debugger::API::SearchMatch>>
160
+ searchInTextByLines(StringView text, StringView query, bool caseSensitive,
161
+ bool isRegex) = 0;
162
+
163
+ // Remote objects.
164
+ virtual std::unique_ptr<protocol::Runtime::API::RemoteObject> wrapObject(
165
+ v8::Local<v8::Context>, v8::Local<v8::Value>, StringView groupName,
166
+ bool generatePreview) = 0;
167
+
168
+ virtual bool unwrapObject(std::unique_ptr<StringBuffer>* error,
169
+ StringView objectId, v8::Local<v8::Value>*,
170
+ v8::Local<v8::Context>*,
171
+ std::unique_ptr<StringBuffer>* objectGroup) = 0;
172
+ virtual void releaseObjectGroup(StringView) = 0;
173
+ virtual void triggerPreciseCoverageDeltaUpdate(StringView occasion) = 0;
174
+ };
175
+
176
+ class V8_EXPORT V8InspectorClient {
177
+ public:
178
+ virtual ~V8InspectorClient() = default;
179
+
180
+ virtual void runMessageLoopOnPause(int contextGroupId) {}
181
+ virtual void quitMessageLoopOnPause() {}
182
+ virtual void runIfWaitingForDebugger(int contextGroupId) {}
183
+
184
+ virtual void muteMetrics(int contextGroupId) {}
185
+ virtual void unmuteMetrics(int contextGroupId) {}
186
+
187
+ virtual void beginUserGesture() {}
188
+ virtual void endUserGesture() {}
189
+
190
+ virtual std::unique_ptr<StringBuffer> valueSubtype(v8::Local<v8::Value>) {
191
+ return nullptr;
192
+ }
193
+ virtual std::unique_ptr<StringBuffer> descriptionForValueSubtype(
194
+ v8::Local<v8::Context>, v8::Local<v8::Value>) {
195
+ return nullptr;
196
+ }
197
+ virtual bool formatAccessorsAsProperties(v8::Local<v8::Value>) {
198
+ return false;
199
+ }
200
+ virtual bool isInspectableHeapObject(v8::Local<v8::Object>) { return true; }
201
+
202
+ virtual v8::Local<v8::Context> ensureDefaultContextInGroup(
203
+ int contextGroupId) {
204
+ return v8::Local<v8::Context>();
205
+ }
206
+ virtual void beginEnsureAllContextsInGroup(int contextGroupId) {}
207
+ virtual void endEnsureAllContextsInGroup(int contextGroupId) {}
208
+
209
+ virtual void installAdditionalCommandLineAPI(v8::Local<v8::Context>,
210
+ v8::Local<v8::Object>) {}
211
+ virtual void consoleAPIMessage(int contextGroupId,
212
+ v8::Isolate::MessageErrorLevel level,
213
+ const StringView& message,
214
+ const StringView& url, unsigned lineNumber,
215
+ unsigned columnNumber, V8StackTrace*) {}
216
+ virtual v8::MaybeLocal<v8::Value> memoryInfo(v8::Isolate*,
217
+ v8::Local<v8::Context>) {
218
+ return v8::MaybeLocal<v8::Value>();
219
+ }
220
+
221
+ virtual void consoleTime(const StringView& title) {}
222
+ virtual void consoleTimeEnd(const StringView& title) {}
223
+ virtual void consoleTimeStamp(const StringView& title) {}
224
+ virtual void consoleClear(int contextGroupId) {}
225
+ virtual double currentTimeMS() { return 0; }
226
+ typedef void (*TimerCallback)(void*);
227
+ virtual void startRepeatingTimer(double, TimerCallback, void* data) {}
228
+ virtual void cancelTimer(void* data) {}
229
+
230
+ // TODO(dgozman): this was added to support service worker shadow page. We
231
+ // should not connect at all.
232
+ virtual bool canExecuteScripts(int contextGroupId) { return true; }
233
+
234
+ virtual void maxAsyncCallStackDepthChanged(int depth) {}
235
+
236
+ virtual std::unique_ptr<StringBuffer> resourceNameToUrl(
237
+ const StringView& resourceName) {
238
+ return nullptr;
239
+ }
240
+
241
+ // The caller would defer to generating a random 64 bit integer if
242
+ // this method returns 0.
243
+ virtual int64_t generateUniqueId() { return 0; }
244
+ };
245
+
246
+ // These stack trace ids are intended to be passed between debuggers and be
247
+ // resolved later. This allows to track cross-debugger calls and step between
248
+ // them if a single client connects to multiple debuggers.
249
+ struct V8_EXPORT V8StackTraceId {
250
+ uintptr_t id;
251
+ std::pair<int64_t, int64_t> debugger_id;
252
+ bool should_pause = false;
253
+
254
+ V8StackTraceId();
255
+ V8StackTraceId(const V8StackTraceId&) = default;
256
+ V8StackTraceId(uintptr_t id, const std::pair<int64_t, int64_t> debugger_id);
257
+ V8StackTraceId(uintptr_t id, const std::pair<int64_t, int64_t> debugger_id,
258
+ bool should_pause);
259
+ explicit V8StackTraceId(StringView);
260
+ V8StackTraceId& operator=(const V8StackTraceId&) = default;
261
+ V8StackTraceId& operator=(V8StackTraceId&&) noexcept = default;
262
+ ~V8StackTraceId() = default;
263
+
264
+ bool IsInvalid() const;
265
+ std::unique_ptr<StringBuffer> ToString();
266
+ };
267
+
268
+ class V8_EXPORT V8Inspector {
269
+ public:
270
+ static std::unique_ptr<V8Inspector> create(v8::Isolate*, V8InspectorClient*);
271
+ virtual ~V8Inspector() = default;
272
+
273
+ // Contexts instrumentation.
274
+ virtual void contextCreated(const V8ContextInfo&) = 0;
275
+ virtual void contextDestroyed(v8::Local<v8::Context>) = 0;
276
+ virtual void resetContextGroup(int contextGroupId) = 0;
277
+ virtual v8::MaybeLocal<v8::Context> contextById(int contextId) = 0;
278
+
279
+ // Various instrumentation.
280
+ virtual void idleStarted() = 0;
281
+ virtual void idleFinished() = 0;
282
+
283
+ // Async stack traces instrumentation.
284
+ virtual void asyncTaskScheduled(StringView taskName, void* task,
285
+ bool recurring) = 0;
286
+ virtual void asyncTaskCanceled(void* task) = 0;
287
+ virtual void asyncTaskStarted(void* task) = 0;
288
+ virtual void asyncTaskFinished(void* task) = 0;
289
+ virtual void allAsyncTasksCanceled() = 0;
290
+
291
+ virtual V8StackTraceId storeCurrentStackTrace(StringView description) = 0;
292
+ virtual void externalAsyncTaskStarted(const V8StackTraceId& parent) = 0;
293
+ virtual void externalAsyncTaskFinished(const V8StackTraceId& parent) = 0;
294
+
295
+ // Exceptions instrumentation.
296
+ virtual unsigned exceptionThrown(v8::Local<v8::Context>, StringView message,
297
+ v8::Local<v8::Value> exception,
298
+ StringView detailedMessage, StringView url,
299
+ unsigned lineNumber, unsigned columnNumber,
300
+ std::unique_ptr<V8StackTrace>,
301
+ int scriptId) = 0;
302
+ virtual void exceptionRevoked(v8::Local<v8::Context>, unsigned exceptionId,
303
+ StringView message) = 0;
304
+ virtual bool associateExceptionData(v8::Local<v8::Context>,
305
+ v8::Local<v8::Value> exception,
306
+ v8::Local<v8::Name> key,
307
+ v8::Local<v8::Value> value) = 0;
308
+
309
+ // Connection.
310
+ class V8_EXPORT Channel {
311
+ public:
312
+ virtual ~Channel() = default;
313
+ virtual void sendResponse(int callId,
314
+ std::unique_ptr<StringBuffer> message) = 0;
315
+ virtual void sendNotification(std::unique_ptr<StringBuffer> message) = 0;
316
+ virtual void flushProtocolNotifications() = 0;
317
+ };
318
+ virtual std::unique_ptr<V8InspectorSession> connect(int contextGroupId,
319
+ Channel*,
320
+ StringView state) = 0;
321
+
322
+ // API methods.
323
+ virtual std::unique_ptr<V8StackTrace> createStackTrace(
324
+ v8::Local<v8::StackTrace>) = 0;
325
+ virtual std::unique_ptr<V8StackTrace> captureStackTrace(bool fullStack) = 0;
326
+
327
+ // Performance counters.
328
+ class V8_EXPORT Counters : public std::enable_shared_from_this<Counters> {
329
+ public:
330
+ explicit Counters(v8::Isolate* isolate);
331
+ ~Counters();
332
+ const std::unordered_map<std::string, int>& getCountersMap() const {
333
+ return m_countersMap;
334
+ }
335
+
336
+ private:
337
+ static int* getCounterPtr(const char* name);
338
+
339
+ v8::Isolate* m_isolate;
340
+ std::unordered_map<std::string, int> m_countersMap;
341
+ };
342
+
343
+ virtual std::shared_ptr<Counters> enableCounters() = 0;
344
+ };
345
+
346
+ } // namespace v8_inspector
347
+
348
+ #endif // V8_V8_INSPECTOR_H_