V8 API Reference Guide generated from the header files
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes
v8::TickSample Struct Reference

Public Types

enum  RecordCEntryFrame { kIncludeCEntryFrame, kSkipCEntryFrame }
 

Public Member Functions

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
 

Member Function Documentation

◆ GetStackSample()

static bool v8::TickSample::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 v8::TickSample::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.

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