V8 Project
v8::internal::HCheckEliminationPhase Class Reference

#include <hydrogen-check-elimination.h>

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

Public Member Functions

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

Private Member Functions

const UniqueSet< Map > * string_maps () const
 
void PrintStats ()
 

Private Attributes

HAliasAnalyzeraliasing_
 
UniqueSet< Mapstring_maps_
 

Static Private Attributes

static const int kStringMapsSize = 0 STRING_TYPE_LIST(COUNT)
 

Friends

class HCheckTable
 

Additional Inherited Members

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

Detailed Description

Definition at line 16 of file hydrogen-check-elimination.h.

Constructor & Destructor Documentation

◆ HCheckEliminationPhase()

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

Definition at line 18 of file hydrogen-check-elimination.h.

19  : HPhase("H_Check Elimination", graph), aliasing_(),
20  string_maps_(kStringMapsSize, zone()) {
21  // Compute the set of string maps.
22  #define ADD_STRING_MAP(type, size, name, Name) \
23  string_maps_.Add(Unique<Map>::CreateImmovable( \
24  graph->isolate()->factory()->name##_map()), zone());
26  #undef ADD_STRING_MAP
28 #ifdef DEBUG
29  redundant_ = 0;
30  removed_ = 0;
31  removed_cho_ = 0;
32  removed_cit_ = 0;
33  narrowed_ = 0;
34  loads_ = 0;
35  empty_ = 0;
36  compares_true_ = 0;
37  compares_false_ = 0;
38  transitions_ = 0;
39 #endif
40  }
HGraph * graph() const
Definition: hydrogen.h:2802
HPhase(const char *name, HGraph *graph)
Definition: hydrogen.h:2796
#define ADD_STRING_MAP(type, size, name, Name)
#define DCHECK_EQ(v1, v2)
Definition: logging.h:206
#define STRING_TYPE_LIST(V)
Definition: objects.h:457

References ADD_STRING_MAP, DCHECK_EQ, kStringMapsSize, string_maps_, and STRING_TYPE_LIST.

Member Function Documentation

◆ PrintStats()

void v8::internal::HCheckEliminationPhase::PrintStats ( )
private

Definition at line 885 of file hydrogen-check-elimination.cc.

885  {
886 #if DEBUG
887  #define PRINT_STAT(x) if (x##_ > 0) PrintF(" %-16s = %2d\n", #x, x##_)
888 #else
889  #define PRINT_STAT(x)
890 #endif
891  PRINT_STAT(redundant);
892  PRINT_STAT(removed);
893  PRINT_STAT(removed_cho);
894  PRINT_STAT(removed_cit);
895  PRINT_STAT(narrowed);
896  PRINT_STAT(loads);
897  PRINT_STAT(empty);
898  PRINT_STAT(compares_true);
899  PRINT_STAT(compares_false);
900  PRINT_STAT(transitions);
901 }
#define PRINT_STAT(x)

References PRINT_STAT.

Referenced by Run().

+ Here is the caller graph for this function:

◆ Run()

void v8::internal::HCheckEliminationPhase::Run ( )

Definition at line 865 of file hydrogen-check-elimination.cc.

865  {
866  HFlowEngine<HCheckTable, HCheckMapsEffects> engine(graph(), zone());
867  HCheckTable* table = new(zone()) HCheckTable(this);
868 
869  if (GLOBAL) {
870  // Perform a global analysis.
871  engine.AnalyzeDominatedBlocks(graph()->blocks()->at(0), table);
872  } else {
873  // Perform only local analysis.
874  for (int i = 0; i < graph()->blocks()->length(); i++) {
875  table->Kill();
876  engine.AnalyzeOneBlock(graph()->blocks()->at(i), table);
877  }
878  }
879 
880  if (FLAG_trace_check_elimination) PrintStats();
881 }
#define GLOBAL

References v8::internal::HFlowEngine< State, Effects >::AnalyzeDominatedBlocks(), v8::internal::HFlowEngine< State, Effects >::AnalyzeOneBlock(), GLOBAL, v8::internal::HPhase::graph(), HCheckTable, v8::internal::HCheckTable::Kill(), and PrintStats().

+ Here is the call graph for this function:

◆ string_maps()

const UniqueSet<Map>* v8::internal::HCheckEliminationPhase::string_maps ( ) const
inlineprivate

Definition at line 47 of file hydrogen-check-elimination.h.

47 { return &string_maps_; }

References string_maps_.

Referenced by v8::internal::HCheckTable::string_maps().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ HCheckTable

friend class HCheckTable
friend

Definition at line 44 of file hydrogen-check-elimination.h.

Referenced by Run().

Member Data Documentation

◆ aliasing_

HAliasAnalyzer* v8::internal::HCheckEliminationPhase::aliasing_
private

◆ kStringMapsSize

const int v8::internal::HCheckEliminationPhase::kStringMapsSize = 0 STRING_TYPE_LIST(COUNT)
staticprivate

Definition at line 53 of file hydrogen-check-elimination.h.

Referenced by HCheckEliminationPhase().

◆ string_maps_

UniqueSet<Map> v8::internal::HCheckEliminationPhase::string_maps_
private

Definition at line 55 of file hydrogen-check-elimination.h.

Referenced by HCheckEliminationPhase(), and string_maps().


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