| Index: src/hydrogen-flow-engine.h
|
| diff --git a/src/hydrogen-flow-engine.h b/src/hydrogen-flow-engine.h
|
| index 4e1275546f611e2401e467484976f73d59b3e784..99a2f841a7b9ddf41c0af851f6e16e7ff9abbbc5 100644
|
| --- a/src/hydrogen-flow-engine.h
|
| +++ b/src/hydrogen-flow-engine.h
|
| @@ -122,19 +122,22 @@ class HFlowEngine {
|
|
|
| // Skip blocks not dominated by the root node.
|
| if (SkipNonDominatedBlock(root, block)) continue;
|
| - State* state = StateAt(block);
|
| + State* state = State::Finish(StateAt(block), block, zone_);
|
|
|
| - if (block->IsLoopHeader()) {
|
| - // Apply loop effects before analyzing loop body.
|
| - ComputeLoopEffects(block)->Apply(state);
|
| - } else {
|
| - // Must have visited all predecessors before this block.
|
| - CheckPredecessorCount(block);
|
| - }
|
| + if (block->IsReachable()) {
|
| + ASSERT(state != NULL);
|
| + if (block->IsLoopHeader()) {
|
| + // Apply loop effects before analyzing loop body.
|
| + ComputeLoopEffects(block)->Apply(state);
|
| + } else {
|
| + // Must have visited all predecessors before this block.
|
| + CheckPredecessorCount(block);
|
| + }
|
|
|
| - // Go through all instructions of the current block, updating the state.
|
| - for (HInstructionIterator it(block); !it.Done(); it.Advance()) {
|
| - state = state->Process(it.Current(), zone_);
|
| + // Go through all instructions of the current block, updating the state.
|
| + for (HInstructionIterator it(block); !it.Done(); it.Advance()) {
|
| + state = state->Process(it.Current(), zone_);
|
| + }
|
| }
|
|
|
| // Propagate the block state forward to all successor blocks.
|
| @@ -142,18 +145,14 @@ class HFlowEngine {
|
| for (int i = 0; i < max; i++) {
|
| HBasicBlock* succ = block->end()->SuccessorAt(i);
|
| IncrementPredecessorCount(succ);
|
| - if (StateAt(succ) == NULL) {
|
| - // This is the first state to reach the successor.
|
| - if (max == 1 && succ->predecessors()->length() == 1) {
|
| - // Optimization: successor can inherit this state.
|
| - SetStateAt(succ, state);
|
| - } else {
|
| - // Successor needs a copy of the state.
|
| - SetStateAt(succ, state->Copy(succ, zone_));
|
| - }
|
| +
|
| + if (max == 1 && succ->predecessors()->length() == 1) {
|
| + // Optimization: successor can inherit this state.
|
| + SetStateAt(succ, state);
|
| } else {
|
| // Merge the current state with the state already at the successor.
|
| - SetStateAt(succ, state->Merge(succ, StateAt(succ), zone_));
|
| + SetStateAt(succ,
|
| + State::Merge(StateAt(succ), succ, state, block, zone_));
|
| }
|
| }
|
| }
|
| @@ -185,6 +184,7 @@ class HFlowEngine {
|
| i = member->loop_information()->GetLastBackEdge()->block_id();
|
| } else {
|
| // Process all the effects of the block.
|
| + if (member->IsUnreachable()) continue;
|
| ASSERT(member->current_loop() == loop);
|
| for (HInstructionIterator it(member); !it.Done(); it.Advance()) {
|
| effects->Process(it.Current(), zone_);
|
|
|