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

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

Issue 27166003: Return the new state from local analysis in flow-engine. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 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 | « no previous file | no next file » | 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 loop_effects_(graph->blocks()->length(), zone) { 100 loop_effects_(graph->blocks()->length(), zone) {
101 loop_effects_.AddBlock(NULL, graph_->blocks()->length(), zone); 101 loop_effects_.AddBlock(NULL, graph_->blocks()->length(), zone);
102 } 102 }
103 103
104 // Local analysis. Iterates over the instructions in the given block. 104 // Local analysis. Iterates over the instructions in the given block.
105 State* AnalyzeOneBlock(HBasicBlock* block, State* state) { 105 State* AnalyzeOneBlock(HBasicBlock* block, State* state) {
106 // Go through all instructions of the current block, updating the state. 106 // Go through all instructions of the current block, updating the state.
107 for (HInstructionIterator it(block); !it.Done(); it.Advance()) { 107 for (HInstructionIterator it(block); !it.Done(); it.Advance()) {
108 state = state->Process(it.Current(), zone_); 108 state = state->Process(it.Current(), zone_);
109 } 109 }
110 return StateAt(block); 110 return state;
111 } 111 }
112 112
113 // Global analysis. Iterates over all blocks that are dominated by the given 113 // Global analysis. Iterates over all blocks that are dominated by the given
114 // block, starting with the initial state. Computes effects for nested loops. 114 // block, starting with the initial state. Computes effects for nested loops.
115 void AnalyzeDominatedBlocks(HBasicBlock* root, State* initial) { 115 void AnalyzeDominatedBlocks(HBasicBlock* root, State* initial) {
116 InitializeStates(); 116 InitializeStates();
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++) {
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 ZoneList<int> pred_counts_; // Finished predecessors (by block id). 226 ZoneList<int> pred_counts_; // Finished predecessors (by block id).
227 #endif 227 #endif
228 ZoneList<State*> block_states_; // Block states (by block id). 228 ZoneList<State*> block_states_; // Block states (by block id).
229 ZoneList<Effects*> loop_effects_; // Loop effects (by block id). 229 ZoneList<Effects*> loop_effects_; // Loop effects (by block id).
230 }; 230 };
231 231
232 232
233 } } // namespace v8::internal 233 } } // namespace v8::internal
234 234
235 #endif // V8_HYDROGEN_FLOW_ENGINE_H_ 235 #endif // V8_HYDROGEN_FLOW_ENGINE_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698