V8 Project
v8::internal::PostorderProcessor Class Reference
+ Inheritance diagram for v8::internal::PostorderProcessor:
+ Collaboration diagram for v8::internal::PostorderProcessor:

Public Member Functions

PostorderProcessorparent ()
 
PostorderProcessorchild ()
 
HBasicBlock * block ()
 
HLoopInformation * loop ()
 
HBasicBlock * loop_header ()
 
PostorderProcessorPerformStep (Zone *zone, ZoneList< HBasicBlock * > *order)
 
- Public Member Functions inherited from v8::internal::ZoneObject
 INLINE (void *operator new(size_t size, Zone *zone))
 
void operator delete (void *, size_t)
 
void operator delete (void *pointer, Zone *zone)
 

Static Public Member Functions

static PostorderProcessorCreateEntryProcessor (Zone *zone, HBasicBlock *block)
 

Private Types

enum  LoopKind {
  NONE , SUCCESSORS , SUCCESSORS_OF_LOOP_HEADER , LOOP_MEMBERS ,
  SUCCESSORS_OF_LOOP_MEMBER
}
 

Private Member Functions

 PostorderProcessor (PostorderProcessor *father)
 
PostorderProcessorSetupSuccessors (Zone *zone, HBasicBlock *block, HBasicBlock *loop_header)
 
PostorderProcessorSetupLoopMembers (Zone *zone, HBasicBlock *block, HLoopInformation *loop, HBasicBlock *loop_header)
 
PostorderProcessorSetupSuccessorsOfLoopMember (HBasicBlock *block, HLoopInformation *loop, HBasicBlock *loop_header)
 
PostorderProcessorPush (Zone *zone)
 
void ClosePostorder (ZoneList< HBasicBlock * > *order, Zone *zone)
 
PostorderProcessorPop (Zone *zone, ZoneList< HBasicBlock * > *order)
 
PostorderProcessorBacktrack (Zone *zone, ZoneList< HBasicBlock * > *order)
 
PostorderProcessorPerformNonBacktrackingStep (Zone *zone, ZoneList< HBasicBlock * > *order)
 
void InitializeSuccessors ()
 
HBasicBlock * AdvanceSuccessors ()
 
void InitializeLoopMembers ()
 
HBasicBlock * AdvanceLoopMembers ()
 

Private Attributes

LoopKind kind_
 
PostorderProcessorfather_
 
PostorderProcessorchild_
 
HLoopInformation * loop_
 
HBasicBlock * block_
 
HBasicBlock * loop_header_
 
int loop_index
 
int loop_length
 
HSuccessorIterator successor_iterator
 

Detailed Description

Definition at line 3584 of file hydrogen.cc.

Member Enumeration Documentation

◆ LoopKind

Enumerator
NONE 
SUCCESSORS 
SUCCESSORS_OF_LOOP_HEADER 
LOOP_MEMBERS 
SUCCESSORS_OF_LOOP_MEMBER 

Definition at line 3616 of file hydrogen.cc.

Constructor & Destructor Documentation

◆ PostorderProcessor()

v8::internal::PostorderProcessor::PostorderProcessor ( PostorderProcessor father)
inlineexplicitprivate

Definition at line 3612 of file hydrogen.cc.

3613  : father_(father), child_(NULL), successor_iterator(NULL) { }
PostorderProcessor * child_
Definition: hydrogen.cc:3815
HSuccessorIterator successor_iterator
Definition: hydrogen.cc:3821
PostorderProcessor * father_
Definition: hydrogen.cc:3814
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

Member Function Documentation

◆ AdvanceLoopMembers()

HBasicBlock* v8::internal::PostorderProcessor::AdvanceLoopMembers ( )
inlineprivate

Definition at line 3803 of file hydrogen.cc.

3803  {
3804  if (loop_index < loop_length) {
3805  HBasicBlock* result = loop_->blocks()->at(loop_index);
3806  loop_index++;
3807  return result;
3808  } else {
3809  return NULL;
3810  }
3811  }

References NULL.

◆ AdvanceSuccessors()

HBasicBlock* v8::internal::PostorderProcessor::AdvanceSuccessors ( )
inlineprivate

Definition at line 3788 of file hydrogen.cc.

3788  {
3789  if (!successor_iterator.Done()) {
3790  HBasicBlock* result = successor_iterator.Current();
3791  successor_iterator.Advance();
3792  return result;
3793  }
3794  return NULL;
3795  }

References NULL.

◆ Backtrack()

PostorderProcessor* v8::internal::PostorderProcessor::Backtrack ( Zone zone,
ZoneList< HBasicBlock * > *  order 
)
inlineprivate

Definition at line 3726 of file hydrogen.cc.

3727  {
3728  PostorderProcessor* parent = Pop(zone, order);
3729  while (parent != NULL) {
3730  PostorderProcessor* next =
3731  parent->PerformNonBacktrackingStep(zone, order);
3732  if (next != NULL) {
3733  return next;
3734  } else {
3735  parent = parent->Pop(zone, order);
3736  }
3737  }
3738  return NULL;
3739  }
PostorderProcessor * PerformNonBacktrackingStep(Zone *zone, ZoneList< HBasicBlock * > *order)
Definition: hydrogen.cc:3741
PostorderProcessor * Pop(Zone *zone, ZoneList< HBasicBlock * > *order)
Definition: hydrogen.cc:3700
PostorderProcessor * parent()
Definition: hydrogen.cc:3587
PostorderProcessor(PostorderProcessor *father)
Definition: hydrogen.cc:3612

References NULL, PerformNonBacktrackingStep(), and Pop().

+ Here is the call graph for this function:

◆ block()

HBasicBlock* v8::internal::PostorderProcessor::block ( )
inline

Definition at line 3590 of file hydrogen.cc.

3590 { return block_; }

◆ child()

PostorderProcessor* v8::internal::PostorderProcessor::child ( )
inline

Definition at line 3589 of file hydrogen.cc.

3589 {return child_; }

◆ ClosePostorder()

void v8::internal::PostorderProcessor::ClosePostorder ( ZoneList< HBasicBlock * > *  order,
Zone zone 
)
inlineprivate

Definition at line 3689 of file hydrogen.cc.

3689  {
3690  DCHECK(block_->end()->FirstSuccessor() == NULL ||
3691  order->Contains(block_->end()->FirstSuccessor()) ||
3692  block_->end()->FirstSuccessor()->IsLoopHeader());
3693  DCHECK(block_->end()->SecondSuccessor() == NULL ||
3694  order->Contains(block_->end()->SecondSuccessor()) ||
3695  block_->end()->SecondSuccessor()->IsLoopHeader());
3696  order->Add(block_, zone);
3697  }
#define DCHECK(condition)
Definition: logging.h:205

References v8::internal::List< T, AllocationPolicy >::Add(), v8::internal::List< T, AllocationPolicy >::Contains(), DCHECK, and NULL.

+ Here is the call graph for this function:

◆ CreateEntryProcessor()

static PostorderProcessor* v8::internal::PostorderProcessor::CreateEntryProcessor ( Zone zone,
HBasicBlock *  block 
)
inlinestatic

Definition at line 3594 of file hydrogen.cc.

3595  {
3596  PostorderProcessor* result = new(zone) PostorderProcessor(NULL);
3597  return result->SetupSuccessors(zone, block, NULL);
3598  }

References NULL, and SetupSuccessors().

+ Here is the call graph for this function:

◆ InitializeLoopMembers()

void v8::internal::PostorderProcessor::InitializeLoopMembers ( )
inlineprivate

Definition at line 3798 of file hydrogen.cc.

3798  {
3799  loop_index = 0;
3800  loop_length = loop_->blocks()->length();
3801  }

◆ InitializeSuccessors()

void v8::internal::PostorderProcessor::InitializeSuccessors ( )
inlineprivate

Definition at line 3782 of file hydrogen.cc.

3782  {
3783  loop_index = 0;
3784  loop_length = 0;
3785  successor_iterator = HSuccessorIterator(block_->end());
3786  }

◆ loop()

HLoopInformation* v8::internal::PostorderProcessor::loop ( )
inline

Definition at line 3591 of file hydrogen.cc.

3591 { return loop_; }

◆ loop_header()

HBasicBlock* v8::internal::PostorderProcessor::loop_header ( )
inline

Definition at line 3592 of file hydrogen.cc.

3592 { return loop_header_; }

◆ parent()

PostorderProcessor* v8::internal::PostorderProcessor::parent ( )
inline

Definition at line 3587 of file hydrogen.cc.

3587 {return father_; }

◆ PerformNonBacktrackingStep()

PostorderProcessor* v8::internal::PostorderProcessor::PerformNonBacktrackingStep ( Zone zone,
ZoneList< HBasicBlock * > *  order 
)
inlineprivate

Definition at line 3741 of file hydrogen.cc.

3743  {
3744  HBasicBlock* next_block;
3745  switch (kind_) {
3746  case SUCCESSORS:
3747  next_block = AdvanceSuccessors();
3748  if (next_block != NULL) {
3749  PostorderProcessor* result = Push(zone);
3750  return result->SetupSuccessors(zone, next_block, loop_header_);
3751  }
3752  break;
3754  next_block = AdvanceSuccessors();
3755  if (next_block != NULL) {
3756  PostorderProcessor* result = Push(zone);
3757  return result->SetupSuccessors(zone, next_block, block());
3758  }
3759  break;
3760  case LOOP_MEMBERS:
3761  next_block = AdvanceLoopMembers();
3762  if (next_block != NULL) {
3763  PostorderProcessor* result = Push(zone);
3764  return result->SetupSuccessorsOfLoopMember(next_block,
3765  loop_, loop_header_);
3766  }
3767  break;
3769  next_block = AdvanceSuccessors();
3770  if (next_block != NULL) {
3771  PostorderProcessor* result = Push(zone);
3772  return result->SetupSuccessors(zone, next_block, loop_header_);
3773  }
3774  break;
3775  case NONE:
3776  return NULL;
3777  }
3778  return NULL;
3779  }
HBasicBlock * AdvanceSuccessors()
Definition: hydrogen.cc:3788
PostorderProcessor * Push(Zone *zone)
Definition: hydrogen.cc:3682
HBasicBlock * AdvanceLoopMembers()
Definition: hydrogen.cc:3803

References NONE, NULL, v8::internal::compiler::Push(), SetupSuccessors(), and SetupSuccessorsOfLoopMember().

Referenced by Backtrack().

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

◆ PerformStep()

PostorderProcessor* v8::internal::PostorderProcessor::PerformStep ( Zone zone,
ZoneList< HBasicBlock * > *  order 
)
inline

Definition at line 3600 of file hydrogen.cc.

3601  {
3602  PostorderProcessor* next =
3603  PerformNonBacktrackingStep(zone, order);
3604  if (next != NULL) {
3605  return next;
3606  } else {
3607  return Backtrack(zone, order);
3608  }
3609  }
PostorderProcessor * Backtrack(Zone *zone, ZoneList< HBasicBlock * > *order)
Definition: hydrogen.cc:3726

References NULL.

◆ Pop()

PostorderProcessor* v8::internal::PostorderProcessor::Pop ( Zone zone,
ZoneList< HBasicBlock * > *  order 
)
inlineprivate

Definition at line 3700 of file hydrogen.cc.

3701  {
3702  switch (kind_) {
3703  case SUCCESSORS:
3705  ClosePostorder(order, zone);
3706  return father_;
3707  case LOOP_MEMBERS:
3708  return father_;
3710  if (block()->IsLoopHeader() && block() != loop_->loop_header()) {
3711  // In this case we need to perform a LOOP_MEMBERS cycle so we
3712  // initialize it and return this instead of father.
3713  return SetupLoopMembers(zone, block(),
3714  block()->loop_information(), loop_header_);
3715  } else {
3716  return father_;
3717  }
3718  case NONE:
3719  return father_;
3720  }
3721  UNREACHABLE();
3722  return NULL;
3723  }
PostorderProcessor * SetupLoopMembers(Zone *zone, HBasicBlock *block, HLoopInformation *loop, HBasicBlock *loop_header)
Definition: hydrogen.cc:3657
void ClosePostorder(ZoneList< HBasicBlock * > *order, Zone *zone)
Definition: hydrogen.cc:3689
#define UNREACHABLE()
Definition: logging.h:30

References NONE, NULL, and UNREACHABLE.

Referenced by Backtrack().

+ Here is the caller graph for this function:

◆ Push()

PostorderProcessor* v8::internal::PostorderProcessor::Push ( Zone zone)
inlineprivate

Definition at line 3682 of file hydrogen.cc.

3682  {
3683  if (child_ == NULL) {
3684  child_ = new(zone) PostorderProcessor(this);
3685  }
3686  return child_;
3687  }

References NULL.

◆ SetupLoopMembers()

PostorderProcessor* v8::internal::PostorderProcessor::SetupLoopMembers ( Zone zone,
HBasicBlock *  block,
HLoopInformation *  loop,
HBasicBlock *  loop_header 
)
inlineprivate

Definition at line 3657 of file hydrogen.cc.

3660  {
3661  kind_ = LOOP_MEMBERS;
3662  block_ = block;
3663  loop_ = loop;
3666  return this;
3667  }
HLoopInformation * loop()
Definition: hydrogen.cc:3591

Referenced by SetupSuccessors().

+ Here is the caller graph for this function:

◆ SetupSuccessors()

PostorderProcessor* v8::internal::PostorderProcessor::SetupSuccessors ( Zone zone,
HBasicBlock *  block,
HBasicBlock *  loop_header 
)
inlineprivate

Definition at line 3625 of file hydrogen.cc.

3627  {
3628  if (block == NULL || block->IsOrdered() ||
3629  block->parent_loop_header() != loop_header) {
3630  kind_ = NONE;
3631  block_ = NULL;
3632  loop_ = NULL;
3633  loop_header_ = NULL;
3634  return this;
3635  } else {
3636  block_ = block;
3637  loop_ = NULL;
3638  block->MarkAsOrdered();
3639 
3640  if (block->IsLoopHeader()) {
3642  loop_header_ = block;
3644  PostorderProcessor* result = Push(zone);
3645  return result->SetupLoopMembers(zone, block, block->loop_information(),
3646  loop_header);
3647  } else {
3648  DCHECK(block->IsFinished());
3649  kind_ = SUCCESSORS;
3652  return this;
3653  }
3654  }
3655  }

References DCHECK, NONE, NULL, v8::internal::compiler::Push(), and SetupLoopMembers().

Referenced by CreateEntryProcessor(), and PerformNonBacktrackingStep().

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

◆ SetupSuccessorsOfLoopMember()

PostorderProcessor* v8::internal::PostorderProcessor::SetupSuccessorsOfLoopMember ( HBasicBlock *  block,
HLoopInformation *  loop,
HBasicBlock *  loop_header 
)
inlineprivate

Definition at line 3669 of file hydrogen.cc.

3672  {
3674  block_ = block;
3675  loop_ = loop;
3678  return this;
3679  }

Referenced by PerformNonBacktrackingStep().

+ Here is the caller graph for this function:

Member Data Documentation

◆ block_

HBasicBlock* v8::internal::PostorderProcessor::block_
private

Definition at line 3817 of file hydrogen.cc.

◆ child_

PostorderProcessor* v8::internal::PostorderProcessor::child_
private

Definition at line 3815 of file hydrogen.cc.

◆ father_

PostorderProcessor* v8::internal::PostorderProcessor::father_
private

Definition at line 3814 of file hydrogen.cc.

◆ kind_

LoopKind v8::internal::PostorderProcessor::kind_
private

Definition at line 3813 of file hydrogen.cc.

◆ loop_

HLoopInformation* v8::internal::PostorderProcessor::loop_
private

Definition at line 3816 of file hydrogen.cc.

◆ loop_header_

HBasicBlock* v8::internal::PostorderProcessor::loop_header_
private

Definition at line 3818 of file hydrogen.cc.

◆ loop_index

int v8::internal::PostorderProcessor::loop_index
private

Definition at line 3819 of file hydrogen.cc.

◆ loop_length

int v8::internal::PostorderProcessor::loop_length
private

Definition at line 3820 of file hydrogen.cc.

◆ successor_iterator

HSuccessorIterator v8::internal::PostorderProcessor::successor_iterator
private

Definition at line 3821 of file hydrogen.cc.


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