5 #ifndef V8_COMPILER_SCHEDULE_H_
6 #define V8_COMPILER_SCHEDULE_H_
25 class BasicBlockInstrumentor;
27 class ConstructScheduleData;
96 class BasicBlock
FINAL :
public GenericNode<BasicBlockData, BasicBlock> {
114 BasicBlock::Predecessors predecessors = this->predecessors();
115 for (BasicBlock::Predecessors::iterator
i = predecessors.begin();
116 i != predecessors.end(); ++
i) {
117 if (*
i == predecessor)
return i.index();
123 return static_cast<BasicBlock*
>(loop_header_);
126 if (IsLoopHeader())
return this;
127 return static_cast<BasicBlock*
>(loop_header_);
171 BasicBlock*
block(Node* node)
const {
180 if (node->id() >= length)
return false;
203 BasicBlock::New(
this, 0,
static_cast<BasicBlock**
>(
NULL));
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());
221 if (FLAG_trace_turbo_scheduler) {
222 PrintF(
"Adding #%d:%s to B%d\n", node->id(), node->op()->mnemonic(),
226 block->nodes_.push_back(node);
233 block->control_ = BasicBlock::kGoto;
239 BasicBlock* fblock) {
241 DCHECK(branch->opcode() == IrOpcode::kBranch);
242 block->control_ = BasicBlock::kBranch;
246 if (branch->opcode() == IrOpcode::kBranch) {
255 block->control_ = BasicBlock::kReturn;
258 if (input->opcode() == IrOpcode::kReturn) {
267 block->control_ = BasicBlock::kThrow;
286 block->control_input_ = node;
292 if (node->id() >= length) {
Source to read snapshot and builtins files from.
bool IsLoopHeader() const
BasicBlock * loop_header_
bool LoopContains(BasicBlockData *block) const
BasicBlockData(Zone *zone)
int last_instruction_index()
int first_instruction_index()
const_iterator end() const
BasicBlock * ContainingLoop()
Predecessors predecessors()
reverse_iterator rbegin()
BasicBlock * PredecessorAt(int index)
int PredecessorIndexOf(BasicBlock *predecessor)
DISALLOW_COPY_AND_ASSIGN(BasicBlock)
NodeVector::const_iterator const_iterator
InstructionDeque::const_iterator const_iterator
BasicBlock * SuccessorAt(int index)
const_iterator begin() const
NodeVector::reverse_iterator reverse_iterator
BasicBlock(GenericGraphBase *graph, int input_count)
BasicBlock * loop_header()
NodeVector::iterator iterator
void SetEnd(BasicBlock *end)
void SetStart(BasicBlock *start)
void SetBlockForNode(BasicBlock *block, Node *node)
ContainerPointerWrapper< BasicBlockVector > BasicBlocks
void AddThrow(BasicBlock *block, Node *input)
void PlanNode(BasicBlock *block, Node *node)
void AddGoto(BasicBlock *block, BasicBlock *succ)
friend class ScheduleVisualizer
void AddSuccessor(BasicBlock *block, BasicBlock *succ)
void AddReturn(BasicBlock *block, Node *input)
int BasicBlockCount() const
BasicBlockVector all_blocks_
BasicBlock * GetBlockById(int block_id)
BasicBlock * NewBasicBlock()
bool SameBasicBlock(Node *a, Node *b) const
void AddBranch(BasicBlock *block, Node *branch, BasicBlock *tblock, BasicBlock *fblock)
BasicBlockVector nodeid_to_block_
void SetControlInput(BasicBlock *block, Node *node)
void AddNode(BasicBlock *block, Node *node)
bool IsScheduled(Node *node)
int RpoBlockCount() const
BasicBlock * block(Node *node) const
BasicBlockVector * rpo_order()
Schedule(Zone *zone, size_t node_count_hint=0)
BasicBlockVector rpo_order_
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
#define DCHECK(condition)
ZoneVector< BasicBlock * > BasicBlockVector
std::ostream & operator<<(std::ostream &os, const MachineType &type)
BasicBlockVector::iterator BasicBlockVectorIter
BasicBlockVector::reverse_iterator BasicBlockVectorRIter
GenericGraphVisit::NullNodeVisitor< BasicBlockData, BasicBlock > NullBasicBlockVisitor
void PrintF(const char *format,...)
Debugger support for the V8 JavaScript engine.