v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::internal::CodeEntry Class Reference

#include <profile-generator.h>

Collaboration diagram for v8::internal::CodeEntry:

Classes

struct  Equals
 
struct  Hasher
 
struct  RareData
 

Public Types

enum class  CodeType { JS , WASM , OTHER }
 

Public Member Functions

 CodeEntry (LogEventListener::CodeTag tag, const char *name, const char *resource_name=CodeEntry::kEmptyResourceName, int line_number=v8::CpuProfileNode::kNoLineNumberInfo, int column_number=v8::CpuProfileNode::kNoColumnNumberInfo, std::unique_ptr< SourcePositionTable > line_info=nullptr, bool is_shared_cross_origin=false, CodeType code_type=CodeType::JS)
 
 CodeEntry (const CodeEntry &)=delete
 
CodeEntryoperator= (const CodeEntry &)=delete
 
 ~CodeEntry ()
 
const char * name () const
 
const char * resource_name () const
 
int line_number () const
 
int column_number () const
 
const SourcePositionTableline_info () const
 
int script_id () const
 
void set_script_id (int script_id)
 
int position () const
 
void set_position (int position)
 
void set_bailout_reason (const char *bailout_reason)
 
const char * bailout_reason () const
 
void set_deopt_info (const char *deopt_reason, int deopt_id, std::vector< CpuProfileDeoptFrame > inlined_frames)
 
size_t EstimatedSize () const
 
CpuProfileDeoptInfo GetDeoptInfo ()
 
bool has_deopt_info () const
 
void clear_deopt_info ()
 
const char * code_type_string () const
 
Address instruction_start () const
 
void set_instruction_start (Address address)
 
Address ** heap_object_location_address ()
 
void FillFunctionInfo (Tagged< SharedFunctionInfo > shared)
 
void SetBuiltinId (Builtin id)
 
Builtin builtin () const
 
bool is_shared_cross_origin () const
 
bool is_ref_counted () const
 
uint32_t GetHash () const
 
bool IsSameFunctionAs (const CodeEntry *entry) const
 
int GetSourceLine (int pc_offset) const
 
void SetInlineStacks (std::unordered_set< CodeEntry *, Hasher, Equals > inline_entries, std::unordered_map< int, std::vector< CodeEntryAndLineNumber > > inline_stacks)
 
const std::vector< CodeEntryAndLineNumber > * GetInlineStack (int pc_offset) const
 
LogEventListener::Event event () const
 
LogEventListener::CodeTag code_tag () const
 
void ReleaseStrings (StringsStorage &strings)
 
void print () const
 

Static Public Member Functions

static V8_EXPORT_PRIVATE CodeEntryprogram_entry ()
 
static V8_EXPORT_PRIVATE CodeEntryidle_entry ()
 
static V8_EXPORT_PRIVATE CodeEntrygc_entry ()
 
static V8_EXPORT_PRIVATE CodeEntryunresolved_entry ()
 
static V8_EXPORT_PRIVATE CodeEntryroot_entry ()
 

Static Public Attributes

static V8_EXPORT_PRIVATE const char *const kEmptyResourceName = ""
 
static const char *const kEmptyBailoutReason = ""
 
static const char *const kNoDeoptReason = ""
 
static V8_EXPORT_PRIVATE const char *const kProgramEntryName = "(program)"
 
static V8_EXPORT_PRIVATE const char *const kIdleEntryName = "(idle)"
 
static V8_EXPORT_PRIVATE const char *const kGarbageCollectorEntryName = "(garbage collector)"
 
static V8_EXPORT_PRIVATE const char *const kUnresolvedFunctionName = "(unresolved function)"
 
static V8_EXPORT_PRIVATE const char *const kRootEntryName = "(root)"
 

Private Types

using EventField = base::BitField<LogEventListener::Event, 0, 4>
 
using CodeTagField = base::BitField<LogEventListener::CodeTag, 0, 4>
 
using BuiltinField = base::BitField<Builtin, 8, 20>
 
using RefCountedField = base::BitField<bool, 28, 1>
 
using CodeTypeField = base::BitField<CodeType, 29, 2>
 
using SharedCrossOriginField = base::BitField<bool, 31, 1>
 

Private Member Functions

RareDataEnsureRareData ()
 
void mark_ref_counted ()
 
size_t AddRef ()
 
size_t DecRef ()
 

Private Attributes

std::uint32_t bit_field_
 
std::atomic< std::size_t > ref_count_ = {0}
 
const char * name_
 
const char * resource_name_
 
int line_number_
 
int column_number_
 
int script_id_
 
int position_
 
std::unique_ptr< SourcePositionTableline_info_
 
std::unique_ptr< RareDatarare_data_
 
Address instruction_start_ = kNullAddress
 
Addressheap_object_location_ = nullptr
 

Friends

class CodeEntryStorage
 

Detailed Description

Definition at line 63 of file profile-generator.h.

Member Typedef Documentation

◆ BuiltinField

Definition at line 237 of file profile-generator.h.

◆ CodeTagField

◆ CodeTypeField

Definition at line 241 of file profile-generator.h.

◆ EventField

◆ RefCountedField

Definition at line 240 of file profile-generator.h.

◆ SharedCrossOriginField

Definition at line 242 of file profile-generator.h.

Member Enumeration Documentation

◆ CodeType

Enumerator
JS 
WASM 
OTHER 

Definition at line 65 of file profile-generator.h.

Constructor & Destructor Documentation

◆ CodeEntry() [1/2]

v8::internal::CodeEntry::CodeEntry ( LogEventListener::CodeTag tag,
const char * name,
const char * resource_name = CodeEntry::kEmptyResourceName,
int line_number = v8::CpuProfileNode::kNoLineNumberInfo,
int column_number = v8::CpuProfileNode::kNoColumnNumberInfo,
std::unique_ptr< SourcePositionTable > line_info = nullptr,
bool is_shared_cross_origin = false,
CodeType code_type = CodeType::JS )
inline

Definition at line 16 of file profile-generator-inl.h.

◆ CodeEntry() [2/2]

v8::internal::CodeEntry::CodeEntry ( const CodeEntry & )
delete

◆ ~CodeEntry()

v8::internal::CodeEntry::~CodeEntry ( )
inline

Definition at line 78 of file profile-generator.h.

Member Function Documentation

◆ AddRef()

size_t v8::internal::CodeEntry::AddRef ( )
inlineprivate

Definition at line 221 of file profile-generator.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bailout_reason()

const char * v8::internal::CodeEntry::bailout_reason ( ) const
inline

Definition at line 97 of file profile-generator.h.

Here is the caller graph for this function:

◆ builtin()

Builtin v8::internal::CodeEntry::builtin ( ) const
inline

Definition at line 137 of file profile-generator.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clear_deopt_info()

void v8::internal::CodeEntry::clear_deopt_info ( )
inline

Definition at line 109 of file profile-generator.h.

Here is the caller graph for this function:

◆ code_tag()

LogEventListener::CodeTag v8::internal::CodeEntry::code_tag ( ) const
inline

Definition at line 172 of file profile-generator.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ code_type_string()

const char * v8::internal::CodeEntry::code_type_string ( ) const
inline

Definition at line 116 of file profile-generator.h.

Here is the call graph for this function:

◆ column_number()

int v8::internal::CodeEntry::column_number ( ) const
inline

Definition at line 88 of file profile-generator.h.

◆ DecRef()

size_t v8::internal::CodeEntry::DecRef ( )
inlineprivate

Definition at line 228 of file profile-generator.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EnsureRareData()

CodeEntry::RareData * v8::internal::CodeEntry::EnsureRareData ( )
private

Definition at line 265 of file profile-generator.cc.

Here is the caller graph for this function:

◆ EstimatedSize()

size_t v8::internal::CodeEntry::EstimatedSize ( ) const

Definition at line 219 of file profile-generator.cc.

◆ event()

LogEventListener::Event v8::internal::CodeEntry::event ( ) const
inline

Definition at line 168 of file profile-generator.h.

Here is the call graph for this function:

◆ FillFunctionInfo()

void v8::internal::CodeEntry::FillFunctionInfo ( Tagged< SharedFunctionInfo > shared)

Definition at line 208 of file profile-generator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gc_entry()

CodeEntry * v8::internal::CodeEntry::gc_entry ( )
static

Definition at line 114 of file profile-generator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDeoptInfo()

CpuProfileDeoptInfo v8::internal::CodeEntry::GetDeoptInfo ( )

Definition at line 250 of file profile-generator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetHash()

uint32_t v8::internal::CodeEntry::GetHash ( ) const

Definition at line 144 of file profile-generator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetInlineStack()

const std::vector< CodeEntryAndLineNumber > * v8::internal::CodeEntry::GetInlineStack ( int pc_offset) const

Definition at line 187 of file profile-generator.cc.

Here is the caller graph for this function:

◆ GetSourceLine()

int v8::internal::CodeEntry::GetSourceLine ( int pc_offset) const

Definition at line 174 of file profile-generator.cc.

Here is the caller graph for this function:

◆ has_deopt_info()

bool v8::internal::CodeEntry::has_deopt_info ( ) const
inline

Definition at line 106 of file profile-generator.h.

Here is the caller graph for this function:

◆ heap_object_location_address()

Address ** v8::internal::CodeEntry::heap_object_location_address ( )
inline

Definition at line 132 of file profile-generator.h.

Here is the caller graph for this function:

◆ idle_entry()

CodeEntry * v8::internal::CodeEntry::idle_entry ( )
static

Definition at line 104 of file profile-generator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ instruction_start()

Address v8::internal::CodeEntry::instruction_start ( ) const
inline

Definition at line 129 of file profile-generator.h.

Here is the caller graph for this function:

◆ is_ref_counted()

bool v8::internal::CodeEntry::is_ref_counted ( ) const
inline

Definition at line 145 of file profile-generator.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_shared_cross_origin()

bool v8::internal::CodeEntry::is_shared_cross_origin ( ) const
inline

Definition at line 139 of file profile-generator.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsSameFunctionAs()

bool v8::internal::CodeEntry::IsSameFunctionAs ( const CodeEntry * entry) const

Definition at line 159 of file profile-generator.cc.

Here is the caller graph for this function:

◆ line_info()

const SourcePositionTable * v8::internal::CodeEntry::line_info ( ) const
inline

Definition at line 89 of file profile-generator.h.

◆ line_number()

int v8::internal::CodeEntry::line_number ( ) const
inline

Definition at line 87 of file profile-generator.h.

Here is the caller graph for this function:

◆ mark_ref_counted()

void v8::internal::CodeEntry::mark_ref_counted ( )
inlineprivate

Definition at line 216 of file profile-generator.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ name()

const char * v8::internal::CodeEntry::name ( ) const
inline

Definition at line 85 of file profile-generator.h.

Here is the caller graph for this function:

◆ operator=()

CodeEntry & v8::internal::CodeEntry::operator= ( const CodeEntry & )
delete

◆ position()

int v8::internal::CodeEntry::position ( ) const
inline

Definition at line 92 of file profile-generator.h.

Here is the caller graph for this function:

◆ print()

void v8::internal::CodeEntry::print ( ) const

Definition at line 285 of file profile-generator.cc.

◆ program_entry()

CodeEntry * v8::internal::CodeEntry::program_entry ( )
static

Definition at line 94 of file profile-generator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReleaseStrings()

void v8::internal::CodeEntry::ReleaseStrings ( StringsStorage & strings)

Definition at line 272 of file profile-generator.cc.

Here is the caller graph for this function:

◆ resource_name()

const char * v8::internal::CodeEntry::resource_name ( ) const
inline

Definition at line 86 of file profile-generator.h.

Here is the caller graph for this function:

◆ root_entry()

CodeEntry * v8::internal::CodeEntry::root_entry ( )
static

Definition at line 135 of file profile-generator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ script_id()

int v8::internal::CodeEntry::script_id ( ) const
inline

Definition at line 90 of file profile-generator.h.

Here is the caller graph for this function:

◆ set_bailout_reason()

void v8::internal::CodeEntry::set_bailout_reason ( const char * bailout_reason)
inline

Definition at line 94 of file profile-generator.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_deopt_info()

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

Definition at line 199 of file profile-generator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_instruction_start()

void v8::internal::CodeEntry::set_instruction_start ( Address address)
inline

Definition at line 130 of file profile-generator.h.

Here is the caller graph for this function:

◆ set_position()

void v8::internal::CodeEntry::set_position ( int position)
inline

Definition at line 93 of file profile-generator.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_script_id()

void v8::internal::CodeEntry::set_script_id ( int script_id)
inline

Definition at line 91 of file profile-generator.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetBuiltinId()

void v8::internal::CodeEntry::SetBuiltinId ( Builtin id)

Definition at line 168 of file profile-generator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetInlineStacks()

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

Definition at line 179 of file profile-generator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unresolved_entry()

CodeEntry * v8::internal::CodeEntry::unresolved_entry ( )
static

Definition at line 125 of file profile-generator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ CodeEntryStorage

friend class CodeEntryStorage
friend

Definition at line 203 of file profile-generator.h.

Member Data Documentation

◆ bit_field_

std::uint32_t v8::internal::CodeEntry::bit_field_
private

Definition at line 244 of file profile-generator.h.

◆ column_number_

int v8::internal::CodeEntry::column_number_
private

Definition at line 249 of file profile-generator.h.

◆ heap_object_location_

Address* v8::internal::CodeEntry::heap_object_location_ = nullptr
private

Definition at line 255 of file profile-generator.h.

◆ instruction_start_

Address v8::internal::CodeEntry::instruction_start_ = kNullAddress
private

Definition at line 254 of file profile-generator.h.

◆ kEmptyBailoutReason

const char *const v8::internal::CodeEntry::kEmptyBailoutReason = ""
static

Definition at line 177 of file profile-generator.h.

◆ kEmptyResourceName

const char *const v8::internal::CodeEntry::kEmptyResourceName = ""
static

Definition at line 176 of file profile-generator.h.

◆ kGarbageCollectorEntryName

const char *const v8::internal::CodeEntry::kGarbageCollectorEntryName = "(garbage collector)"
static

Definition at line 182 of file profile-generator.h.

◆ kIdleEntryName

const char *const v8::internal::CodeEntry::kIdleEntryName = "(idle)"
static

Definition at line 181 of file profile-generator.h.

◆ kNoDeoptReason

const char *const v8::internal::CodeEntry::kNoDeoptReason = ""
static

Definition at line 178 of file profile-generator.h.

◆ kProgramEntryName

const char *const v8::internal::CodeEntry::kProgramEntryName = "(program)"
static

Definition at line 180 of file profile-generator.h.

◆ kRootEntryName

const char *const v8::internal::CodeEntry::kRootEntryName = "(root)"
static

Definition at line 186 of file profile-generator.h.

◆ kUnresolvedFunctionName

const char *const v8::internal::CodeEntry::kUnresolvedFunctionName = "(unresolved function)"
static

Definition at line 185 of file profile-generator.h.

◆ line_info_

std::unique_ptr<SourcePositionTable> v8::internal::CodeEntry::line_info_
private

Definition at line 252 of file profile-generator.h.

◆ line_number_

int v8::internal::CodeEntry::line_number_
private

Definition at line 248 of file profile-generator.h.

◆ name_

const char* v8::internal::CodeEntry::name_
private

Definition at line 246 of file profile-generator.h.

◆ position_

int v8::internal::CodeEntry::position_
private

Definition at line 251 of file profile-generator.h.

◆ rare_data_

std::unique_ptr<RareData> v8::internal::CodeEntry::rare_data_
private

Definition at line 253 of file profile-generator.h.

◆ ref_count_

std::atomic<std::size_t> v8::internal::CodeEntry::ref_count_ = {0}
private

Definition at line 245 of file profile-generator.h.

◆ resource_name_

const char* v8::internal::CodeEntry::resource_name_
private

Definition at line 247 of file profile-generator.h.

◆ script_id_

int v8::internal::CodeEntry::script_id_
private

Definition at line 250 of file profile-generator.h.


The documentation for this class was generated from the following files: