V8 Project
v8::internal::HUint32AnalysisPhase Class Reference

#include <hydrogen-uint32-analysis.h>

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

Public Member Functions

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

Private Member Functions

 INLINE (bool IsSafeUint32Use(HValue *val, HValue *use))
 
 INLINE (bool Uint32UsesAreSafe(HValue *uint32val))
 
 INLINE (bool CheckPhiOperands(HPhi *phi))
 
 INLINE (void UnmarkPhi(HPhi *phi, ZoneList< HPhi * > *worklist))
 
 INLINE (void UnmarkUnsafePhis())
 

Private Attributes

ZoneList< HPhi * > phis_
 

Additional Inherited Members

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

Detailed Description

Definition at line 16 of file hydrogen-uint32-analysis.h.

Constructor & Destructor Documentation

◆ HUint32AnalysisPhase()

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

Definition at line 18 of file hydrogen-uint32-analysis.h.

19  : HPhase("H_Compute safe UInt32 operations", graph), phis_(4, zone()) { }
HGraph * graph() const
Definition: hydrogen.h:2802
HPhase(const char *name, HGraph *graph)
Definition: hydrogen.h:2796

Member Function Documentation

◆ INLINE() [1/5]

v8::internal::HUint32AnalysisPhase::INLINE ( bool   CheckPhiOperandsHPhi *phi)
private

◆ INLINE() [2/5]

v8::internal::HUint32AnalysisPhase::INLINE ( bool   IsSafeUint32UseHValue *val, HValue *use)
private

◆ INLINE() [3/5]

v8::internal::HUint32AnalysisPhase::INLINE ( bool   Uint32UsesAreSafeHValue *uint32val)
private

◆ INLINE() [4/5]

v8::internal::HUint32AnalysisPhase::INLINE ( void   UnmarkPhiHPhi *phi, ZoneList< HPhi * > *worklist)
private

◆ INLINE() [5/5]

v8::internal::HUint32AnalysisPhase::INLINE ( void   UnmarkUnsafePhis())
private

◆ Run()

void v8::internal::HUint32AnalysisPhase::Run ( )

Definition at line 217 of file hydrogen-uint32-analysis.cc.

217  {
218  if (!graph()->has_uint32_instructions()) return;
219 
220  ZoneList<HInstruction*>* uint32_instructions = graph()->uint32_instructions();
221  for (int i = 0; i < uint32_instructions->length(); ++i) {
222  // Analyze instruction and mark it with kUint32 if all
223  // its uses are uint32 safe.
224  HInstruction* current = uint32_instructions->at(i);
225  if (current->IsLinked() &&
226  current->representation().IsInteger32() &&
227  Uint32UsesAreSafe(current)) {
228  current->SetFlag(HInstruction::kUint32);
229  }
230  }
231 
232  // Some phis might have been optimistically marked with kUint32 flag.
233  // Remove this flag from those phis that are unsafe and propagate
234  // this information transitively potentially clearing kUint32 flag
235  // from some non-phi operations that are used as operands to unsafe phis.
236  UnmarkUnsafePhis();
237 }

References v8::internal::List< T, AllocationPolicy >::at(), v8::internal::HPhase::graph(), v8::internal::Representation::IsInteger32(), v8::internal::HInstruction::IsLinked(), v8::internal::HValue::kUint32, v8::internal::HValue::representation(), and v8::internal::HValue::SetFlag().

+ Here is the call graph for this function:

Member Data Documentation

◆ phis_

ZoneList<HPhi*> v8::internal::HUint32AnalysisPhase::phis_
private

Definition at line 30 of file hydrogen-uint32-analysis.h.


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