v8  7.4.288(node12.0.0)
V8 is Google's open source JavaScript engine
TickSample Struct Reference

#include <v8-profiler.h>

Public Types

enum  RecordCEntryFrame { kIncludeCEntryFrame, kSkipCEntryFrame }
 

Public Member Functions

 TickSample ()
 
void Init (Isolate *isolate, const v8::RegisterState &state, RecordCEntryFrame record_c_entry_frame, bool update_stats, bool use_simulator_reg_state=true)
 

Static Public Member Functions

static bool GetStackSample (Isolate *isolate, v8::RegisterState *state, RecordCEntryFrame record_c_entry_frame, void **frames, size_t frames_limit, v8::SampleInfo *sample_info, bool use_simulator_reg_state=true)
 

Data Fields

StateTag state
 
void * pc
 
union {
   void *   tos
 
   void *   external_callback_entry
 
}; 
 
void * stack [kMaxFramesCount]
 
unsigned frames_count: kMaxFramesCountLog2
 
bool has_external_callback: 1
 
bool update_stats: 1
 

Static Public Attributes

static const unsigned kMaxFramesCountLog2 = 8
 
static const unsigned kMaxFramesCount = (1 << kMaxFramesCountLog2) - 1
 

Detailed Description

Definition at line 51 of file v8-profiler.h.

Member Enumeration Documentation

◆ RecordCEntryFrame

Enumerator
kIncludeCEntryFrame 
kSkipCEntryFrame 

Definition at line 55 of file v8-profiler.h.

Constructor & Destructor Documentation

◆ TickSample()

TickSample ( )
inline

Definition at line 57 of file v8-profiler.h.

Member Function Documentation

◆ GetStackSample()

static bool GetStackSample ( Isolate isolate,
v8::RegisterState state,
RecordCEntryFrame  record_c_entry_frame,
void **  frames,
size_t  frames_limit,
v8::SampleInfo sample_info,
bool  use_simulator_reg_state = true 
)
static

Get a call stack sample from the isolate.

Parameters
isolateThe isolate.
stateRegister state.
record_c_entry_frameInclude or skip the runtime function.
framesCaller allocated buffer to store stack frames.
frames_limitMaximum number of frames to capture. The buffer must be large enough to hold the number of frames.
sample_infoThe sample info is filled up by the function provides number of actual captured stack frames and the current VM state.
use_simulator_reg_stateWhen set to true and V8 is running under a simulator, the method will use the simulator register state rather than the one provided with |state| argument. Otherwise the method will use provided register |state| as is.
Note
GetStackSample is thread and signal safe and should only be called when the JS thread is paused or interrupted. Otherwise the behavior is undefined.

◆ Init()

void Init ( Isolate isolate,
const v8::RegisterState state,
RecordCEntryFrame  record_c_entry_frame,
bool  update_stats,
bool  use_simulator_reg_state = true 
)

Initialize a tick sample from the isolate.

Parameters
isolateThe isolate.
stateExecution state.
record_c_entry_frameInclude or skip the runtime function.
update_statsWhether update the sample to the aggregated stats.
use_simulator_reg_stateWhen set to true and V8 is running under a simulator, the method will use the simulator register state rather than the one provided with |state| argument. Otherwise the method will use provided register |state| as is.

Field Documentation

◆ @5

union { ... }

◆ external_callback_entry

void* external_callback_entry

Definition at line 109 of file v8-profiler.h.

◆ frames_count

unsigned frames_count

Definition at line 114 of file v8-profiler.h.

◆ has_external_callback

bool has_external_callback

Definition at line 115 of file v8-profiler.h.

◆ kMaxFramesCount

const unsigned kMaxFramesCount = (1 << kMaxFramesCountLog2) - 1
static

Definition at line 112 of file v8-profiler.h.

◆ kMaxFramesCountLog2

const unsigned kMaxFramesCountLog2 = 8
static

Definition at line 111 of file v8-profiler.h.

◆ pc

void* pc

Definition at line 106 of file v8-profiler.h.

◆ stack

void* stack[kMaxFramesCount]

Definition at line 113 of file v8-profiler.h.

◆ state

StateTag state

Definition at line 105 of file v8-profiler.h.

◆ tos

void* tos

Definition at line 108 of file v8-profiler.h.

◆ update_stats

bool update_stats

Definition at line 116 of file v8-profiler.h.


The documentation for this struct was generated from the following file: