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

#include <string-builder-optimizer.h>

Collaboration diagram for v8::internal::compiler::StringBuilderOptimizer:

Classes

struct  Status
 
struct  StringBuilder
 

Public Member Functions

 StringBuilderOptimizer (JSGraph *jsgraph, Schedule *schedule, Zone *temp_zone, JSHeapBroker *broker)
 
bool BlockShouldFinalizeStringBuilders (BasicBlock *block)
 
ZoneVector< Node * > GetStringBuildersToFinalize (BasicBlock *block)
 
bool IsStringBuilderEnd (Node *node)
 
bool IsNonLoopPhiStringBuilderEnd (Node *node)
 
bool IsStringBuilderConcatInput (Node *node)
 
bool ConcatIsInStringBuilder (Node *node)
 
bool IsFirstConcatInStringBuilder (Node *node)
 
OneOrTwoByteAnalysis::State GetOneOrTwoByte (Node *node)
 
void Run ()
 
JSGraphjsgraph () const
 
TFGraphgraph () const
 
Scheduleschedule () const
 
Zonetemp_zone () const
 
JSHeapBrokerbroker () const
 

Private Types

enum class  State : uint8_t {
  kUnvisited = 0 , kBeginStringBuilder , kInStringBuilder , kPendingPhi ,
  kConfirmedInStringBuilder , kEndStringBuilder , kEndStringBuilderLoopPhi , kInvalid ,
  kNumberOfState
}
 

Private Member Functions

Status GetStatus (Node *node) const
 
void SetStatus (Node *node, State state, int id=kInvalidId)
 
void UpdateStatus (Node *node, State state)
 
bool IsLoopPhi (Node *node) const
 
bool LoopContains (Node *loop_phi, Node *node)
 
int GetStringBuilderIdForConcat (Node *node)
 
void ReplaceConcatInputIfNeeded (Node *node, int input_idx)
 
bool CheckNodeUses (Node *node, Node *concat_child, Status status)
 
bool CheckPreviousNodeUses (Node *child, Status status, int input_if_loop_phi=0)
 
int GetPhiPredecessorsCommonId (Node *node)
 
void FinalizeStringBuilders ()
 
void VisitNode (Node *node, BasicBlock *block)
 
void VisitGraph ()
 

Private Attributes

const StringBuilder kInvalidStringBuilder
 
JSGraphjsgraph_
 
Scheduleschedule_
 
Zonetemp_zone_
 
JSHeapBrokerbroker_
 
unsigned int string_builder_count_ = 0
 
ZoneVector< std::optional< ZoneVector< Node * > > > blocks_to_trimmings_map_
 
ZoneVector< Statusstatus_
 
ZoneVector< StringBuilderstring_builders_
 
ZoneVector< BasicBlock * > loop_headers_
 

Static Private Attributes

static constexpr int kInvalidId = -1
 
static constexpr bool kAllowAnyStringOnTheRhs = false
 

Detailed Description

Definition at line 214 of file string-builder-optimizer.h.

Member Enumeration Documentation

◆ State

enum class v8::internal::compiler::StringBuilderOptimizer::State : uint8_t
strongprivate
Enumerator
kUnvisited 
kBeginStringBuilder 
kInStringBuilder 
kPendingPhi 
kConfirmedInStringBuilder 
kEndStringBuilder 
kEndStringBuilderLoopPhi 
kInvalid 
kNumberOfState 

Definition at line 268 of file string-builder-optimizer.h.

Constructor & Destructor Documentation

◆ StringBuilderOptimizer()

v8::internal::compiler::StringBuilderOptimizer::StringBuilderOptimizer ( JSGraph * jsgraph,
Schedule * schedule,
Zone * temp_zone,
JSHeapBroker * broker )

Definition at line 1178 of file string-builder-optimizer.cc.

Member Function Documentation

◆ BlockShouldFinalizeStringBuilders()

bool v8::internal::compiler::StringBuilderOptimizer::BlockShouldFinalizeStringBuilders ( BasicBlock * block)

Definition at line 317 of file string-builder-optimizer.cc.

Here is the caller graph for this function:

◆ broker()

JSHeapBroker * v8::internal::compiler::StringBuilderOptimizer::broker ( ) const
inline

Definition at line 265 of file string-builder-optimizer.h.

Here is the caller graph for this function:

◆ CheckNodeUses()

bool v8::internal::compiler::StringBuilderOptimizer::CheckNodeUses ( Node * node,
Node * concat_child,
Status status )
private

Definition at line 638 of file string-builder-optimizer.cc.

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

◆ CheckPreviousNodeUses()

bool v8::internal::compiler::StringBuilderOptimizer::CheckPreviousNodeUses ( Node * child,
Status status,
int input_if_loop_phi = 0 )
private

Definition at line 775 of file string-builder-optimizer.cc.

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

◆ ConcatIsInStringBuilder()

bool v8::internal::compiler::StringBuilderOptimizer::ConcatIsInStringBuilder ( Node * node)

Definition at line 362 of file string-builder-optimizer.cc.

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

◆ FinalizeStringBuilders()

void v8::internal::compiler::StringBuilderOptimizer::FinalizeStringBuilders ( )
private

Definition at line 1016 of file string-builder-optimizer.cc.

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

◆ GetOneOrTwoByte()

OneOrTwoByteAnalysis::State v8::internal::compiler::StringBuilderOptimizer::GetOneOrTwoByte ( Node * node)

Definition at line 329 of file string-builder-optimizer.cc.

Here is the call graph for this function:

◆ GetPhiPredecessorsCommonId()

int v8::internal::compiler::StringBuilderOptimizer::GetPhiPredecessorsCommonId ( Node * node)
private

Definition at line 414 of file string-builder-optimizer.cc.

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

◆ GetStatus()

Status v8::internal::compiler::StringBuilderOptimizer::GetStatus ( Node * node) const
inlineprivate

Definition at line 290 of file string-builder-optimizer.h.

Here is the caller graph for this function:

◆ GetStringBuilderIdForConcat()

int v8::internal::compiler::StringBuilderOptimizer::GetStringBuilderIdForConcat ( Node * node)
private

Definition at line 375 of file string-builder-optimizer.cc.

Here is the call graph for this function:

◆ GetStringBuildersToFinalize()

ZoneVector< Node * > v8::internal::compiler::StringBuilderOptimizer::GetStringBuildersToFinalize ( BasicBlock * block)

Definition at line 323 of file string-builder-optimizer.cc.

Here is the call graph for this function:

◆ graph()

TFGraph * v8::internal::compiler::StringBuilderOptimizer::graph ( ) const
inline

Definition at line 262 of file string-builder-optimizer.h.

Here is the caller graph for this function:

◆ IsFirstConcatInStringBuilder()

bool v8::internal::compiler::StringBuilderOptimizer::IsFirstConcatInStringBuilder ( Node * node)

Definition at line 385 of file string-builder-optimizer.cc.

Here is the call graph for this function:

◆ IsLoopPhi()

bool v8::internal::compiler::StringBuilderOptimizer::IsLoopPhi ( Node * node) const
inlineprivate

Definition at line 331 of file string-builder-optimizer.h.

Here is the caller graph for this function:

◆ IsNonLoopPhiStringBuilderEnd()

bool v8::internal::compiler::StringBuilderOptimizer::IsNonLoopPhiStringBuilderEnd ( Node * node)

Definition at line 350 of file string-builder-optimizer.cc.

Here is the call graph for this function:

◆ IsStringBuilderConcatInput()

bool v8::internal::compiler::StringBuilderOptimizer::IsStringBuilderConcatInput ( Node * node)

Definition at line 354 of file string-builder-optimizer.cc.

Here is the call graph for this function:

◆ IsStringBuilderEnd()

bool v8::internal::compiler::StringBuilderOptimizer::IsStringBuilderEnd ( Node * node)

Definition at line 340 of file string-builder-optimizer.cc.

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

◆ jsgraph()

JSGraph * v8::internal::compiler::StringBuilderOptimizer::jsgraph ( ) const
inline

Definition at line 261 of file string-builder-optimizer.h.

◆ LoopContains()

bool v8::internal::compiler::StringBuilderOptimizer::LoopContains ( Node * loop_phi,
Node * node )
inlineprivate

Definition at line 335 of file string-builder-optimizer.h.

Here is the caller graph for this function:

◆ ReplaceConcatInputIfNeeded()

void v8::internal::compiler::StringBuilderOptimizer::ReplaceConcatInputIfNeeded ( Node * node,
int input_idx )
private

Definition at line 397 of file string-builder-optimizer.cc.

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

◆ Run()

void v8::internal::compiler::StringBuilderOptimizer::Run ( )

Definition at line 1176 of file string-builder-optimizer.cc.

Here is the call graph for this function:

◆ schedule()

Schedule * v8::internal::compiler::StringBuilderOptimizer::schedule ( ) const
inline

Definition at line 263 of file string-builder-optimizer.h.

Here is the caller graph for this function:

◆ SetStatus()

void v8::internal::compiler::StringBuilderOptimizer::SetStatus ( Node * node,
State state,
int id = kInvalidId )
inlineprivate

Definition at line 297 of file string-builder-optimizer.h.

Here is the caller graph for this function:

◆ temp_zone()

Zone * v8::internal::compiler::StringBuilderOptimizer::temp_zone ( ) const
inline

Definition at line 264 of file string-builder-optimizer.h.

Here is the caller graph for this function:

◆ UpdateStatus()

void v8::internal::compiler::StringBuilderOptimizer::UpdateStatus ( Node * node,
State state )
inlineprivate

Definition at line 310 of file string-builder-optimizer.h.

Here is the caller graph for this function:

◆ VisitGraph()

void v8::internal::compiler::StringBuilderOptimizer::VisitGraph ( )
private

Definition at line 1152 of file string-builder-optimizer.cc.

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

◆ VisitNode()

void v8::internal::compiler::StringBuilderOptimizer::VisitNode ( Node * node,
BasicBlock * block )
private

Definition at line 793 of file string-builder-optimizer.cc.

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

Member Data Documentation

◆ blocks_to_trimmings_map_

ZoneVector<std::optional<ZoneVector<Node*> > > v8::internal::compiler::StringBuilderOptimizer::blocks_to_trimmings_map_
private

Definition at line 366 of file string-builder-optimizer.h.

◆ broker_

JSHeapBroker* v8::internal::compiler::StringBuilderOptimizer::broker_
private

Definition at line 356 of file string-builder-optimizer.h.

◆ jsgraph_

JSGraph* v8::internal::compiler::StringBuilderOptimizer::jsgraph_
private

Definition at line 353 of file string-builder-optimizer.h.

◆ kAllowAnyStringOnTheRhs

bool v8::internal::compiler::StringBuilderOptimizer::kAllowAnyStringOnTheRhs = false
staticconstexprprivate

Definition at line 351 of file string-builder-optimizer.h.

◆ kInvalidId

int v8::internal::compiler::StringBuilderOptimizer::kInvalidId = -1
staticconstexprprivate

Definition at line 288 of file string-builder-optimizer.h.

◆ kInvalidStringBuilder

const StringBuilder v8::internal::compiler::StringBuilderOptimizer::kInvalidStringBuilder
private

◆ loop_headers_

ZoneVector<BasicBlock*> v8::internal::compiler::StringBuilderOptimizer::loop_headers_
private

Definition at line 371 of file string-builder-optimizer.h.

◆ schedule_

Schedule* v8::internal::compiler::StringBuilderOptimizer::schedule_
private

Definition at line 354 of file string-builder-optimizer.h.

◆ status_

ZoneVector<Status> v8::internal::compiler::StringBuilderOptimizer::status_
private

Definition at line 367 of file string-builder-optimizer.h.

◆ string_builder_count_

unsigned int v8::internal::compiler::StringBuilderOptimizer::string_builder_count_ = 0
private

Definition at line 357 of file string-builder-optimizer.h.

◆ string_builders_

ZoneVector<StringBuilder> v8::internal::compiler::StringBuilderOptimizer::string_builders_
private

Definition at line 368 of file string-builder-optimizer.h.

◆ temp_zone_

Zone* v8::internal::compiler::StringBuilderOptimizer::temp_zone_
private

Definition at line 355 of file string-builder-optimizer.h.


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