v8  6.2.414 (node 8.16.2)
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 65 of file v8-profiler.h.

Member Enumeration Documentation

◆ RecordCEntryFrame

Enumerator
kIncludeCEntryFrame 
kSkipCEntryFrame 

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

Constructor & Destructor Documentation

◆ TickSample()

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

◆ 

union { ... }

◆ external_callback_entry

void* external_callback_entry

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

Referenced by TickSample::TickSample().

◆ frames_count

unsigned frames_count

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

Referenced by TickSample::TickSample().

◆ has_external_callback

bool has_external_callback

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

Referenced by TickSample::TickSample().

◆ kMaxFramesCount

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

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

◆ kMaxFramesCountLog2

const unsigned kMaxFramesCountLog2 = 8
static

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

◆ pc

void* pc

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

Referenced by TickSample::TickSample().

◆ stack

void* stack[kMaxFramesCount]

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

◆ state

StateTag state

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

Referenced by TickSample::TickSample().

◆ tos

void* tos

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

◆ update_stats

bool update_stats

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

Referenced by TickSample::TickSample().


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