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

#include <maglev-phi-representation-selector.h>

Collaboration diagram for v8::internal::maglev::MaglevPhiRepresentationSelector:

Public Types

enum  ProcessPhiResult { kNone , kRetryOnChange , kChanged }
 

Public Member Functions

 MaglevPhiRepresentationSelector (MaglevGraphBuilder *builder)
 
void PreProcessGraph (Graph *graph)
 
void PostProcessGraph (Graph *graph)
 
BlockProcessResult PreProcessBasicBlock (BasicBlock *block)
 
void PostProcessBasicBlock (BasicBlock *block)
 
void PostPhiProcessing ()
 
ProcessPhiResult ProcessPhi (Phi *node)
 
ProcessResult Process (Phi *node, const ProcessingState &)
 
ProcessResult Process (JumpLoop *node, const ProcessingState &)
 
ProcessResult Process (Dead *node, const ProcessingState &)
 
template<class NodeT >
ProcessResult Process (NodeT *node, const ProcessingState &state)
 

Private Types

enum class  HoistType : uint8_t { kNone , kLoopEntry , kLoopEntryUnchecked , kPrologue }
 
enum class  NewNodePosition { kBeginingOfCurrentBlock , kEndOfBlock }
 
template<class Value >
using SnapshotTable = compiler::turboshaft::SnapshotTable<Value>
 
using Key = SnapshotTable<ValueNode*>::Key
 
using Snapshot = SnapshotTable<ValueNode*>::Snapshot
 
using HoistTypeList = base::SmallVector<HoistType, 8>
 

Private Member Functions

void ConvertTaggedPhiTo (Phi *phi, ValueRepresentation repr, const HoistTypeList &hoist_untagging)
 
template<class NodeT >
ValueNodeGetReplacementForPhiInputConversion (ValueNode *conversion_node, Phi *phi, uint32_t input_index)
 
template<class NodeT >
ProcessResult UpdateNodeInputs (NodeT *n, const ProcessingState *state)
 
template<class NodeT >
ProcessResult UpdateNonUntaggingNodeInputs (NodeT *n, const ProcessingState *state)
 
ProcessResult UpdateNodePhiInput (CheckSmi *node, Phi *phi, int input_index, const ProcessingState *state)
 
ProcessResult UpdateNodePhiInput (CheckNumber *node, Phi *phi, int input_index, const ProcessingState *state)
 
ProcessResult UpdateNodePhiInput (StoreTaggedFieldNoWriteBarrier *node, Phi *phi, int input_index, const ProcessingState *state)
 
ProcessResult UpdateNodePhiInput (StoreFixedArrayElementNoWriteBarrier *node, Phi *phi, int input_index, const ProcessingState *state)
 
ProcessResult UpdateNodePhiInput (BranchIfToBooleanTrue *node, Phi *phi, int input_index, const ProcessingState *state)
 
ProcessResult UpdateNodePhiInput (NodeBase *node, Phi *phi, int input_index, const ProcessingState *state)
 
void EnsurePhiInputsTagged (Phi *phi)
 
bool IsUntagging (Opcode op)
 
void UpdateUntaggingOfPhi (Phi *phi, ValueNode *old_untagging)
 
ValueNodeEnsurePhiTagged (Phi *phi, BasicBlock *block, NewNodePosition pos, const ProcessingState *state, std::optional< int > predecessor_index=std::nullopt)
 
ValueNodeAddNodeAtBlockEnd (ValueNode *new_node, BasicBlock *block, DeoptFrame *deopt_frame=nullptr)
 
ValueNodeAddNode (ValueNode *node, BasicBlock *block, NewNodePosition pos, const ProcessingState *state, DeoptFrame *deopt_frame=nullptr)
 
void RegisterNewNode (ValueNode *node)
 
void FixLoopPhisBackedge (BasicBlock *block)
 
void PreparePhiTaggings (BasicBlock *old_block, const BasicBlock *new_block)
 
MaglevGraphLabellergraph_labeller () const
 
bool CanHoistUntaggingTo (BasicBlock *block)
 

Private Attributes

MaglevGraphBuilderbuilder_ = nullptr
 
BasicBlockcurrent_block_ = nullptr
 
SnapshotTable< ValueNode * > phi_taggings_
 
ZoneVector< Snapshotpredecessors_
 
ZoneVector< Node * > new_nodes_at_start_
 
absl::flat_hash_map< BasicBlock::Id, Snapshotsnapshots_
 

Detailed Description

Definition at line 22 of file maglev-phi-representation-selector.h.

Member Typedef Documentation

◆ HoistTypeList

◆ Key

◆ Snapshot

◆ SnapshotTable

Member Enumeration Documentation

◆ HoistType

Enumerator
kNone 
kLoopEntry 
kLoopEntryUnchecked 
kPrologue 

Definition at line 73 of file maglev-phi-representation-selector.h.

◆ NewNodePosition

Enumerator
kBeginingOfCurrentBlock 
kEndOfBlock 

Definition at line 172 of file maglev-phi-representation-selector.h.

◆ ProcessPhiResult

Enumerator
kNone 
kRetryOnChange 
kChanged 

Definition at line 49 of file maglev-phi-representation-selector.h.

Constructor & Destructor Documentation

◆ MaglevPhiRepresentationSelector()

v8::internal::maglev::MaglevPhiRepresentationSelector::MaglevPhiRepresentationSelector ( MaglevGraphBuilder * builder)
inlineexplicit

Definition at line 29 of file maglev-phi-representation-selector.h.

Member Function Documentation

◆ AddNode()

ValueNode * v8::internal::maglev::MaglevPhiRepresentationSelector::AddNode ( ValueNode * node,
BasicBlock * block,
NewNodePosition pos,
const ProcessingState * state,
DeoptFrame * deopt_frame = nullptr )
private

Definition at line 1112 of file maglev-phi-representation-selector.cc.

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

◆ AddNodeAtBlockEnd()

ValueNode * v8::internal::maglev::MaglevPhiRepresentationSelector::AddNodeAtBlockEnd ( ValueNode * new_node,
BasicBlock * block,
DeoptFrame * deopt_frame = nullptr )
private

Definition at line 1106 of file maglev-phi-representation-selector.cc.

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

◆ CanHoistUntaggingTo()

bool v8::internal::maglev::MaglevPhiRepresentationSelector::CanHoistUntaggingTo ( BasicBlock * block)
private

Definition at line 70 of file maglev-phi-representation-selector.cc.

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

◆ ConvertTaggedPhiTo()

void v8::internal::maglev::MaglevPhiRepresentationSelector::ConvertTaggedPhiTo ( Phi * phi,
ValueRepresentation repr,
const HoistTypeList & hoist_untagging )
private

Definition at line 444 of file maglev-phi-representation-selector.cc.

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

◆ EnsurePhiInputsTagged()

void v8::internal::maglev::MaglevPhiRepresentationSelector::EnsurePhiInputsTagged ( Phi * phi)
private

Definition at line 338 of file maglev-phi-representation-selector.cc.

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

◆ EnsurePhiTagged()

ValueNode * v8::internal::maglev::MaglevPhiRepresentationSelector::EnsurePhiTagged ( Phi * phi,
BasicBlock * block,
NewNodePosition pos,
const ProcessingState * state,
std::optional< int > predecessor_index = std::nullopt )
private

Definition at line 981 of file maglev-phi-representation-selector.cc.

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

◆ FixLoopPhisBackedge()

void v8::internal::maglev::MaglevPhiRepresentationSelector::FixLoopPhisBackedge ( BasicBlock * block)
private

Definition at line 1060 of file maglev-phi-representation-selector.cc.

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

◆ GetReplacementForPhiInputConversion()

template<class NodeT >
ValueNode * v8::internal::maglev::MaglevPhiRepresentationSelector::GetReplacementForPhiInputConversion ( ValueNode * conversion_node,
Phi * phi,
uint32_t input_index )
private

Definition at line 697 of file maglev-phi-representation-selector.cc.

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

◆ graph_labeller()

MaglevGraphLabeller * v8::internal::maglev::MaglevPhiRepresentationSelector::graph_labeller ( ) const
inlineprivate

Definition at line 201 of file maglev-phi-representation-selector.h.

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

◆ IsUntagging()

bool v8::internal::maglev::MaglevPhiRepresentationSelector::IsUntagging ( Opcode op)
private

Definition at line 706 of file maglev-phi-representation-selector.cc.

Here is the caller graph for this function:

◆ PostPhiProcessing()

void v8::internal::maglev::MaglevPhiRepresentationSelector::PostPhiProcessing ( )
inline

Definition at line 47 of file maglev-phi-representation-selector.h.

◆ PostProcessBasicBlock()

void v8::internal::maglev::MaglevPhiRepresentationSelector::PostProcessBasicBlock ( BasicBlock * block)

Definition at line 852 of file maglev-phi-representation-selector.cc.

Here is the call graph for this function:

◆ PostProcessGraph()

void v8::internal::maglev::MaglevPhiRepresentationSelector::PostProcessGraph ( Graph * graph)
inline

Definition at line 40 of file maglev-phi-representation-selector.h.

◆ PreparePhiTaggings()

void v8::internal::maglev::MaglevPhiRepresentationSelector::PreparePhiTaggings ( BasicBlock * old_block,
const BasicBlock * new_block )
private

Definition at line 1144 of file maglev-phi-representation-selector.cc.

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

◆ PreProcessBasicBlock()

BlockProcessResult v8::internal::maglev::MaglevPhiRepresentationSelector::PreProcessBasicBlock ( BasicBlock * block)

Definition at line 30 of file maglev-phi-representation-selector.cc.

Here is the call graph for this function:

◆ PreProcessGraph()

void v8::internal::maglev::MaglevPhiRepresentationSelector::PreProcessGraph ( Graph * graph)
inline

Definition at line 35 of file maglev-phi-representation-selector.h.

◆ Process() [1/4]

ProcessResult v8::internal::maglev::MaglevPhiRepresentationSelector::Process ( Dead * node,
const ProcessingState &  )
inline

Definition at line 63 of file maglev-phi-representation-selector.h.

◆ Process() [2/4]

ProcessResult v8::internal::maglev::MaglevPhiRepresentationSelector::Process ( JumpLoop * node,
const ProcessingState &  )
inline

Definition at line 58 of file maglev-phi-representation-selector.h.

Here is the call graph for this function:

◆ Process() [3/4]

template<class NodeT >
ProcessResult v8::internal::maglev::MaglevPhiRepresentationSelector::Process ( NodeT * node,
const ProcessingState & state )
inline

Definition at line 68 of file maglev-phi-representation-selector.h.

Here is the call graph for this function:

◆ Process() [4/4]

ProcessResult v8::internal::maglev::MaglevPhiRepresentationSelector::Process ( Phi * node,
const ProcessingState &  )
inline

Definition at line 54 of file maglev-phi-representation-selector.h.

◆ ProcessPhi()

MaglevPhiRepresentationSelector::ProcessPhiResult v8::internal::maglev::MaglevPhiRepresentationSelector::ProcessPhi ( Phi * node)

Definition at line 79 of file maglev-phi-representation-selector.cc.

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

◆ RegisterNewNode()

void v8::internal::maglev::MaglevPhiRepresentationSelector::RegisterNewNode ( ValueNode * node)
private

Definition at line 1135 of file maglev-phi-representation-selector.cc.

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

◆ UpdateNodeInputs()

template<class NodeT >
ProcessResult v8::internal::maglev::MaglevPhiRepresentationSelector::UpdateNodeInputs ( NodeT * n,
const ProcessingState * state )
inlineprivate

Definition at line 96 of file maglev-phi-representation-selector.h.

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

◆ UpdateNodePhiInput() [1/6]

ProcessResult v8::internal::maglev::MaglevPhiRepresentationSelector::UpdateNodePhiInput ( BranchIfToBooleanTrue * node,
Phi * phi,
int input_index,
const ProcessingState * state )
private

Definition at line 933 of file maglev-phi-representation-selector.cc.

Here is the call graph for this function:

◆ UpdateNodePhiInput() [2/6]

ProcessResult v8::internal::maglev::MaglevPhiRepresentationSelector::UpdateNodePhiInput ( CheckNumber * node,
Phi * phi,
int input_index,
const ProcessingState * state )
private

Definition at line 830 of file maglev-phi-representation-selector.cc.

Here is the call graph for this function:

◆ UpdateNodePhiInput() [3/6]

ProcessResult v8::internal::maglev::MaglevPhiRepresentationSelector::UpdateNodePhiInput ( CheckSmi * node,
Phi * phi,
int input_index,
const ProcessingState * state )
private

Definition at line 803 of file maglev-phi-representation-selector.cc.

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

◆ UpdateNodePhiInput() [4/6]

ProcessResult v8::internal::maglev::MaglevPhiRepresentationSelector::UpdateNodePhiInput ( NodeBase * node,
Phi * phi,
int input_index,
const ProcessingState * state )
private

Definition at line 960 of file maglev-phi-representation-selector.cc.

Here is the call graph for this function:

◆ UpdateNodePhiInput() [5/6]

ProcessResult v8::internal::maglev::MaglevPhiRepresentationSelector::UpdateNodePhiInput ( StoreFixedArrayElementNoWriteBarrier * node,
Phi * phi,
int input_index,
const ProcessingState * state )
private

Definition at line 901 of file maglev-phi-representation-selector.cc.

Here is the call graph for this function:

◆ UpdateNodePhiInput() [6/6]

ProcessResult v8::internal::maglev::MaglevPhiRepresentationSelector::UpdateNodePhiInput ( StoreTaggedFieldNoWriteBarrier * node,
Phi * phi,
int input_index,
const ProcessingState * state )
private

Definition at line 866 of file maglev-phi-representation-selector.cc.

Here is the call graph for this function:

◆ UpdateNonUntaggingNodeInputs()

template<class NodeT >
ProcessResult v8::internal::maglev::MaglevPhiRepresentationSelector::UpdateNonUntaggingNodeInputs ( NodeT * n,
const ProcessingState * state )
inlineprivate

Definition at line 120 of file maglev-phi-representation-selector.h.

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

◆ UpdateUntaggingOfPhi()

void v8::internal::maglev::MaglevPhiRepresentationSelector::UpdateUntaggingOfPhi ( Phi * phi,
ValueNode * old_untagging )
private

Definition at line 723 of file maglev-phi-representation-selector.cc.

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

Member Data Documentation

◆ builder_

MaglevGraphBuilder* v8::internal::maglev::MaglevPhiRepresentationSelector::builder_ = nullptr
private

Definition at line 207 of file maglev-phi-representation-selector.h.

◆ current_block_

BasicBlock* v8::internal::maglev::MaglevPhiRepresentationSelector::current_block_ = nullptr
private

Definition at line 208 of file maglev-phi-representation-selector.h.

◆ new_nodes_at_start_

ZoneVector<Node*> v8::internal::maglev::MaglevPhiRepresentationSelector::new_nodes_at_start_
private

Definition at line 217 of file maglev-phi-representation-selector.h.

◆ phi_taggings_

SnapshotTable<ValueNode*> v8::internal::maglev::MaglevPhiRepresentationSelector::phi_taggings_
private

Definition at line 212 of file maglev-phi-representation-selector.h.

◆ predecessors_

ZoneVector<Snapshot> v8::internal::maglev::MaglevPhiRepresentationSelector::predecessors_
private

Definition at line 215 of file maglev-phi-representation-selector.h.

◆ snapshots_

absl::flat_hash_map<BasicBlock::Id, Snapshot> v8::internal::maglev::MaglevPhiRepresentationSelector::snapshots_
private

Definition at line 219 of file maglev-phi-representation-selector.h.


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