v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
etw-isolate-operations-win.cc
Go to the documentation of this file.
1// Copyright 2024 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
6
9#include "src/logging/log.h"
10
11namespace v8 {
12namespace internal {
13namespace ETWJITInterface {
14
15// static
16EtwIsolateOperations* EtwIsolateOperations::instance = nullptr;
17
18// virtual
20 uint32_t options) {
21 isolate->v8_file_logger()->SetEtwCodeEventHandler(options);
22}
23
24// virtual
26 isolate->v8_file_logger()->ResetEtwCodeEventHandler();
27}
28
29// virtual
30FilterETWSessionByURLResult
32 Isolate* isolate, const std::string& payload) {
33 // We should not call back into V8 from the RunFilterETWSessionByURLCallback
34 // callback.
35 DisallowJavascriptExecution no_js(isolate);
36 return isolate->RunFilterETWSessionByURLCallback(payload);
37}
38
39// virtual
42 void* data) {
43 isolate->RequestInterrupt(callback, data);
44}
45
46// virtual
48 return isolate->heap()->read_only_space()->writable();
49}
50
51// virtual
52std::optional<Tagged<GcSafeCode>>
54 Address address) {
55 return isolate->heap()->GcSafeTryFindCodeForInnerPointer(address);
56}
57
58// static
60 static EtwIsolateOperations etw_isolate_operations;
61 if (!instance) {
62 instance = &etw_isolate_operations;
63 }
64
65 return instance;
66}
67
68// static
70 EtwIsolateOperations* etw_isolate_operations) {
71 instance = etw_isolate_operations;
72}
73
74} // namespace ETWJITInterface
75} // namespace internal
76} // namespace v8
virtual void RequestInterrupt(Isolate *isolate, InterruptCallback callback, void *data)
virtual std::optional< Tagged< GcSafeCode > > HeapGcSafeTryFindCodeForInnerPointer(Isolate *isolate, Address address)
static void SetInstanceForTesting(EtwIsolateOperations *etw_isolate_operations)
virtual void SetEtwCodeEventHandler(Isolate *isolate, uint32_t options)
virtual FilterETWSessionByURLResult RunFilterETWSessionByURLCallback(Isolate *isolate, const std::string &payload)
TNode< Object > callback
void(*)(Isolate *isolate, void *data) InterruptCallback