V8 Project
v8::internal::compiler::Schedule Class Reference

#include <schedule.h>

+ Inheritance diagram for v8::internal::compiler::Schedule:
+ Collaboration diagram for v8::internal::compiler::Schedule:

Public Types

typedef ContainerPointerWrapper< BasicBlockVectorBasicBlocks
 

Public Member Functions

 Schedule (Zone *zone, size_t node_count_hint=0)
 
BasicBlock * block (Node *node) const
 
bool IsScheduled (Node *node)
 
BasicBlock * GetBlockById (int block_id)
 
int BasicBlockCount () const
 
int RpoBlockCount () const
 
BasicBlocks all_blocks ()
 
bool SameBasicBlock (Node *a, Node *b) const
 
BasicBlock * NewBasicBlock ()
 
void PlanNode (BasicBlock *block, Node *node)
 
void AddNode (BasicBlock *block, Node *node)
 
void AddGoto (BasicBlock *block, BasicBlock *succ)
 
void AddBranch (BasicBlock *block, Node *branch, BasicBlock *tblock, BasicBlock *fblock)
 
void AddReturn (BasicBlock *block, Node *input)
 
void AddThrow (BasicBlock *block, Node *input)
 
void AddSuccessor (BasicBlock *block, BasicBlock *succ)
 
BasicBlockVectorrpo_order ()
 
- Public Member Functions inherited from v8::internal::compiler::GenericGraph< BasicBlock >
 GenericGraph (Zone *zone)
 
BasicBlock * start ()
 
BasicBlock * end ()
 
void SetStart (BasicBlock *start)
 
void SetEnd (BasicBlock *end)
 
- Public Member Functions inherited from v8::internal::compiler::GenericGraphBase
 GenericGraphBase (Zone *zone)
 
Zonezone () const
 
NodeId NextNodeID ()
 
NodeId NodeCount () const
 
- 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)
 

Private Member Functions

void SetControlInput (BasicBlock *block, Node *node)
 
void SetBlockForNode (BasicBlock *block, Node *node)
 

Private Attributes

Zonezone_
 
BasicBlockVector all_blocks_
 
BasicBlockVector nodeid_to_block_
 
BasicBlockVector rpo_order_
 

Friends

class Scheduler
 
class CodeGenerator
 
class ScheduleVisualizer
 
class BasicBlockInstrumentor
 

Detailed Description

Definition at line 157 of file schedule.h.

Member Typedef Documentation

◆ BasicBlocks

Constructor & Destructor Documentation

◆ Schedule()

v8::internal::compiler::Schedule::Schedule ( Zone zone,
size_t  node_count_hint = 0 
)
inlineexplicit

Definition at line 159 of file schedule.h.

160  : GenericGraph<BasicBlock>(zone),
161  zone_(zone),
162  all_blocks_(zone),
164  rpo_order_(zone) {
165  SetStart(NewBasicBlock()); // entry.
166  SetEnd(NewBasicBlock()); // exit.
167  nodeid_to_block_.reserve(node_count_hint);
168  }
BasicBlockVector all_blocks_
Definition: schedule.h:299
BasicBlockVector nodeid_to_block_
Definition: schedule.h:300
BasicBlockVector rpo_order_
Definition: schedule.h:301

References NewBasicBlock(), nodeid_to_block_, v8::internal::compiler::GenericGraph< BasicBlock >::SetEnd(), and v8::internal::compiler::GenericGraph< BasicBlock >::SetStart().

+ Here is the call graph for this function:

Member Function Documentation

◆ AddBranch()

void v8::internal::compiler::Schedule::AddBranch ( BasicBlock *  block,
Node *  branch,
BasicBlock *  tblock,
BasicBlock *  fblock 
)
inline

Definition at line 238 of file schedule.h.

239  {
240  DCHECK(block->control_ == BasicBlock::kNone);
241  DCHECK(branch->opcode() == IrOpcode::kBranch);
242  block->control_ = BasicBlock::kBranch;
243  AddSuccessor(block, tblock);
244  AddSuccessor(block, fblock);
245  SetControlInput(block, branch);
246  if (branch->opcode() == IrOpcode::kBranch) {
247  // TODO(titzer): require a Branch node here. (sloppy tests).
248  SetBlockForNode(block, branch);
249  }
250  }
void SetBlockForNode(BasicBlock *block, Node *node)
Definition: schedule.h:290
void AddSuccessor(BasicBlock *block, BasicBlock *succ)
Definition: schedule.h:275
void SetControlInput(BasicBlock *block, Node *node)
Definition: schedule.h:285
BasicBlock * block(Node *node) const
Definition: schedule.h:171
#define DCHECK(condition)
Definition: logging.h:205

References AddSuccessor(), block(), DCHECK, SetBlockForNode(), and SetControlInput().

Referenced by v8::internal::compiler::RawMachineAssembler::Branch(), and v8::internal::compiler::CFGBuilder::ConnectBranch().

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

◆ AddGoto()

void v8::internal::compiler::Schedule::AddGoto ( BasicBlock *  block,
BasicBlock *  succ 
)
inline

Definition at line 231 of file schedule.h.

231  {
232  DCHECK(block->control_ == BasicBlock::kNone);
233  block->control_ = BasicBlock::kGoto;
234  AddSuccessor(block, succ);
235  }

References AddSuccessor(), block(), and DCHECK.

Referenced by v8::internal::compiler::CFGBuilder::ConnectMerge(), and v8::internal::compiler::RawMachineAssembler::Goto().

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

◆ AddNode()

void v8::internal::compiler::Schedule::AddNode ( BasicBlock *  block,
Node *  node 
)
inline

Definition at line 220 of file schedule.h.

220  {
221  if (FLAG_trace_turbo_scheduler) {
222  PrintF("Adding #%d:%s to B%d\n", node->id(), node->op()->mnemonic(),
223  block->id());
224  }
225  DCHECK(this->block(node) == NULL || this->block(node) == block);
226  block->nodes_.push_back(node);
227  SetBlockForNode(block, node);
228  }
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
void PrintF(const char *format,...)
Definition: utils.cc:80

References block(), DCHECK, NULL, v8::internal::PrintF(), and SetBlockForNode().

Referenced by v8::internal::compiler::RawMachineAssembler::CallFunctionStub0(), v8::internal::compiler::RawMachineAssembler::CallJS0(), v8::internal::compiler::RawMachineAssembler::CallRuntime1(), v8::internal::compiler::CFGBuilder::FixNode(), v8::internal::compiler::RawMachineAssembler::MakeNode(), v8::internal::compiler::PrepareUsesVisitor::Pre(), and v8::internal::compiler::Scheduler::ScheduleLate().

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

◆ AddReturn()

void v8::internal::compiler::Schedule::AddReturn ( BasicBlock *  block,
Node *  input 
)
inline

Definition at line 253 of file schedule.h.

253  {
254  DCHECK(block->control_ == BasicBlock::kNone);
255  block->control_ = BasicBlock::kReturn;
256  SetControlInput(block, input);
257  if (block != end()) AddSuccessor(block, end());
258  if (input->opcode() == IrOpcode::kReturn) {
259  // TODO(titzer): require a Return node here. (sloppy tests).
260  SetBlockForNode(block, input);
261  }
262  }

References AddSuccessor(), block(), DCHECK, v8::internal::compiler::GenericGraph< BasicBlock >::end(), SetBlockForNode(), and SetControlInput().

Referenced by v8::internal::compiler::CFGBuilder::ConnectReturn(), and v8::internal::compiler::RawMachineAssembler::Return().

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

◆ AddSuccessor()

void v8::internal::compiler::Schedule::AddSuccessor ( BasicBlock *  block,
BasicBlock *  succ 
)
inline

Definition at line 275 of file schedule.h.

275  {
276  succ->AppendInput(zone_, block);
277  }

References block(), and zone_.

Referenced by AddBranch(), AddGoto(), AddReturn(), and AddThrow().

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

◆ AddThrow()

void v8::internal::compiler::Schedule::AddThrow ( BasicBlock *  block,
Node *  input 
)
inline

Definition at line 265 of file schedule.h.

265  {
266  DCHECK(block->control_ == BasicBlock::kNone);
267  block->control_ = BasicBlock::kThrow;
268  SetControlInput(block, input);
269  if (block != end()) AddSuccessor(block, end());
270  }

References AddSuccessor(), block(), DCHECK, v8::internal::compiler::GenericGraph< BasicBlock >::end(), and SetControlInput().

+ Here is the call graph for this function:

◆ all_blocks()

BasicBlocks v8::internal::compiler::Schedule::all_blocks ( )
inline

Definition at line 192 of file schedule.h.

192 { return BasicBlocks(&all_blocks_); }
ContainerPointerWrapper< BasicBlockVector > BasicBlocks
Definition: schedule.h:189

References all_blocks_.

◆ BasicBlockCount()

int v8::internal::compiler::Schedule::BasicBlockCount ( ) const
inline

Definition at line 186 of file schedule.h.

186 { return NodeCount(); }

References v8::internal::compiler::GenericGraphBase::NodeCount().

Referenced by v8::internal::compiler::Scheduler::BuildCFG(), v8::internal::compiler::Scheduler::ComputeSpecialRPO(), and v8::internal::compiler::ScheduleVerifier::Run().

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

◆ block()

◆ GetBlockById()

BasicBlock* v8::internal::compiler::Schedule::GetBlockById ( int  block_id)
inline

Definition at line 184 of file schedule.h.

184 { return all_blocks_[block_id]; }

References all_blocks_.

Referenced by v8::internal::compiler::ScheduleVerifier::Run().

+ Here is the caller graph for this function:

◆ IsScheduled()

bool v8::internal::compiler::Schedule::IsScheduled ( Node *  node)
inline

Definition at line 178 of file schedule.h.

178  {
179  int length = static_cast<int>(nodeid_to_block_.size());
180  if (node->id() >= length) return false;
181  return nodeid_to_block_[node->id()] != NULL;
182  }

References nodeid_to_block_, and NULL.

Referenced by v8::internal::compiler::PrepareUsesVisitor::PostEdge(), v8::internal::compiler::PrepareUsesVisitor::Pre(), and v8::internal::compiler::ScheduleLateNodeVisitor::Pre().

+ Here is the caller graph for this function:

◆ NewBasicBlock()

BasicBlock* v8::internal::compiler::Schedule::NewBasicBlock ( )
inline

Definition at line 201 of file schedule.h.

201  {
202  BasicBlock* block =
203  BasicBlock::New(this, 0, static_cast<BasicBlock**>(NULL));
204  all_blocks_.push_back(block);
205  return block;
206  }

References all_blocks_, block(), and NULL.

Referenced by v8::internal::compiler::CFGBuilder::BuildBlockForNode(), v8::internal::compiler::RawMachineAssembler::EnsureBlock(), and Schedule().

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

◆ PlanNode()

void v8::internal::compiler::Schedule::PlanNode ( BasicBlock *  block,
Node *  node 
)
inline

Definition at line 210 of file schedule.h.

210  {
211  if (FLAG_trace_turbo_scheduler) {
212  PrintF("Planning #%d:%s for future add to B%d\n", node->id(),
213  node->op()->mnemonic(), block->id());
214  }
215  DCHECK(this->block(node) == NULL);
216  SetBlockForNode(block, node);
217  }

References block(), DCHECK, NULL, v8::internal::PrintF(), and SetBlockForNode().

Referenced by v8::internal::compiler::ScheduleLateNodeVisitor::ScheduleNode().

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

◆ rpo_order()

BasicBlockVector* v8::internal::compiler::Schedule::rpo_order ( )
inline

Definition at line 279 of file schedule.h.

279 { return &rpo_order_; }

References rpo_order_.

Referenced by v8::internal::compiler::Scheduler::ConnectFloatingControl(), v8::internal::compiler::RawMachineAssembler::Export(), v8::internal::compiler::BasicBlockInstrumentor::Instrument(), and v8::internal::compiler::ScheduleVerifier::Run().

+ Here is the caller graph for this function:

◆ RpoBlockCount()

int v8::internal::compiler::Schedule::RpoBlockCount ( ) const
inline

Definition at line 187 of file schedule.h.

187 { return static_cast<int>(rpo_order_.size()); }

References rpo_order_.

Referenced by v8::internal::compiler::BasicBlockInstrumentor::Instrument().

+ Here is the caller graph for this function:

◆ SameBasicBlock()

bool v8::internal::compiler::Schedule::SameBasicBlock ( Node *  a,
Node *  b 
) const
inline

Definition at line 195 of file schedule.h.

195  {
196  BasicBlock* block = this->block(a);
197  return block != NULL && block == this->block(b);
198  }

References block(), and NULL.

+ Here is the call graph for this function:

◆ SetBlockForNode()

void v8::internal::compiler::Schedule::SetBlockForNode ( BasicBlock *  block,
Node *  node 
)
inlineprivate

Definition at line 290 of file schedule.h.

290  {
291  int length = static_cast<int>(nodeid_to_block_.size());
292  if (node->id() >= length) {
293  nodeid_to_block_.resize(node->id() + 1);
294  }
295  nodeid_to_block_[node->id()] = block;
296  }

References block(), and nodeid_to_block_.

Referenced by AddBranch(), AddNode(), AddReturn(), v8::internal::compiler::BasicBlockInstrumentor::Instrument(), PlanNode(), and SetControlInput().

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

◆ SetControlInput()

void v8::internal::compiler::Schedule::SetControlInput ( BasicBlock *  block,
Node *  node 
)
inlineprivate

Definition at line 285 of file schedule.h.

285  {
286  block->control_input_ = node;
287  SetBlockForNode(block, node);
288  }

References block(), and SetBlockForNode().

Referenced by AddBranch(), AddReturn(), and AddThrow().

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

Friends And Related Function Documentation

◆ BasicBlockInstrumentor

friend class BasicBlockInstrumentor
friend

Definition at line 283 of file schedule.h.

◆ CodeGenerator

friend class CodeGenerator
friend

Definition at line 273 of file schedule.h.

◆ Scheduler

friend class Scheduler
friend

Definition at line 272 of file schedule.h.

◆ ScheduleVisualizer

friend class ScheduleVisualizer
friend

Definition at line 282 of file schedule.h.

Member Data Documentation

◆ all_blocks_

BasicBlockVector v8::internal::compiler::Schedule::all_blocks_
private

◆ nodeid_to_block_

BasicBlockVector v8::internal::compiler::Schedule::nodeid_to_block_
private

Definition at line 300 of file schedule.h.

Referenced by block(), IsScheduled(), Schedule(), and SetBlockForNode().

◆ rpo_order_

◆ zone_

Zone* v8::internal::compiler::Schedule::zone_
private

Definition at line 298 of file schedule.h.

Referenced by AddSuccessor().


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