V8 Project
v8::internal::HRedundantPhiEliminationPhase Class Reference

#include <hydrogen-redundant-phi.h>

+ Inheritance diagram for v8::internal::HRedundantPhiEliminationPhase:
+ Collaboration diagram for v8::internal::HRedundantPhiEliminationPhase:

Public Member Functions

 HRedundantPhiEliminationPhase (HGraph *graph)
 
void Run ()
 
void ProcessBlock (HBasicBlock *block)
 
- Public Member Functions inherited from v8::internal::HPhase
 HPhase (const char *name, HGraph *graph)
 
 ~HPhase ()
 

Private Member Functions

void ProcessPhis (const ZoneList< HPhi * > *phis)
 
 DISALLOW_COPY_AND_ASSIGN (HRedundantPhiEliminationPhase)
 

Additional Inherited Members

- Protected Member Functions inherited from v8::internal::HPhase
HGraph * graph () const
 

Detailed Description

Definition at line 16 of file hydrogen-redundant-phi.h.

Constructor & Destructor Documentation

◆ HRedundantPhiEliminationPhase()

v8::internal::HRedundantPhiEliminationPhase::HRedundantPhiEliminationPhase ( HGraph *  graph)
inlineexplicit

Definition at line 18 of file hydrogen-redundant-phi.h.

19  : HPhase("H_Redundant phi elimination", graph) { }
HGraph * graph() const
Definition: hydrogen.h:2802
HPhase(const char *name, HGraph *graph)
Definition: hydrogen.h:2796

Member Function Documentation

◆ DISALLOW_COPY_AND_ASSIGN()

v8::internal::HRedundantPhiEliminationPhase::DISALLOW_COPY_AND_ASSIGN ( HRedundantPhiEliminationPhase  )
private

◆ ProcessBlock()

void v8::internal::HRedundantPhiEliminationPhase::ProcessBlock ( HBasicBlock *  block)

Definition at line 35 of file hydrogen-redundant-phi.cc.

35  {
36  ProcessPhis(block->phis());
37 }
void ProcessPhis(const ZoneList< HPhi * > *phis)

References ProcessPhis().

Referenced by v8::internal::HCanonicalizePhase::Run().

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

◆ ProcessPhis()

void v8::internal::HRedundantPhiEliminationPhase::ProcessPhis ( const ZoneList< HPhi * > *  phis)
private

Definition at line 40 of file hydrogen-redundant-phi.cc.

40  {
41  bool updated;
42  do {
43  // Iterately replace all redundant phis in the given list.
44  updated = false;
45  for (int i = 0; i < phis->length(); i++) {
46  HPhi* phi = phis->at(i);
47  if (phi->CheckFlag(HValue::kIsDead)) continue; // Already replaced.
48 
49  HValue* replacement = phi->GetRedundantReplacement();
50  if (replacement != NULL) {
51  phi->SetFlag(HValue::kIsDead);
52  for (HUseIterator it(phi->uses()); !it.Done(); it.Advance()) {
53  HValue* value = it.value();
54  value->SetOperandAt(it.index(), replacement);
55  // Iterate again if used in another non-dead phi.
56  updated |= value->IsPhi() && !value->CheckFlag(HValue::kIsDead);
57  }
58  phi->block()->RemovePhi(phi);
59  }
60  }
61  } while (updated);
62 }
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL

References v8::internal::List< T, AllocationPolicy >::at(), v8::internal::HValue::CheckFlag(), v8::internal::HValue::IsPhi(), v8::internal::HValue::kIsDead, NULL, v8::internal::HValue::SetFlag(), and v8::internal::HValue::SetOperandAt().

Referenced by ProcessBlock(), and Run().

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

◆ Run()

void v8::internal::HRedundantPhiEliminationPhase::Run ( )

Definition at line 10 of file hydrogen-redundant-phi.cc.

10  {
11  // Gather all phis from all blocks first.
12  const ZoneList<HBasicBlock*>* blocks(graph()->blocks());
13  ZoneList<HPhi*> all_phis(blocks->length(), zone());
14  for (int i = 0; i < blocks->length(); ++i) {
15  HBasicBlock* block = blocks->at(i);
16  for (int j = 0; j < block->phis()->length(); j++) {
17  all_phis.Add(block->phis()->at(j), zone());
18  }
19  }
20 
21  // Iteratively reduce all phis in the list.
22  ProcessPhis(&all_phis);
23 
24 #if DEBUG
25  // Make sure that we *really* removed all redundant phis.
26  for (int i = 0; i < blocks->length(); ++i) {
27  for (int j = 0; j < blocks->at(i)->phis()->length(); j++) {
28  DCHECK(blocks->at(i)->phis()->at(j)->GetRedundantReplacement() == NULL);
29  }
30  }
31 #endif
32 }
#define DCHECK(condition)
Definition: logging.h:205

References v8::internal::List< T, AllocationPolicy >::Add(), v8::internal::List< T, AllocationPolicy >::at(), DCHECK, v8::internal::HPhase::graph(), NULL, and ProcessPhis().

+ Here is the call graph for this function:

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