#include "src/diagnostics/perf-jit.h"
#include "src/common/assert-scope.h"
#include "src/flags/flags.h"
#if V8_OS_LINUX
#include <fcntl.h>
#include <sys/mman.h>
#include <unistd.h>
#include <memory>
#include "src/base/platform/wrappers.h"
#include "src/codegen/assembler.h"
#include "src/codegen/source-position-table.h"
#include "src/diagnostics/eh-frame.h"
#include "src/objects/code-kind.h"
#include "src/objects/objects-inl.h"
#include "src/objects/shared-function-info.h"
#include "src/snapshot/embedded/embedded-data.h"
#include "src/utils/ostreams.h"
#if V8_ENABLE_WEBASSEMBLY
#include "src/wasm/wasm-code-manager.h"
#endif
namespace v8 {
namespace internal {
base::LazyRecursiveMutex& GetFileMutex() { … }
struct PerfJitHeader { … };
struct PerfJitBase { … };
struct PerfJitCodeLoad : PerfJitBase { … };
struct PerfJitDebugEntry { … };
struct PerfJitCodeDebugInfo : PerfJitBase { … };
struct PerfJitCodeUnwindingInfo : PerfJitBase { … };
const char LinuxPerfJitLogger::kFilenameFormatString[] = …;
const int LinuxPerfJitLogger::kFilenameBufferPadding = …;
static const char kStringTerminator[] = …;
int LinuxPerfJitLogger::process_id_ = …;
uint64_t LinuxPerfJitLogger::reference_count_ = …;
void* LinuxPerfJitLogger::marker_address_ = …;
uint64_t LinuxPerfJitLogger::code_index_ = …;
FILE* LinuxPerfJitLogger::perf_output_handle_ = …;
void LinuxPerfJitLogger::OpenJitDumpFile() { … }
void LinuxPerfJitLogger::CloseJitDumpFile() { … }
void* LinuxPerfJitLogger::OpenMarkerFile(int fd) { … }
void LinuxPerfJitLogger::CloseMarkerFile(void* marker_address) { … }
LinuxPerfJitLogger::LinuxPerfJitLogger(Isolate* isolate)
: … { … }
LinuxPerfJitLogger::~LinuxPerfJitLogger() { … }
uint64_t LinuxPerfJitLogger::GetTimestamp() { … }
void LinuxPerfJitLogger::LogRecordedBuffer(
Tagged<AbstractCode> abstract_code,
MaybeHandle<SharedFunctionInfo> maybe_sfi, const char* name, int length) { … }
#if V8_ENABLE_WEBASSEMBLY
void LinuxPerfJitLogger::LogRecordedBuffer(const wasm::WasmCode* code,
const char* name, int length) { … }
#endif
void LinuxPerfJitLogger::WriteJitCodeLoadEntry(const uint8_t* code_pointer,
uint32_t code_size,
const char* name,
int name_length) { … }
namespace {
constexpr char kUnknownScriptNameString[] = …;
constexpr size_t kUnknownScriptNameStringLen = …;
namespace {
base::Vector<const char> GetScriptName(Tagged<Object> maybeScript,
std::unique_ptr<char[]>* storage,
const DisallowGarbageCollection& no_gc) { … }
}
SourcePositionInfo GetSourcePositionInfo(Isolate* isolate, Tagged<Code> code,
Handle<SharedFunctionInfo> function,
SourcePosition pos) { … }
}
void LinuxPerfJitLogger::LogWriteDebugInfo(Tagged<Code> code,
Handle<SharedFunctionInfo> shared) { … }
#if V8_ENABLE_WEBASSEMBLY
void LinuxPerfJitLogger::LogWriteDebugInfo(const wasm::WasmCode* code) { … }
#endif
void LinuxPerfJitLogger::LogWriteUnwindingInfo(Tagged<Code> code) { … }
void LinuxPerfJitLogger::LogWriteBytes(const char* bytes, int size) { … }
void LinuxPerfJitLogger::LogWriteHeader() { … }
}
}
#endif