Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1148)

Side by Side Diff: src/hydrogen-flow-engine.h

Issue 137783011: Revert "Eliminatable CheckMaps replaced with if(true) or if(false)." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/hydrogen-check-elimination.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 SetStateAt(root, initial); 117 SetStateAt(root, initial);
118 118
119 // Iterate all dominated blocks starting from the given start block. 119 // Iterate all dominated blocks starting from the given start block.
120 for (int i = root->block_id(); i < graph_->blocks()->length(); i++) { 120 for (int i = root->block_id(); i < graph_->blocks()->length(); i++) {
121 HBasicBlock* block = graph_->blocks()->at(i); 121 HBasicBlock* block = graph_->blocks()->at(i);
122 122
123 // Skip blocks not dominated by the root node. 123 // Skip blocks not dominated by the root node.
124 if (SkipNonDominatedBlock(root, block)) continue; 124 if (SkipNonDominatedBlock(root, block)) continue;
125 State* state = StateAt(block); 125 State* state = StateAt(block);
126 126
127 if (block->IsReachable()) { 127 if (block->IsLoopHeader()) {
128 if (block->IsLoopHeader()) { 128 // Apply loop effects before analyzing loop body.
129 // Apply loop effects before analyzing loop body. 129 ComputeLoopEffects(block)->Apply(state);
130 ComputeLoopEffects(block)->Apply(state); 130 } else {
131 } else { 131 // Must have visited all predecessors before this block.
132 // Must have visited all predecessors before this block. 132 CheckPredecessorCount(block);
133 CheckPredecessorCount(block); 133 }
134 }
135 134
136 // Go through all instructions of the current block, updating the state. 135 // Go through all instructions of the current block, updating the state.
137 for (HInstructionIterator it(block); !it.Done(); it.Advance()) { 136 for (HInstructionIterator it(block); !it.Done(); it.Advance()) {
138 state = state->Process(it.Current(), zone_); 137 state = state->Process(it.Current(), zone_);
139 }
140 } 138 }
141 139
142 // Propagate the block state forward to all successor blocks. 140 // Propagate the block state forward to all successor blocks.
143 int max = block->end()->SuccessorCount(); 141 int max = block->end()->SuccessorCount();
144 for (int i = 0; i < max; i++) { 142 for (int i = 0; i < max; i++) {
145 HBasicBlock* succ = block->end()->SuccessorAt(i); 143 HBasicBlock* succ = block->end()->SuccessorAt(i);
146 IncrementPredecessorCount(succ); 144 IncrementPredecessorCount(succ);
147 if (StateAt(succ) == NULL) { 145 if (StateAt(succ) == NULL) {
148 // This is the first state to reach the successor. 146 // This is the first state to reach the successor.
149 if (max == 1 && succ->predecessors()->length() == 1) { 147 if (max == 1 && succ->predecessors()->length() == 1) {
(...skipping 30 matching lines...) Expand all
180 HBasicBlock* member = graph_->blocks()->at(i); 178 HBasicBlock* member = graph_->blocks()->at(i);
181 if (i != block->block_id() && member->IsLoopHeader()) { 179 if (i != block->block_id() && member->IsLoopHeader()) {
182 // Recursively compute and cache the effects of the nested loop. 180 // Recursively compute and cache the effects of the nested loop.
183 ASSERT(member->loop_information()->parent_loop() == loop); 181 ASSERT(member->loop_information()->parent_loop() == loop);
184 Effects* nested = ComputeLoopEffects(member); 182 Effects* nested = ComputeLoopEffects(member);
185 effects->Union(nested, zone_); 183 effects->Union(nested, zone_);
186 // Skip the nested loop's blocks. 184 // Skip the nested loop's blocks.
187 i = member->loop_information()->GetLastBackEdge()->block_id(); 185 i = member->loop_information()->GetLastBackEdge()->block_id();
188 } else { 186 } else {
189 // Process all the effects of the block. 187 // Process all the effects of the block.
190 if (member->IsUnreachable()) continue;
191 ASSERT(member->current_loop() == loop); 188 ASSERT(member->current_loop() == loop);
192 for (HInstructionIterator it(member); !it.Done(); it.Advance()) { 189 for (HInstructionIterator it(member); !it.Done(); it.Advance()) {
193 effects->Process(it.Current(), zone_); 190 effects->Process(it.Current(), zone_);
194 } 191 }
195 } 192 }
196 } 193 }
197 return effects; 194 return effects;
198 } 195 }
199 196
200 inline bool SkipNonDominatedBlock(HBasicBlock* root, HBasicBlock* other) { 197 inline bool SkipNonDominatedBlock(HBasicBlock* root, HBasicBlock* other) {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 ZoneList<int> pred_counts_; // Finished predecessors (by block id). 233 ZoneList<int> pred_counts_; // Finished predecessors (by block id).
237 #endif 234 #endif
238 ZoneList<State*> block_states_; // Block states (by block id). 235 ZoneList<State*> block_states_; // Block states (by block id).
239 ZoneList<Effects*> loop_effects_; // Loop effects (by block id). 236 ZoneList<Effects*> loop_effects_; // Loop effects (by block id).
240 }; 237 };
241 238
242 239
243 } } // namespace v8::internal 240 } } // namespace v8::internal
244 241
245 #endif // V8_HYDROGEN_FLOW_ENGINE_H_ 242 #endif // V8_HYDROGEN_FLOW_ENGINE_H_
OLDNEW
« no previous file with comments | « src/hydrogen-check-elimination.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698