V8 Project
v8::internal::HMarkDeoptimizeOnUndefinedPhase Class Reference

#include <hydrogen-mark-deoptimize.h>

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

Public Member Functions

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

Private Member Functions

void ProcessPhi (HPhi *phi)
 
 DISALLOW_COPY_AND_ASSIGN (HMarkDeoptimizeOnUndefinedPhase)
 

Private Attributes

ZoneList< HPhi * > worklist_
 

Additional Inherited Members

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

Detailed Description

Definition at line 19 of file hydrogen-mark-deoptimize.h.

Constructor & Destructor Documentation

◆ HMarkDeoptimizeOnUndefinedPhase()

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

Definition at line 21 of file hydrogen-mark-deoptimize.h.

22  : HPhase("H_Mark deoptimize on undefined", graph),
23  worklist_(16, zone()) {}
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::HMarkDeoptimizeOnUndefinedPhase::DISALLOW_COPY_AND_ASSIGN ( HMarkDeoptimizeOnUndefinedPhase  )
private

◆ ProcessPhi()

void v8::internal::HMarkDeoptimizeOnUndefinedPhase::ProcessPhi ( HPhi *  phi)
private

Definition at line 22 of file hydrogen-mark-deoptimize.cc.

22  {
23  DCHECK(phi->CheckFlag(HValue::kAllowUndefinedAsNaN));
24  DCHECK(worklist_.is_empty());
25 
26  // Push the phi onto the worklist
27  phi->ClearFlag(HValue::kAllowUndefinedAsNaN);
28  worklist_.Add(phi, zone());
29 
30  // Process all phis that can reach this phi
31  while (!worklist_.is_empty()) {
32  phi = worklist_.RemoveLast();
33  for (int i = phi->OperandCount() - 1; i >= 0; --i) {
34  HValue* input = phi->OperandAt(i);
35  if (input->IsPhi() && input->CheckFlag(HValue::kAllowUndefinedAsNaN)) {
36  input->ClearFlag(HValue::kAllowUndefinedAsNaN);
37  worklist_.Add(HPhi::cast(input), zone());
38  }
39  }
40  }
41 }
void Add(const T &element, AllocationPolicy allocator=AllocationPolicy())
Definition: list-inl.h:17
#define DCHECK(condition)
Definition: logging.h:205

References v8::internal::List< T, AllocationPolicy >::Add(), v8::internal::HValue::CheckFlag(), v8::internal::HValue::ClearFlag(), DCHECK, v8::internal::HValue::IsPhi(), v8::internal::HValue::kAllowUndefinedAsNaN, v8::internal::HValue::OperandAt(), and worklist_.

Referenced by Run().

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

◆ Run()

void v8::internal::HMarkDeoptimizeOnUndefinedPhase::Run ( )

Definition at line 10 of file hydrogen-mark-deoptimize.cc.

10  {
11  const ZoneList<HPhi*>* phi_list = graph()->phi_list();
12  for (int i = 0; i < phi_list->length(); i++) {
13  HPhi* phi = phi_list->at(i);
14  if (phi->CheckFlag(HValue::kAllowUndefinedAsNaN) &&
15  !phi->CheckUsesForFlag(HValue::kAllowUndefinedAsNaN)) {
16  ProcessPhi(phi);
17  }
18  }
19 }

References v8::internal::List< T, AllocationPolicy >::at(), v8::internal::HPhase::graph(), v8::internal::HValue::kAllowUndefinedAsNaN, and ProcessPhi().

+ Here is the call graph for this function:

Member Data Documentation

◆ worklist_

ZoneList<HPhi*> v8::internal::HMarkDeoptimizeOnUndefinedPhase::worklist_
private

Definition at line 32 of file hydrogen-mark-deoptimize.h.

Referenced by ProcessPhi().


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