V8 Project
v8::internal::HInferTypesPhase Class Reference

#include <hydrogen-infer-types.h>

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

Public Member Functions

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

Private Member Functions

void InferTypes (int from_inclusive, int to_inclusive)
 
 DISALLOW_COPY_AND_ASSIGN (HInferTypesPhase)
 

Private Attributes

ZoneList< HValue * > worklist_
 
BitVector in_worklist_
 

Additional Inherited Members

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

Detailed Description

Definition at line 14 of file hydrogen-infer-types.h.

Constructor & Destructor Documentation

◆ HInferTypesPhase()

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

Definition at line 16 of file hydrogen-infer-types.h.

17  : HPhase("H_Inferring types", graph), worklist_(8, zone()),
18  in_worklist_(graph->GetMaximumValueID(), 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::HInferTypesPhase::DISALLOW_COPY_AND_ASSIGN ( HInferTypesPhase  )
private

◆ InferTypes()

void v8::internal::HInferTypesPhase::InferTypes ( int  from_inclusive,
int  to_inclusive 
)
private

Definition at line 10 of file hydrogen-infer-types.cc.

10  {
11  for (int i = from_inclusive; i <= to_inclusive; ++i) {
12  HBasicBlock* block = graph()->blocks()->at(i);
13 
14  const ZoneList<HPhi*>* phis = block->phis();
15  for (int j = 0; j < phis->length(); j++) {
16  phis->at(j)->UpdateInferredType();
17  }
18 
19  for (HInstructionIterator it(block); !it.Done(); it.Advance()) {
20  it.Current()->UpdateInferredType();
21  }
22 
23  if (block->IsLoopHeader()) {
24  HBasicBlock* last_back_edge =
25  block->loop_information()->GetLastBackEdge();
26  InferTypes(i + 1, last_back_edge->block_id());
27  // Skip all blocks already processed by the recursive call.
28  i = last_back_edge->block_id();
29  // Update phis of the loop header now after the whole loop body is
30  // guaranteed to be processed.
31  for (int j = 0; j < block->phis()->length(); ++j) {
32  HPhi* phi = block->phis()->at(j);
33  worklist_.Add(phi, zone());
34  in_worklist_.Add(phi->id());
35  }
36  while (!worklist_.is_empty()) {
37  HValue* current = worklist_.RemoveLast();
38  in_worklist_.Remove(current->id());
39  if (current->UpdateInferredType()) {
40  for (HUseIterator it(current->uses()); !it.Done(); it.Advance()) {
41  HValue* use = it.value();
42  if (!in_worklist_.Contains(use->id())) {
43  in_worklist_.Add(use->id());
44  worklist_.Add(use, zone());
45  }
46  }
47  }
48  }
50  }
51  }
52 }
bool Contains(int i) const
Definition: data-flow.h:99
bool IsEmpty() const
Definition: data-flow.h:164
void InferTypes(int from_inclusive, int to_inclusive)
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 expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to use(in kBytes)") DEFINE_INT(max_stack_trace_source_length
#define DCHECK(condition)
Definition: logging.h:205

References v8::internal::BitVector::Add(), v8::internal::List< T, AllocationPolicy >::at(), v8::internal::BitVector::Contains(), DCHECK, v8::internal::HPhase::graph(), v8::internal::HValue::id(), in_worklist_, v8::internal::BitVector::IsEmpty(), v8::internal::BitVector::Remove(), v8::internal::HValue::UpdateInferredType(), use(), v8::internal::HValue::uses(), 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::HInferTypesPhase::Run ( )
inline

Definition at line 20 of file hydrogen-infer-types.h.

20  {
21  InferTypes(0, graph()->blocks()->length() - 1);
22  }

References v8::internal::HPhase::graph(), and InferTypes().

+ Here is the call graph for this function:

Member Data Documentation

◆ in_worklist_

BitVector v8::internal::HInferTypesPhase::in_worklist_
private

Definition at line 28 of file hydrogen-infer-types.h.

Referenced by InferTypes().

◆ worklist_

ZoneList<HValue*> v8::internal::HInferTypesPhase::worklist_
private

Definition at line 27 of file hydrogen-infer-types.h.

Referenced by InferTypes().


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