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

#include <deoptimizer.h>

Inheritance diagram for v8::internal::Deoptimizer:
Collaboration diagram for v8::internal::Deoptimizer:

Classes

struct  DeoptInfo
 
struct  ValueToMaterialize
 

Public Member Functions

DeoptInfo GetDeoptInfo () const
 
DirectHandle< JSFunctionfunction () const
 
DirectHandle< Codecompiled_code () const
 
DeoptimizeKind deopt_kind () const
 
int output_count () const
 
BytecodeOffset bytecode_offset_in_outermost_frame () const
 
 ~Deoptimizer ()
 
void MaterializeHeapObjects ()
 
Isolateisolate () const
 

Static Public Member Functions

static bool DeoptExitIsInsideOsrLoop (Isolate *isolate, Tagged< JSFunction > function, BytecodeOffset deopt_exit_offset, BytecodeOffset osr_offset)
 
static DeoptInfo GetDeoptInfo (Tagged< Code > code, Address from)
 
static const char * MessageFor (DeoptimizeKind kind)
 
static DeoptimizerNew (Address raw_function, DeoptimizeKind kind, Address from, int fp_to_sp_delta, Isolate *isolate)
 
static DeoptimizerGrab (Isolate *isolate)
 
static size_t DeleteForWasm (Isolate *isolate)
 
static DeoptimizedFrameInfoDebuggerInspectableFrame (JavaScriptFrame *frame, int jsframe_index, Isolate *isolate)
 
static void DeoptimizeFunction (Tagged< JSFunction > function, LazyDeoptimizeReason reason, Tagged< Code > code={})
 
static V8_EXPORT_PRIVATE void DeoptimizeAll (Isolate *isolate)
 
static void DeoptimizeMarkedCode (Isolate *isolate)
 
static void DeoptimizeAllOptimizedCodeWithFunction (Isolate *isolate, DirectHandle< SharedFunctionInfo > function)
 
static Address EnsureValidReturnAddress (Isolate *isolate, Address address)
 
static void ComputeOutputFrames (Deoptimizer *deoptimizer)
 
static V8_EXPORT_PRIVATE Builtin GetDeoptimizationEntry (DeoptimizeKind kind)
 
static int input_offset ()
 
static int output_count_offset ()
 
static int output_offset ()
 
static int caller_frame_top_offset ()
 
static void TraceMarkForDeoptimization (Isolate *isolate, Tagged< Code > code, LazyDeoptimizeReason reason)
 
static void TraceEvictFromOptimizedCodeCache (Isolate *isolate, Tagged< SharedFunctionInfo > sfi, const char *reason)
 
static void PatchToJump (Address pc, Address new_pc)
 
- Static Public Member Functions inherited from v8::internal::Malloced
static void * operator new (size_t size)
 
static void operator delete (void *p)
 

Static Public Attributes

static constexpr int kMaxNumberOfEntries = 16384
 
static constexpr unsigned kFixedExitSizeMarker = kMaxUInt32
 
static V8_EXPORT_PRIVATE const int kEagerDeoptExitSize = 2 * kInstrSize
 
static V8_EXPORT_PRIVATE const int kLazyDeoptExitSize = 2 * kInstrSize
 
static V8_EXPORT_PRIVATE const int kAdaptShadowStackOffsetToSubtract = 0
 

Private Member Functions

void QueueValueForMaterialization (Address output_address, Tagged< Object > obj, const TranslatedFrame::iterator &iterator)
 
void QueueFeedbackVectorForMaterialization (Address output_address, const TranslatedFrame::iterator &iterator)
 
 Deoptimizer (Isolate *isolate, Tagged< JSFunction > function, DeoptimizeKind kind, Address from, int fp_to_sp_delta)
 
void DeleteFrameDescriptions ()
 
void DoComputeOutputFrames ()
 
void DoComputeUnoptimizedFrame (TranslatedFrame *translated_frame, int frame_index, bool goto_catch_handler)
 
void DoComputeInlinedExtraArguments (TranslatedFrame *translated_frame, int frame_index)
 
void DoComputeConstructCreateStubFrame (TranslatedFrame *translated_frame, int frame_index)
 
void DoComputeConstructInvokeStubFrame (TranslatedFrame *translated_frame, int frame_index)
 
void DoComputeBuiltinContinuation (TranslatedFrame *translated_frame, int frame_index, BuiltinContinuationMode mode)
 
unsigned ComputeInputFrameAboveFpFixedSize () const
 
unsigned ComputeInputFrameSize () const
 
bool tracing_enabled () const
 
bool verbose_tracing_enabled () const
 
CodeTracer::Scopetrace_scope () const
 
CodeTracer::Scopeverbose_trace_scope () const
 
void TraceDeoptBegin (int optimization_id, BytecodeOffset bytecode_offset)
 
void TraceDeoptEnd (double deopt_duration)
 
bool is_restart_frame () const
 

Static Private Member Functions

static Builtin TrampolineForBuiltinContinuation (BuiltinContinuationMode mode, bool must_handle_result)
 
static unsigned ComputeIncomingArgumentSize (Tagged< Code > code)
 
static void TraceDeoptAll (Isolate *isolate)
 

Private Attributes

Isolateisolate_
 
Tagged< JSFunctionfunction_
 
Tagged< Codecompiled_code_
 
unsigned deopt_exit_index_
 
BytecodeOffset bytecode_offset_in_outermost_frame_ = BytecodeOffset::None()
 
DeoptimizeKind deopt_kind_
 
Address from_
 
int fp_to_sp_delta_
 
bool deoptimizing_throw_
 
int catch_handler_data_
 
int catch_handler_pc_offset_
 
int restart_frame_index_
 
FrameDescriptioninput_
 
int output_count_
 
FrameDescription ** output_
 
intptr_t caller_frame_top_
 
intptr_t caller_fp_
 
intptr_t caller_pc_
 
intptr_t caller_constant_pool_
 
int actual_argument_count_
 
intptr_t stack_fp_
 
TranslatedState translated_state_
 
std::vector< ValueToMaterializevalues_to_materialize_
 
std::vector< ValueToMaterializefeedback_vector_to_materialize_
 
CodeTracer::Scope *const trace_scope_
 

Friends

class DeoptimizedFrameInfo
 
class FrameDescription
 
class FrameWriter
 

Detailed Description

Definition at line 36 of file deoptimizer.h.

Constructor & Destructor Documentation

◆ ~Deoptimizer()

v8::internal::Deoptimizer::~Deoptimizer ( )

Definition at line 737 of file deoptimizer.cc.

◆ Deoptimizer()

v8::internal::Deoptimizer::Deoptimizer ( Isolate * isolate,
Tagged< JSFunction > function,
DeoptimizeKind kind,
Address from,
int fp_to_sp_delta )
private

Definition at line 584 of file deoptimizer.cc.

Here is the call graph for this function:

Member Function Documentation

◆ bytecode_offset_in_outermost_frame()

BytecodeOffset v8::internal::Deoptimizer::bytecode_offset_in_outermost_frame ( ) const
inline

Definition at line 78 of file deoptimizer.h.

Here is the caller graph for this function:

◆ caller_frame_top_offset()

static int v8::internal::Deoptimizer::caller_frame_top_offset ( )
inlinestatic

Definition at line 140 of file deoptimizer.h.

◆ compiled_code()

DirectHandle< Code > v8::internal::Deoptimizer::compiled_code ( ) const

Definition at line 733 of file deoptimizer.cc.

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

◆ ComputeIncomingArgumentSize()

unsigned v8::internal::Deoptimizer::ComputeIncomingArgumentSize ( Tagged< Code > code)
staticprivate

Definition at line 3031 of file deoptimizer.cc.

Here is the caller graph for this function:

◆ ComputeInputFrameAboveFpFixedSize()

unsigned v8::internal::Deoptimizer::ComputeInputFrameAboveFpFixedSize ( ) const
private

Definition at line 2956 of file deoptimizer.cc.

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

◆ ComputeInputFrameSize()

unsigned v8::internal::Deoptimizer::ComputeInputFrameSize ( ) const
private

Definition at line 2994 of file deoptimizer.cc.

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

◆ ComputeOutputFrames()

void v8::internal::Deoptimizer::ComputeOutputFrames ( Deoptimizer * deoptimizer)
static

Definition at line 571 of file deoptimizer.cc.

Here is the call graph for this function:

◆ DebuggerInspectableFrame()

DeoptimizedFrameInfo * v8::internal::Deoptimizer::DebuggerInspectableFrame ( JavaScriptFrame * frame,
int jsframe_index,
Isolate * isolate )
static

Definition at line 297 of file deoptimizer.cc.

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

◆ DeleteForWasm()

size_t v8::internal::Deoptimizer::DeleteForWasm ( Isolate * isolate)
static

Definition at line 286 of file deoptimizer.cc.

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

◆ DeleteFrameDescriptions()

void v8::internal::Deoptimizer::DeleteFrameDescriptions ( )
private

Definition at line 746 of file deoptimizer.cc.

Here is the caller graph for this function:

◆ deopt_kind()

DeoptimizeKind v8::internal::Deoptimizer::deopt_kind ( ) const
inline

Definition at line 72 of file deoptimizer.h.

Here is the caller graph for this function:

◆ DeoptExitIsInsideOsrLoop()

bool v8::internal::Deoptimizer::DeoptExitIsInsideOsrLoop ( Isolate * isolate,
Tagged< JSFunction > function,
BytecodeOffset deopt_exit_offset,
BytecodeOffset osr_offset )
static

Definition at line 1733 of file deoptimizer.cc.

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

◆ DeoptimizeAll()

void v8::internal::Deoptimizer::DeoptimizeAll ( Isolate * isolate)
static

Definition at line 445 of file deoptimizer.cc.

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

◆ DeoptimizeAllOptimizedCodeWithFunction()

void v8::internal::Deoptimizer::DeoptimizeAllOptimizedCodeWithFunction ( Isolate * isolate,
DirectHandle< SharedFunctionInfo > function )
static

Definition at line 492 of file deoptimizer.cc.

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

◆ DeoptimizeFunction()

void v8::internal::Deoptimizer::DeoptimizeFunction ( Tagged< JSFunction > function,
LazyDeoptimizeReason reason,
Tagged< Code > code = {} )
static

Definition at line 465 of file deoptimizer.cc.

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

◆ DeoptimizeMarkedCode()

void v8::internal::Deoptimizer::DeoptimizeMarkedCode ( Isolate * isolate)
static

Definition at line 396 of file deoptimizer.cc.

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

◆ DoComputeBuiltinContinuation()

void v8::internal::Deoptimizer::DoComputeBuiltinContinuation ( TranslatedFrame * translated_frame,
int frame_index,
BuiltinContinuationMode mode )
private

Definition at line 2585 of file deoptimizer.cc.

Here is the caller graph for this function:

◆ DoComputeConstructCreateStubFrame()

void v8::internal::Deoptimizer::DoComputeConstructCreateStubFrame ( TranslatedFrame * translated_frame,
int frame_index )
private

Definition at line 2159 of file deoptimizer.cc.

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

◆ DoComputeConstructInvokeStubFrame()

void v8::internal::Deoptimizer::DoComputeConstructInvokeStubFrame ( TranslatedFrame * translated_frame,
int frame_index )
private

Definition at line 2312 of file deoptimizer.cc.

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

◆ DoComputeInlinedExtraArguments()

void v8::internal::Deoptimizer::DoComputeInlinedExtraArguments ( TranslatedFrame * translated_frame,
int frame_index )
private

Definition at line 2092 of file deoptimizer.cc.

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

◆ DoComputeOutputFrames()

void v8::internal::Deoptimizer::DoComputeOutputFrames ( )
private

Definition at line 1488 of file deoptimizer.cc.

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

◆ DoComputeUnoptimizedFrame()

void v8::internal::Deoptimizer::DoComputeUnoptimizedFrame ( TranslatedFrame * translated_frame,
int frame_index,
bool goto_catch_handler )
private

Definition at line 1783 of file deoptimizer.cc.

Here is the caller graph for this function:

◆ EnsureValidReturnAddress()

Address v8::internal::Deoptimizer::EnsureValidReturnAddress ( Isolate * isolate,
Address address )
static

Definition at line 538 of file deoptimizer.cc.

Here is the caller graph for this function:

◆ function()

DirectHandle< JSFunction > v8::internal::Deoptimizer::function ( ) const

Definition at line 729 of file deoptimizer.cc.

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

◆ GetDeoptimizationEntry()

Builtin v8::internal::Deoptimizer::GetDeoptimizationEntry ( DeoptimizeKind kind)
static

Definition at line 768 of file deoptimizer.cc.

Here is the caller graph for this function:

◆ GetDeoptInfo() [1/2]

DeoptInfo v8::internal::Deoptimizer::GetDeoptInfo ( ) const
inline

Definition at line 64 of file deoptimizer.h.

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

◆ GetDeoptInfo() [2/2]

Deoptimizer::DeoptInfo v8::internal::Deoptimizer::GetDeoptInfo ( Tagged< Code > code,
Address from )
static

Definition at line 3036 of file deoptimizer.cc.

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

◆ Grab()

Deoptimizer * v8::internal::Deoptimizer::Grab ( Isolate * isolate)
static

Definition at line 280 of file deoptimizer.cc.

Here is the call graph for this function:

◆ input_offset()

static int v8::internal::Deoptimizer::input_offset ( )
inlinestatic

Definition at line 134 of file deoptimizer.h.

◆ is_restart_frame()

bool v8::internal::Deoptimizer::is_restart_frame ( ) const
inlineprivate

Definition at line 248 of file deoptimizer.h.

Here is the caller graph for this function:

◆ isolate()

Isolate * v8::internal::Deoptimizer::isolate ( ) const
inline

Definition at line 154 of file deoptimizer.h.

Here is the caller graph for this function:

◆ MaterializeHeapObjects()

void v8::internal::Deoptimizer::MaterializeHeapObjects ( )

Definition at line 2893 of file deoptimizer.cc.

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

◆ MessageFor()

const char * v8::internal::Deoptimizer::MessageFor ( DeoptimizeKind kind)
static

Definition at line 575 of file deoptimizer.cc.

Here is the caller graph for this function:

◆ New()

Deoptimizer * v8::internal::Deoptimizer::New ( Address raw_function,
DeoptimizeKind kind,
Address from,
int fp_to_sp_delta,
Isolate * isolate )
static

Definition at line 267 of file deoptimizer.cc.

◆ output_count()

int v8::internal::Deoptimizer::output_count ( ) const
inline

Definition at line 73 of file deoptimizer.h.

Here is the caller graph for this function:

◆ output_count_offset()

static int v8::internal::Deoptimizer::output_count_offset ( )
inlinestatic

Definition at line 135 of file deoptimizer.h.

◆ output_offset()

static int v8::internal::Deoptimizer::output_offset ( )
inlinestatic

Definition at line 138 of file deoptimizer.h.

◆ PatchToJump()

void v8::internal::Deoptimizer::PatchToJump ( Address pc,
Address new_pc )
static

Definition at line 27 of file deoptimizer-arm.cc.

Here is the call graph for this function:

◆ QueueFeedbackVectorForMaterialization()

void v8::internal::Deoptimizer::QueueFeedbackVectorForMaterialization ( Address output_address,
const TranslatedFrame::iterator & iterator )
private

Definition at line 2951 of file deoptimizer.cc.

◆ QueueValueForMaterialization()

void v8::internal::Deoptimizer::QueueValueForMaterialization ( Address output_address,
Tagged< Object > obj,
const TranslatedFrame::iterator & iterator )
private

Definition at line 2943 of file deoptimizer.cc.

◆ trace_scope()

CodeTracer::Scope * v8::internal::Deoptimizer::trace_scope ( ) const
inlineprivate

Definition at line 236 of file deoptimizer.h.

Here is the caller graph for this function:

◆ TraceDeoptAll()

void v8::internal::Deoptimizer::TraceDeoptAll ( Isolate * isolate)
staticprivate

Definition at line 907 of file deoptimizer.cc.

Here is the call graph for this function:

◆ TraceDeoptBegin()

void v8::internal::Deoptimizer::TraceDeoptBegin ( int optimization_id,
BytecodeOffset bytecode_offset )
private

Definition at line 803 of file deoptimizer.cc.

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

◆ TraceDeoptEnd()

void v8::internal::Deoptimizer::TraceDeoptEnd ( double deopt_duration)
private

Definition at line 837 of file deoptimizer.cc.

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

◆ TraceEvictFromOptimizedCodeCache()

void v8::internal::Deoptimizer::TraceEvictFromOptimizedCodeCache ( Isolate * isolate,
Tagged< SharedFunctionInfo > sfi,
const char * reason )
static

Definition at line 881 of file deoptimizer.cc.

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

◆ TraceMarkForDeoptimization()

void v8::internal::Deoptimizer::TraceMarkForDeoptimization ( Isolate * isolate,
Tagged< Code > code,
LazyDeoptimizeReason reason )
static

Definition at line 844 of file deoptimizer.cc.

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

◆ tracing_enabled()

bool v8::internal::Deoptimizer::tracing_enabled ( ) const
inlineprivate

Definition at line 232 of file deoptimizer.h.

Here is the caller graph for this function:

◆ TrampolineForBuiltinContinuation()

Builtin v8::internal::Deoptimizer::TrampolineForBuiltinContinuation ( BuiltinContinuationMode mode,
bool must_handle_result )
staticprivate

Definition at line 2474 of file deoptimizer.cc.

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

◆ verbose_trace_scope()

CodeTracer::Scope * v8::internal::Deoptimizer::verbose_trace_scope ( ) const
inlineprivate

Definition at line 237 of file deoptimizer.h.

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

◆ verbose_tracing_enabled()

bool v8::internal::Deoptimizer::verbose_tracing_enabled ( ) const
inlineprivate

Definition at line 233 of file deoptimizer.h.

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

Friends And Related Symbol Documentation

◆ DeoptimizedFrameInfo

friend class DeoptimizedFrameInfo
friend

Definition at line 319 of file deoptimizer.h.

◆ FrameDescription

friend class FrameDescription
friend

Definition at line 320 of file deoptimizer.h.

◆ FrameWriter

friend class FrameWriter
friend

Definition at line 321 of file deoptimizer.h.

Member Data Documentation

◆ actual_argument_count_

int v8::internal::Deoptimizer::actual_argument_count_
private

Definition at line 280 of file deoptimizer.h.

◆ bytecode_offset_in_outermost_frame_

BytecodeOffset v8::internal::Deoptimizer::bytecode_offset_in_outermost_frame_ = BytecodeOffset::None()
private

Definition at line 257 of file deoptimizer.h.

◆ caller_constant_pool_

intptr_t v8::internal::Deoptimizer::caller_constant_pool_
private

Definition at line 277 of file deoptimizer.h.

◆ caller_fp_

intptr_t v8::internal::Deoptimizer::caller_fp_
private

Definition at line 275 of file deoptimizer.h.

◆ caller_frame_top_

intptr_t v8::internal::Deoptimizer::caller_frame_top_
private

Definition at line 274 of file deoptimizer.h.

◆ caller_pc_

intptr_t v8::internal::Deoptimizer::caller_pc_
private

Definition at line 276 of file deoptimizer.h.

◆ catch_handler_data_

int v8::internal::Deoptimizer::catch_handler_data_
private

Definition at line 262 of file deoptimizer.h.

◆ catch_handler_pc_offset_

int v8::internal::Deoptimizer::catch_handler_pc_offset_
private

Definition at line 263 of file deoptimizer.h.

◆ compiled_code_

Tagged<Code> v8::internal::Deoptimizer::compiled_code_
private

Definition at line 252 of file deoptimizer.h.

◆ deopt_exit_index_

unsigned v8::internal::Deoptimizer::deopt_exit_index_
private

Definition at line 256 of file deoptimizer.h.

◆ deopt_kind_

DeoptimizeKind v8::internal::Deoptimizer::deopt_kind_
private

Definition at line 258 of file deoptimizer.h.

◆ deoptimizing_throw_

bool v8::internal::Deoptimizer::deoptimizing_throw_
private

Definition at line 261 of file deoptimizer.h.

◆ feedback_vector_to_materialize_

std::vector<ValueToMaterialize> v8::internal::Deoptimizer::feedback_vector_to_materialize_
private

Definition at line 291 of file deoptimizer.h.

◆ fp_to_sp_delta_

int v8::internal::Deoptimizer::fp_to_sp_delta_
private

Definition at line 260 of file deoptimizer.h.

◆ from_

Address v8::internal::Deoptimizer::from_
private

Definition at line 259 of file deoptimizer.h.

◆ function_

Tagged<JSFunction> v8::internal::Deoptimizer::function_
private

Definition at line 251 of file deoptimizer.h.

◆ input_

FrameDescription* v8::internal::Deoptimizer::input_
private

Definition at line 267 of file deoptimizer.h.

◆ isolate_

Isolate* v8::internal::Deoptimizer::isolate_
private

Definition at line 250 of file deoptimizer.h.

◆ kAdaptShadowStackOffsetToSubtract

const int v8::internal::Deoptimizer::kAdaptShadowStackOffsetToSubtract = 0
static

Definition at line 168 of file deoptimizer.h.

◆ kEagerDeoptExitSize

const int v8::internal::Deoptimizer::kEagerDeoptExitSize = 2 * kInstrSize
static

Definition at line 164 of file deoptimizer.h.

◆ kFixedExitSizeMarker

unsigned v8::internal::Deoptimizer::kFixedExitSizeMarker = kMaxUInt32
staticconstexpr

Definition at line 161 of file deoptimizer.h.

◆ kLazyDeoptExitSize

const int v8::internal::Deoptimizer::kLazyDeoptExitSize = 2 * kInstrSize
static

Definition at line 165 of file deoptimizer.h.

◆ kMaxNumberOfEntries

int v8::internal::Deoptimizer::kMaxNumberOfEntries = 16384
staticconstexpr

Definition at line 156 of file deoptimizer.h.

◆ output_

FrameDescription** v8::internal::Deoptimizer::output_
private

Definition at line 271 of file deoptimizer.h.

◆ output_count_

int v8::internal::Deoptimizer::output_count_
private

Definition at line 269 of file deoptimizer.h.

◆ restart_frame_index_

int v8::internal::Deoptimizer::restart_frame_index_
private

Definition at line 264 of file deoptimizer.h.

◆ stack_fp_

intptr_t v8::internal::Deoptimizer::stack_fp_
private

Definition at line 283 of file deoptimizer.h.

◆ trace_scope_

CodeTracer::Scope* const v8::internal::Deoptimizer::trace_scope_
private

Definition at line 304 of file deoptimizer.h.

◆ translated_state_

TranslatedState v8::internal::Deoptimizer::translated_state_
private

Definition at line 285 of file deoptimizer.h.

◆ values_to_materialize_

std::vector<ValueToMaterialize> v8::internal::Deoptimizer::values_to_materialize_
private

Definition at line 290 of file deoptimizer.h.


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