296 const int count = schedule->BasicBlockCount();
297 Zone tmp_zone(schedule->zone()->isolate());
298 Zone* zone = &tmp_zone;
299 BasicBlock* start = schedule->start();
303 CHECK_GE(count,
static_cast<int>(rpo_order->size()));
304 for (BasicBlockVector::iterator b = rpo_order->begin(); b != rpo_order->end();
306 CHECK_EQ((*b), schedule->GetBlockById((*b)->id()));
311 for (
size_t b = 0; b < rpo_order->size(); b++) {
312 BasicBlock* block = rpo_order->at(b);
313 CHECK_EQ(
static_cast<int>(b), block->rpo_number_);
314 BasicBlock* dom = block->dominator_;
321 CHECK_LT(dom->rpo_number_, block->rpo_number_);
328 ZoneQueue<BasicBlock*> queue(zone);
330 marked[start->id()] =
true;
331 while (!queue.empty()) {
332 BasicBlock* block = queue.front();
334 for (
int s = 0; s < block->SuccessorCount(); s++) {
335 BasicBlock* succ = block->SuccessorAt(s);
336 if (!marked[succ->id()]) {
337 marked[succ->id()] =
true;
344 for (
int i = 0;
i < count;
i++) {
345 BasicBlock* block = schedule->GetBlockById(
i);
348 CHECK_EQ(block, rpo_order->at(block->rpo_number_));
352 for (
size_t b = 0; b < rpo_order->size(); b++) {
353 CHECK(marked[rpo_order->at(b)->id()]);
358 ZoneList<BitVector*> dominators(count, zone);
359 dominators.Initialize(count, zone);
360 dominators.AddBlock(
NULL, count, zone);
364 ZoneQueue<BasicBlock*> queue(zone);
366 dominators[start->id()] =
new (zone) BitVector(count, zone);
367 while (!queue.empty()) {
368 BasicBlock* block = queue.front();
370 BitVector* block_doms = dominators[block->id()];
371 BasicBlock* idom = block->dominator_;
372 if (idom !=
NULL && !block_doms->Contains(idom->id())) {
373 V8_Fatal(__FILE__, __LINE__,
"Block B%d is not dominated by B%d",
374 block->id(), idom->id());
376 for (
int s = 0; s < block->SuccessorCount(); s++) {
377 BasicBlock* succ = block->SuccessorAt(s);
378 BitVector* succ_doms = dominators[succ->id()];
380 if (succ_doms ==
NULL) {
382 succ_doms =
new (zone) BitVector(count, zone);
383 succ_doms->CopyFrom(*block_doms);
384 succ_doms->Add(block->id());
385 dominators[succ->id()] = succ_doms;
389 bool had = succ_doms->Contains(block->id());
390 if (had) succ_doms->Remove(block->id());
391 if (succ_doms->IntersectIsChanged(*block_doms)) queue.push(succ);
392 if (had) succ_doms->Add(block->id());
398 for (BasicBlockVector::iterator b = rpo_order->begin();
399 b != rpo_order->end(); ++b) {
400 BasicBlock* block = *b;
401 BasicBlock* idom = block->dominator_;
402 if (idom ==
NULL)
continue;
403 BitVector* block_doms = dominators[block->id()];
405 for (BitVector::Iterator it(block_doms); !it.Done(); it.Advance()) {
406 BasicBlock* dom = schedule->GetBlockById(it.Current());
407 if (dom != idom && !dominators[idom->id()]->Contains(dom->id())) {
409 "Block B%d is not immediately dominated by B%d", block->id(),
417 for (BasicBlockVector::iterator b = rpo_order->begin(); b != rpo_order->end();
419 for (BasicBlock::const_iterator
i = (*b)->begin();
i != (*b)->end(); ++
i) {
421 if (phi->opcode() != IrOpcode::kPhi)
continue;
424 if (phi->InputCount() >
427 CHECK(control->opcode() == IrOpcode::kMerge ||
428 control->opcode() == IrOpcode::kLoop);
429 CHECK_EQ((*b), schedule->block(control));
435 for (BasicBlockVector::iterator b = rpo_order->begin(); b != rpo_order->end();
437 BasicBlock* block = *b;
440 Node* control = block->control_input_;
441 if (control !=
NULL) {
442 CHECK_EQ(block, schedule->block(control));
444 static_cast<int>(block->nodes_.size()) - 1);
447 for (
size_t i = 0;
i < block->nodes_.size();
i++) {
448 Node* node = block->nodes_[
i];
static Node * GetControlInput(Node *node, int index=0)
static int GetValueInputCount(const Operator *op)
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 V8_Fatal(const char *file, int line, const char *format,...)
#define CHECK_EQ(expected, value)
#define CHECK_NE(unexpected, value)
ZoneVector< BasicBlock * > BasicBlockVector
static void CheckInputsDominate(Schedule *schedule, BasicBlock *block, Node *node, int use_pos)
ZoneVector< bool > BoolVector