v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::internal::compiler::turboshaft::GraphVisitor< typename > Class Template Reference

#include <copying-phase.h>

Inheritance diagram for v8::internal::compiler::turboshaft::GraphVisitor< typename >:
Collaboration diagram for v8::internal::compiler::turboshaft::GraphVisitor< typename >:

Classes

struct  BlockToClone
 

Public Types

using Next = VariableReducer<AfterNext>
 

Public Member Functions

 GraphVisitor ()
 
template<bool trace_reduction>
void VisitGraph ()
 
void Bind (Block *block)
 
void Finalize ()
 
const Blockcurrent_input_block ()
 
boolturn_loop_without_backedge_into_merge ()
 
void CloneBlockAndGoto (const Block *input_block)
 
void CloneAndInlineBlock (const Block *input_block)
 
bool InlineOp (OpIndex index, const Block *input_block)
 
template<bool can_be_invalid = false>
OpIndex MapToNewGraph (OpIndex old_index, int predecessor_index=-1)
 
template<bool can_be_invalid = false, typename T >
V< TMapToNewGraph (V< T > old_index, int predecessor_index=-1)
 
BlockMapToNewGraph (const Block *block) const
 
template<typename FunctionType >
OpIndex ResolvePhi (const PhiOp &op, FunctionType &&map, RegisterRepresentation rep)
 
const BlockOriginForBlockStart (Block *block) const
 
template<class Set >
BlockCloneSubGraph (Set sub_graph, bool keep_loop_kinds, bool is_loop_after_peeling=false)
 
template<bool can_be_invalid = false>
OptionalOpIndex MapToNewGraph (OptionalOpIndex old_index, int predecessor_index=-1)
 
template<size_t expected_size>
base::SmallVector< OpIndex, expected_size > MapToNewGraph (base::Vector< const OpIndex > inputs)
 
- Public Member Functions inherited from v8::internal::compiler::turboshaft::VariableReducer< AfterNext >
void Bind (Block *new_block)
 
void RestoreTemporaryVariableSnapshotAfter (const Block *block)
 
void CloseTemporaryVariableSnapshot ()
 
V< None > REDUCE Goto (Block *destination, bool is_backedge)
 
OpIndex GetVariable (Variable var)
 
OpIndex GetPredecessorValue (Variable var, int predecessor_index)
 
void SetVariable (Variable var, OpIndex new_index)
 
template<typename Rep >
void Set (Variable var, V< Rep > value)
 
Variable NewLoopInvariantVariable (MaybeRegisterRepresentation rep)
 
Variable NewVariable (MaybeRegisterRepresentation rep)
 
void SealAndSaveVariableSnapshot ()
 
- Public Member Functions inherited from v8::internal::compiler::turboshaft::RequiredOptimizationReducer< AfterNext >
OpIndex REDUCE Phi (base::Vector< const OpIndex > inputs, RegisterRepresentation rep)
 

Private Types

enum class  CanHavePhis { kNo , kYes }
 
enum class  ForCloning { kNo , kYes }
 

Private Member Functions

template<bool trace_reduction>
void VisitAllBlocks ()
 
template<bool trace_reduction>
void VisitBlock (const Block *input_block)
 
template<CanHavePhis can_have_phis, ForCloning for_cloning, bool trace_reduction>
void VisitBlockBody (const Block *input_block, int added_block_phi_input=-1)
 
template<bool trace_reduction>
bool VisitOpAndUpdateMapping (OpIndex index, const Block *input_block)
 
template<bool trace_reduction>
OpIndex VisitOpNoMappingUpdate (OpIndex index, const Block *input_block)
 
template<bool trace_reduction>
void VisitBlockTerminator (const Operation &terminator, const Block *input_block)
 
template<bool trace_reduction>
void ProcessWaitingCloningAndInlining ()
 
template<bool trace_reduction>
void InlineWaitingBlock ()
 
template<bool trace_reduction>
void DoCloneBlock (const Block *input_block, int added_block_phi_input, Block *output_block)
 
void TraceReductionStart (OpIndex index)
 
void TraceOperationSkipped ()
 
void TraceBlockUnreachable ()
 
void TraceReductionResult (Block *current_block, OpIndex first_output_index, OpIndex new_index)
 
void TraceBlockFinished ()
 
V8_INLINE OpIndex AssembleOutputGraphGoto (const GotoOp &op)
 
V8_INLINE OpIndex AssembleOutputGraphBranch (const BranchOp &op)
 
OpIndex AssembleOutputGraphSwitch (const SwitchOp &op)
 
OpIndex AssembleOutputGraphPhi (const PhiOp &op)
 
OpIndex AssembleOutputGraphPendingLoopPhi (const PendingLoopPhiOp &op)
 
V8_INLINE OpIndex AssembleOutputGraphFrameState (const FrameStateOp &op)
 
OpIndex AssembleOutputGraphCall (const CallOp &op)
 
OpIndex AssembleOutputGraphDidntThrow (const DidntThrowOp &op)
 
V< NoneAssembleOutputGraphCheckException (const CheckExceptionOp &op)
 
OpIndex AssembleOutputGraphParameter (const ParameterOp &param)
 
void CreateOldToNewMapping (OpIndex old_index, OpIndex new_index)
 
MaybeVariable GetVariableFor (OpIndex old_index) const
 
void SetVariableFor (OpIndex old_index, MaybeVariable var)
 
void FixLoopPhis (Block *input_graph_loop)
 

Private Attributes

Graphinput_graph_
 
OptimizedCompilationInfoinfo_ = Asm().data()->info()
 
TickCounter *const tick_counter_ = info_ ? &info_->tick_counter() : nullptr
 
const Blockcurrent_input_block_
 
FixedOpIndexSidetable< OpIndexop_mapping_
 
FixedBlockSidetable< Block * > block_mapping_
 
bool current_block_needs_variables_ = false
 
bool turn_loop_without_backedge_into_merge_ = true
 
BitVector blocks_needing_variables_
 
FixedOpIndexSidetable< MaybeVariableold_opindex_to_variables
 
Blockblock_to_inline_now_ = nullptr
 
ZoneVector< BlockToCloneblocks_to_clone_
 

Friends

template<typename N >
class ReducerBaseForwarder
 
template<typename N >
class WasmRevecReducer
 

Detailed Description

template<typename>
class v8::internal::compiler::turboshaft::GraphVisitor< typename >

Definition at line 74 of file machine-optimization-reducer.h.

Member Typedef Documentation

◆ Next

template<typename >
using v8::internal::compiler::turboshaft::GraphVisitor< typename >::Next = VariableReducer<AfterNext>

Definition at line 95 of file copying-phase.h.

Member Enumeration Documentation

◆ CanHavePhis

template<typename >
enum class v8::internal::compiler::turboshaft::GraphVisitor::CanHavePhis
strongprivate
Enumerator
kNo 
kYes 

Definition at line 538 of file copying-phase.h.

◆ ForCloning

template<typename >
enum class v8::internal::compiler::turboshaft::GraphVisitor::ForCloning
strongprivate
Enumerator
kNo 
kYes 

Definition at line 539 of file copying-phase.h.

Constructor & Destructor Documentation

◆ GraphVisitor()

template<typename >
v8::internal::compiler::turboshaft::GraphVisitor< typename >::GraphVisitor ( )
inline

Definition at line 98 of file copying-phase.h.

Member Function Documentation

◆ AssembleOutputGraphBranch()

template<typename >
V8_INLINE OpIndex v8::internal::compiler::turboshaft::GraphVisitor< typename >::AssembleOutputGraphBranch ( const BranchOp & op)
inlineprivate

Definition at line 832 of file copying-phase.h.

Here is the call graph for this function:

◆ AssembleOutputGraphCall()

template<typename >
OpIndex v8::internal::compiler::turboshaft::GraphVisitor< typename >::AssembleOutputGraphCall ( const CallOp & op)
inlineprivate

Definition at line 863 of file copying-phase.h.

Here is the call graph for this function:

◆ AssembleOutputGraphCheckException()

template<typename >
V< None > v8::internal::compiler::turboshaft::GraphVisitor< typename >::AssembleOutputGraphCheckException ( const CheckExceptionOp & op)
inlineprivate

Definition at line 888 of file copying-phase.h.

Here is the call graph for this function:

◆ AssembleOutputGraphDidntThrow()

template<typename >
OpIndex v8::internal::compiler::turboshaft::GraphVisitor< typename >::AssembleOutputGraphDidntThrow ( const DidntThrowOp & op)
inlineprivate

Definition at line 870 of file copying-phase.h.

Here is the call graph for this function:

◆ AssembleOutputGraphFrameState()

template<typename >
V8_INLINE OpIndex v8::internal::compiler::turboshaft::GraphVisitor< typename >::AssembleOutputGraphFrameState ( const FrameStateOp & op)
inlineprivate

Definition at line 859 of file copying-phase.h.

Here is the call graph for this function:

◆ AssembleOutputGraphGoto()

template<typename >
V8_INLINE OpIndex v8::internal::compiler::turboshaft::GraphVisitor< typename >::AssembleOutputGraphGoto ( const GotoOp & op)
inlineprivate

Definition at line 818 of file copying-phase.h.

Here is the call graph for this function:

◆ AssembleOutputGraphParameter()

template<typename >
OpIndex v8::internal::compiler::turboshaft::GraphVisitor< typename >::AssembleOutputGraphParameter ( const ParameterOp & param)
inlineprivate

Definition at line 919 of file copying-phase.h.

◆ AssembleOutputGraphPendingLoopPhi()

template<typename >
OpIndex v8::internal::compiler::turboshaft::GraphVisitor< typename >::AssembleOutputGraphPendingLoopPhi ( const PendingLoopPhiOp & op)
inlineprivate

Definition at line 856 of file copying-phase.h.

Here is the call graph for this function:

◆ AssembleOutputGraphPhi()

template<typename >
OpIndex v8::internal::compiler::turboshaft::GraphVisitor< typename >::AssembleOutputGraphPhi ( const PhiOp & op)
inlineprivate

Definition at line 848 of file copying-phase.h.

Here is the call graph for this function:

◆ AssembleOutputGraphSwitch()

template<typename >
OpIndex v8::internal::compiler::turboshaft::GraphVisitor< typename >::AssembleOutputGraphSwitch ( const SwitchOp & op)
inlineprivate

Definition at line 838 of file copying-phase.h.

Here is the call graph for this function:

◆ Bind()

template<typename >
void v8::internal::compiler::turboshaft::GraphVisitor< typename >::Bind ( Block * block)
inline

Definition at line 132 of file copying-phase.h.

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

◆ CloneAndInlineBlock()

template<typename >
void v8::internal::compiler::turboshaft::GraphVisitor< typename >::CloneAndInlineBlock ( const Block * input_block)
inline

Definition at line 200 of file copying-phase.h.

Here is the call graph for this function:

◆ CloneBlockAndGoto()

template<typename >
void v8::internal::compiler::turboshaft::GraphVisitor< typename >::CloneBlockAndGoto ( const Block * input_block)
inline

Definition at line 173 of file copying-phase.h.

Here is the call graph for this function:

◆ CloneSubGraph()

template<typename >
template<class Set >
Block * v8::internal::compiler::turboshaft::GraphVisitor< typename >::CloneSubGraph ( Set sub_graph,
bool keep_loop_kinds,
bool is_loop_after_peeling = false )
inline

Definition at line 412 of file copying-phase.h.

Here is the call graph for this function:

◆ CreateOldToNewMapping()

template<typename >
void v8::internal::compiler::turboshaft::GraphVisitor< typename >::CreateOldToNewMapping ( OpIndex old_index,
OpIndex new_index )
inlineprivate

Definition at line 925 of file copying-phase.h.

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

◆ current_input_block()

template<typename >
const Block * v8::internal::compiler::turboshaft::GraphVisitor< typename >::current_input_block ( )
inline

Definition at line 161 of file copying-phase.h.

Here is the caller graph for this function:

◆ DoCloneBlock()

template<typename >
template<bool trace_reduction>
void v8::internal::compiler::turboshaft::GraphVisitor< typename >::DoCloneBlock ( const Block * input_block,
int added_block_phi_input,
Block * output_block )
inlineprivate

Definition at line 753 of file copying-phase.h.

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

◆ Finalize()

template<typename >
void v8::internal::compiler::turboshaft::GraphVisitor< typename >::Finalize ( )
inline

Definition at line 137 of file copying-phase.h.

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

◆ FixLoopPhis()

template<typename >
void v8::internal::compiler::turboshaft::GraphVisitor< typename >::FixLoopPhis ( Block * input_graph_loop)
inlineprivate

Definition at line 959 of file copying-phase.h.

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

◆ GetVariableFor()

template<typename >
MaybeVariable v8::internal::compiler::turboshaft::GraphVisitor< typename >::GetVariableFor ( OpIndex old_index) const
inlineprivate

Definition at line 950 of file copying-phase.h.

Here is the caller graph for this function:

◆ InlineOp()

template<typename >
bool v8::internal::compiler::turboshaft::GraphVisitor< typename >::InlineOp ( OpIndex index,
const Block * input_block )
inline

Definition at line 233 of file copying-phase.h.

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

◆ InlineWaitingBlock()

template<typename >
template<bool trace_reduction>
void v8::internal::compiler::turboshaft::GraphVisitor< typename >::InlineWaitingBlock ( )
inlineprivate

Definition at line 739 of file copying-phase.h.

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

◆ MapToNewGraph() [1/5]

template<typename >
template<size_t expected_size>
base::SmallVector< OpIndex, expected_size > v8::internal::compiler::turboshaft::GraphVisitor< typename >::MapToNewGraph ( base::Vector< const OpIndex > inputs)
inline

Definition at line 472 of file copying-phase.h.

Here is the call graph for this function:

◆ MapToNewGraph() [2/5]

template<typename >
Block * v8::internal::compiler::turboshaft::GraphVisitor< typename >::MapToNewGraph ( const Block * block) const
inline

Definition at line 269 of file copying-phase.h.

◆ MapToNewGraph() [3/5]

template<typename >
template<bool can_be_invalid = false>
OpIndex v8::internal::compiler::turboshaft::GraphVisitor< typename >::MapToNewGraph ( OpIndex old_index,
int predecessor_index = -1 )
inline

Definition at line 238 of file copying-phase.h.

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

◆ MapToNewGraph() [4/5]

template<typename >
template<bool can_be_invalid = false>
OptionalOpIndex v8::internal::compiler::turboshaft::GraphVisitor< typename >::MapToNewGraph ( OptionalOpIndex old_index,
int predecessor_index = -1 )
inline

Definition at line 465 of file copying-phase.h.

Here is the call graph for this function:

◆ MapToNewGraph() [5/5]

template<typename >
template<bool can_be_invalid = false, typename T >
V< T > v8::internal::compiler::turboshaft::GraphVisitor< typename >::MapToNewGraph ( V< T > old_index,
int predecessor_index = -1 )
inline

Definition at line 264 of file copying-phase.h.

Here is the call graph for this function:

◆ OriginForBlockStart()

template<typename >
const Block * v8::internal::compiler::turboshaft::GraphVisitor< typename >::OriginForBlockStart ( Block * block) const
inline

Definition at line 398 of file copying-phase.h.

Here is the call graph for this function:

◆ ProcessWaitingCloningAndInlining()

template<typename >
template<bool trace_reduction>
void v8::internal::compiler::turboshaft::GraphVisitor< typename >::ProcessWaitingCloningAndInlining ( )
inlineprivate

Definition at line 727 of file copying-phase.h.

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

◆ ResolvePhi()

template<typename >
template<typename FunctionType >
OpIndex v8::internal::compiler::turboshaft::GraphVisitor< typename >::ResolvePhi ( const PhiOp & op,
FunctionType && map,
RegisterRepresentation rep )
inline

Definition at line 276 of file copying-phase.h.

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

◆ SetVariableFor()

template<typename >
void v8::internal::compiler::turboshaft::GraphVisitor< typename >::SetVariableFor ( OpIndex old_index,
MaybeVariable var )
inlineprivate

Definition at line 954 of file copying-phase.h.

Here is the caller graph for this function:

◆ TraceBlockFinished()

template<typename >
void v8::internal::compiler::turboshaft::GraphVisitor< typename >::TraceBlockFinished ( )
inlineprivate

Definition at line 813 of file copying-phase.h.

Here is the caller graph for this function:

◆ TraceBlockUnreachable()

template<typename >
void v8::internal::compiler::turboshaft::GraphVisitor< typename >::TraceBlockUnreachable ( )
inlineprivate

Definition at line 780 of file copying-phase.h.

Here is the caller graph for this function:

◆ TraceOperationSkipped()

template<typename >
void v8::internal::compiler::turboshaft::GraphVisitor< typename >::TraceOperationSkipped ( )
inlineprivate

Definition at line 779 of file copying-phase.h.

Here is the caller graph for this function:

◆ TraceReductionResult()

template<typename >
void v8::internal::compiler::turboshaft::GraphVisitor< typename >::TraceReductionResult ( Block * current_block,
OpIndex first_output_index,
OpIndex new_index )
inlineprivate

Definition at line 781 of file copying-phase.h.

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

◆ TraceReductionStart()

template<typename >
void v8::internal::compiler::turboshaft::GraphVisitor< typename >::TraceReductionStart ( OpIndex index)
inlineprivate

Definition at line 773 of file copying-phase.h.

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

◆ turn_loop_without_backedge_into_merge()

template<typename >
bool * v8::internal::compiler::turboshaft::GraphVisitor< typename >::turn_loop_without_backedge_into_merge ( )
inline

Definition at line 163 of file copying-phase.h.

◆ VisitAllBlocks()

template<typename >
template<bool trace_reduction>
void v8::internal::compiler::turboshaft::GraphVisitor< typename >::VisitAllBlocks ( )
inlineprivate

Definition at line 483 of file copying-phase.h.

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

◆ VisitBlock()

template<typename >
template<bool trace_reduction>
void v8::internal::compiler::turboshaft::GraphVisitor< typename >::VisitBlock ( const Block * input_block)
inlineprivate

Definition at line 501 of file copying-phase.h.

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

◆ VisitBlockBody()

template<typename >
template<CanHavePhis can_have_phis, ForCloning for_cloning, bool trace_reduction>
void v8::internal::compiler::turboshaft::GraphVisitor< typename >::VisitBlockBody ( const Block * input_block,
int added_block_phi_input = -1 )
inlineprivate

Definition at line 543 of file copying-phase.h.

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

◆ VisitBlockTerminator()

template<typename >
template<bool trace_reduction>
void v8::internal::compiler::turboshaft::GraphVisitor< typename >::VisitBlockTerminator ( const Operation & terminator,
const Block * input_block )
inlineprivate

Definition at line 711 of file copying-phase.h.

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

◆ VisitGraph()

template<typename >
template<bool trace_reduction>
void v8::internal::compiler::turboshaft::GraphVisitor< typename >::VisitGraph ( )
inline

Definition at line 116 of file copying-phase.h.

Here is the call graph for this function:

◆ VisitOpAndUpdateMapping()

template<typename >
template<bool trace_reduction>
bool v8::internal::compiler::turboshaft::GraphVisitor< typename >::VisitOpAndUpdateMapping ( OpIndex index,
const Block * input_block )
inlineprivate

Definition at line 644 of file copying-phase.h.

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

◆ VisitOpNoMappingUpdate()

template<typename >
template<bool trace_reduction>
OpIndex v8::internal::compiler::turboshaft::GraphVisitor< typename >::VisitOpNoMappingUpdate ( OpIndex index,
const Block * input_block )
inlineprivate

Definition at line 656 of file copying-phase.h.

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

Friends And Related Symbol Documentation

◆ ReducerBaseForwarder

template<typename >
template<typename N >
friend class ReducerBaseForwarder
friend

Definition at line 90 of file copying-phase.h.

◆ WasmRevecReducer

template<typename >
template<typename N >
friend class WasmRevecReducer
friend

Definition at line 92 of file copying-phase.h.

Member Data Documentation

◆ block_mapping_

template<typename >
FixedBlockSidetable<Block*> v8::internal::compiler::turboshaft::GraphVisitor< typename >::block_mapping_
private

Definition at line 990 of file copying-phase.h.

◆ block_to_inline_now_

template<typename >
Block* v8::internal::compiler::turboshaft::GraphVisitor< typename >::block_to_inline_now_ = nullptr
private

Definition at line 1016 of file copying-phase.h.

◆ blocks_needing_variables_

template<typename >
BitVector v8::internal::compiler::turboshaft::GraphVisitor< typename >::blocks_needing_variables_
private

Definition at line 1005 of file copying-phase.h.

◆ blocks_to_clone_

template<typename >
ZoneVector<BlockToClone> v8::internal::compiler::turboshaft::GraphVisitor< typename >::blocks_to_clone_
private

Definition at line 1030 of file copying-phase.h.

◆ current_block_needs_variables_

template<typename >
bool v8::internal::compiler::turboshaft::GraphVisitor< typename >::current_block_needs_variables_ = false
private

Definition at line 995 of file copying-phase.h.

◆ current_input_block_

template<typename >
const Block* v8::internal::compiler::turboshaft::GraphVisitor< typename >::current_input_block_
private

Definition at line 984 of file copying-phase.h.

◆ info_

template<typename >
OptimizedCompilationInfo* v8::internal::compiler::turboshaft::GraphVisitor< typename >::info_ = Asm().data()->info()
private

Definition at line 981 of file copying-phase.h.

◆ input_graph_

template<typename >
Graph& v8::internal::compiler::turboshaft::GraphVisitor< typename >::input_graph_
private

Definition at line 980 of file copying-phase.h.

◆ old_opindex_to_variables

template<typename >
FixedOpIndexSidetable<MaybeVariable> v8::internal::compiler::turboshaft::GraphVisitor< typename >::old_opindex_to_variables
private

Definition at line 1008 of file copying-phase.h.

◆ op_mapping_

template<typename >
FixedOpIndexSidetable<OpIndex> v8::internal::compiler::turboshaft::GraphVisitor< typename >::op_mapping_
private

Definition at line 987 of file copying-phase.h.

◆ tick_counter_

template<typename >
TickCounter* const v8::internal::compiler::turboshaft::GraphVisitor< typename >::tick_counter_ = info_ ? &info_->tick_counter() : nullptr
private

Definition at line 982 of file copying-phase.h.

◆ turn_loop_without_backedge_into_merge_

template<typename >
bool v8::internal::compiler::turboshaft::GraphVisitor< typename >::turn_loop_without_backedge_into_merge_ = true
private

Definition at line 1001 of file copying-phase.h.


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