chromium/v8/src/profiler/profile-generator.cc

// Copyright 2012 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "src/profiler/profile-generator.h"

#include <algorithm>
#include <vector>

#include "include/v8-profiler.h"
#include "src/base/lazy-instance.h"
#include "src/codegen/source-position.h"
#include "src/objects/shared-function-info-inl.h"
#include "src/profiler/cpu-profiler.h"
#include "src/profiler/output-stream-writer.h"
#include "src/profiler/profile-generator-inl.h"
#include "src/profiler/profiler-stats.h"
#include "src/tracing/trace-event.h"
#include "src/tracing/traced-value.h"

namespace v8 {
namespace internal {

void SourcePositionTable::SetPosition(int pc_offset, int line,
                                      int inlining_id) {}

int SourcePositionTable::GetSourceLineNumber(int pc_offset) const {}

int SourcePositionTable::GetInliningId(int pc_offset) const {}

size_t SourcePositionTable::Size() const {}

void SourcePositionTable::print() const {}

const char* const CodeEntry::kEmptyResourceName =;
const char* const CodeEntry::kEmptyBailoutReason =;
const char* const CodeEntry::kNoDeoptReason =;

const char* const CodeEntry::kProgramEntryName =;
const char* const CodeEntry::kIdleEntryName =;
const char* const CodeEntry::kGarbageCollectorEntryName =;
const char* const CodeEntry::kUnresolvedFunctionName =;
const char* const CodeEntry::kRootEntryName =;

// static
CodeEntry* CodeEntry::program_entry() {}

// static
CodeEntry* CodeEntry::idle_entry() {}

// static
CodeEntry* CodeEntry::gc_entry() {}

// static
CodeEntry* CodeEntry::unresolved_entry() {}

// static
CodeEntry* CodeEntry::root_entry() {}

uint32_t CodeEntry::GetHash() const {}

bool CodeEntry::IsSameFunctionAs(const CodeEntry* entry) const {}

void CodeEntry::SetBuiltinId(Builtin id) {}

int CodeEntry::GetSourceLine(int pc_offset) const {}

void CodeEntry::SetInlineStacks(
    std::unordered_set<CodeEntry*, Hasher, Equals> inline_entries,
    std::unordered_map<int, std::vector<CodeEntryAndLineNumber>>
        inline_stacks) {}

const std::vector<CodeEntryAndLineNumber>* CodeEntry::GetInlineStack(
    int pc_offset) const {}

void CodeEntry::set_deopt_info(
    const char* deopt_reason, int deopt_id,
    std::vector<CpuProfileDeoptFrame> inlined_frames) {}

void CodeEntry::FillFunctionInfo(Tagged<SharedFunctionInfo> shared) {}

size_t CodeEntry::EstimatedSize() const {}

CpuProfileDeoptInfo CodeEntry::GetDeoptInfo() {}

CodeEntry::RareData* CodeEntry::EnsureRareData() {}

void CodeEntry::ReleaseStrings(StringsStorage& strings) {}

void CodeEntry::print() const {}

ProfileNode::~ProfileNode() {}

CpuProfileNode::SourceType ProfileNode::source_type() const {}

void ProfileNode::CollectDeoptInfo(CodeEntry* entry) {}

ProfileNode* ProfileNode::FindChild(CodeEntry* entry, int line_number) {}

ProfileNode* ProfileNode::FindOrAddChild(CodeEntry* entry, int line_number) {}


void ProfileNode::IncrementLineTicks(int src_line) {}


bool ProfileNode::GetLineTicks(v8::CpuProfileNode::LineTick* entries,
                               unsigned int length) const {}

void ProfileNode::Print(int indent) const {}

class DeleteNodesCallback {};

ProfileTree::ProfileTree(Isolate* isolate, CodeEntryStorage* storage)
    :{}

ProfileTree::~ProfileTree() {}

ProfileNode* ProfileTree::AddPathFromEnd(const std::vector<CodeEntry*>& path,
                                         int src_line, bool update_stats) {}

ProfileNode* ProfileTree::AddPathFromEnd(const ProfileStackTrace& path,
                                         int src_line, bool update_stats,
                                         ProfilingMode mode) {}

class Position {};


// Non-recursive implementation of a depth-first post-order tree traversal.
template <typename Callback>
void ProfileTree::TraverseDepthFirst(Callback* callback) {}

void ContextFilter::OnMoveEvent(Address from_address, Address to_address) {}

TracedValue;

std::atomic<ProfilerId> CpuProfilesCollection::last_id_{};

CpuProfile::CpuProfile(CpuProfiler* profiler, ProfilerId id, const char* title,
                       CpuProfilingOptions options,
                       std::unique_ptr<DiscardedSamplesDelegate> delegate)
    :{}

bool CpuProfile::CheckSubsample(base::TimeDelta source_sampling_interval) {}

void CpuProfile::AddPath(base::TimeTicks timestamp,
                         const ProfileStackTrace& path, int src_line,
                         bool update_stats, base::TimeDelta sampling_interval,
                         StateTag state_tag,
                         EmbedderStateTag embedder_state_tag) {}

namespace {

void BuildNodeValue(const ProfileNode* node, TracedValue* value) {}

}  // namespace

void CpuProfile::StreamPendingTraceEvents() {}

void CpuProfile::FinishProfile() {}

namespace {

void FlattenNodesTree(const v8::CpuProfileNode* node,
                      std::vector<const v8::CpuProfileNode*>* nodes) {}

}  // namespace

void CpuProfileJSONSerializer::Serialize(v8::OutputStream* stream) {}

void CpuProfileJSONSerializer::SerializePositionTicks(
    const v8::CpuProfileNode* node, int lineCount) {}

void CpuProfileJSONSerializer::SerializeCallFrame(
    const v8::CpuProfileNode* node) {}

void CpuProfileJSONSerializer::SerializeChildren(const v8::CpuProfileNode* node,
                                                 int childrenCount) {}

void CpuProfileJSONSerializer::SerializeNode(const v8::CpuProfileNode* node) {}

void CpuProfileJSONSerializer::SerializeNodes() {}

void CpuProfileJSONSerializer::SerializeTimeDeltas() {}

void CpuProfileJSONSerializer::SerializeSamples() {}

void CpuProfileJSONSerializer::SerializeImpl() {}

void CpuProfile::Print() const {}

void CodeEntryStorage::AddRef(CodeEntry* entry) {}

void CodeEntryStorage::DecRef(CodeEntry* entry) {}

InstructionStreamMap::InstructionStreamMap(CodeEntryStorage& storage)
    :{}

InstructionStreamMap::~InstructionStreamMap() {}

void InstructionStreamMap::Clear() {}

void InstructionStreamMap::AddCode(Address addr, CodeEntry* entry,
                                   unsigned size) {}

bool InstructionStreamMap::RemoveCode(CodeEntry* entry) {}

void InstructionStreamMap::ClearCodesInRange(Address start, Address end) {}

CodeEntry* InstructionStreamMap::FindEntry(Address addr,
                                           Address* out_instruction_start) {}

void InstructionStreamMap::MoveCode(Address from, Address to) {}

void InstructionStreamMap::Print() {}

size_t InstructionStreamMap::GetEstimatedMemoryUsage() const {}

CpuProfilesCollection::CpuProfilesCollection(Isolate* isolate)
    :{}

CpuProfilingResult CpuProfilesCollection::StartProfilingForTesting(
    ProfilerId id) {}

CpuProfilingResult CpuProfilesCollection::StartProfiling(
    const char* title, CpuProfilingOptions options,
    std::unique_ptr<DiscardedSamplesDelegate> delegate) {}

CpuProfilingResult CpuProfilesCollection::StartProfiling(
    ProfilerId id, const char* title, CpuProfilingOptions options,
    std::unique_ptr<DiscardedSamplesDelegate> delegate) {}

CpuProfile* CpuProfilesCollection::StopProfiling(ProfilerId id) {}

CpuProfile* CpuProfilesCollection::Lookup(const char* title) {}

bool CpuProfilesCollection::IsLastProfileLeft(ProfilerId id) {}

void CpuProfilesCollection::RemoveProfile(CpuProfile* profile) {}

namespace {

int64_t GreatestCommonDivisor(int64_t a, int64_t b) {}

}  // namespace

base::TimeDelta CpuProfilesCollection::GetCommonSamplingInterval() {}

void CpuProfilesCollection::AddPathToCurrentProfiles(
    base::TimeTicks timestamp, const ProfileStackTrace& path, int src_line,
    bool update_stats, base::TimeDelta sampling_interval, StateTag state,
    EmbedderStateTag embedder_state_tag, Address native_context_address,
    Address embedder_native_context_address) {}

void CpuProfilesCollection::UpdateNativeContextAddressForCurrentProfiles(
    Address from, Address to) {}

}  // namespace internal
}  // namespace v8