OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
119 | 119 |
120 void SetJoinId(int ast_id); | 120 void SetJoinId(int ast_id); |
121 | 121 |
122 void Finish(HControlInstruction* last); | 122 void Finish(HControlInstruction* last); |
123 void FinishExit(HControlInstruction* instruction); | 123 void FinishExit(HControlInstruction* instruction); |
124 void Goto(HBasicBlock* block, bool drop_extra = false); | 124 void Goto(HBasicBlock* block, bool drop_extra = false); |
125 | 125 |
126 int PredecessorIndexOf(HBasicBlock* predecessor) const; | 126 int PredecessorIndexOf(HBasicBlock* predecessor) const; |
127 void AddSimulate(int ast_id) { AddInstruction(CreateSimulate(ast_id)); } | 127 void AddSimulate(int ast_id) { AddInstruction(CreateSimulate(ast_id)); } |
128 void AssignCommonDominator(HBasicBlock* other); | 128 void AssignCommonDominator(HBasicBlock* other); |
129 void AssignLoopSuccessorDominators(); | |
129 | 130 |
130 void FinishExitWithDeoptimization(HDeoptimize::UseEnvironment has_uses) { | 131 void FinishExitWithDeoptimization(HDeoptimize::UseEnvironment has_uses) { |
131 FinishExit(CreateDeoptimize(has_uses)); | 132 FinishExit(CreateDeoptimize(has_uses)); |
132 } | 133 } |
133 | 134 |
134 // Add the inlined function exit sequence, adding an HLeaveInlined | 135 // Add the inlined function exit sequence, adding an HLeaveInlined |
135 // instruction and updating the bailout environment. | 136 // instruction and updating the bailout environment. |
136 void AddLeaveInlined(HValue* return_value, | 137 void AddLeaveInlined(HValue* return_value, |
137 HBasicBlock* target, | 138 HBasicBlock* target, |
138 bool drop_extra = false); | 139 bool drop_extra = false); |
139 | 140 |
140 // If a target block is tagged as an inline function return, all | 141 // If a target block is tagged as an inline function return, all |
141 // predecessors should contain the inlined exit sequence: | 142 // predecessors should contain the inlined exit sequence: |
142 // | 143 // |
143 // LeaveInlined | 144 // LeaveInlined |
144 // Simulate (caller's environment) | 145 // Simulate (caller's environment) |
145 // Goto (target block) | 146 // Goto (target block) |
146 bool IsInlineReturnTarget() const { return is_inline_return_target_; } | 147 bool IsInlineReturnTarget() const { return is_inline_return_target_; } |
147 void MarkAsInlineReturnTarget() { is_inline_return_target_ = true; } | 148 void MarkAsInlineReturnTarget() { is_inline_return_target_ = true; } |
148 | 149 |
149 bool IsDeoptimizing() const { return is_deoptimizing_; } | 150 bool IsDeoptimizing() const { return is_deoptimizing_; } |
150 void MarkAsDeoptimizing() { is_deoptimizing_ = true; } | 151 void MarkAsDeoptimizing() { is_deoptimizing_ = true; } |
151 | 152 |
153 bool IsLoopSuccessorDominator() const { | |
154 return dominates_loop_successors_; | |
155 } | |
156 void MarkAsLoopSuccessorDominator() { | |
fschneider
2012/02/02 14:59:50
Please add output to --trace-hydrogen so that you
danno
2012/02/06 16:54:57
Done.
| |
157 dominates_loop_successors_ = true; | |
158 } | |
159 | |
152 inline Zone* zone(); | 160 inline Zone* zone(); |
153 | 161 |
154 #ifdef DEBUG | 162 #ifdef DEBUG |
155 void Verify(); | 163 void Verify(); |
156 #endif | 164 #endif |
157 | 165 |
158 private: | 166 private: |
159 void RegisterPredecessor(HBasicBlock* pred); | 167 void RegisterPredecessor(HBasicBlock* pred); |
160 void AddDominatedBlock(HBasicBlock* block); | 168 void AddDominatedBlock(HBasicBlock* block); |
161 | 169 |
(...skipping 13 matching lines...) Expand all Loading... | |
175 HEnvironment* last_environment_; | 183 HEnvironment* last_environment_; |
176 // Outgoing parameter count at block exit, set during lithium translation. | 184 // Outgoing parameter count at block exit, set during lithium translation. |
177 int argument_count_; | 185 int argument_count_; |
178 // Instruction indices into the lithium code stream. | 186 // Instruction indices into the lithium code stream. |
179 int first_instruction_index_; | 187 int first_instruction_index_; |
180 int last_instruction_index_; | 188 int last_instruction_index_; |
181 ZoneList<int> deleted_phis_; | 189 ZoneList<int> deleted_phis_; |
182 HBasicBlock* parent_loop_header_; | 190 HBasicBlock* parent_loop_header_; |
183 bool is_inline_return_target_; | 191 bool is_inline_return_target_; |
184 bool is_deoptimizing_; | 192 bool is_deoptimizing_; |
193 bool dominates_loop_successors_; | |
185 }; | 194 }; |
186 | 195 |
187 | 196 |
188 class HLoopInformation: public ZoneObject { | 197 class HLoopInformation: public ZoneObject { |
189 public: | 198 public: |
190 explicit HLoopInformation(HBasicBlock* loop_header) | 199 explicit HLoopInformation(HBasicBlock* loop_header) |
191 : back_edges_(4), | 200 : back_edges_(4), |
192 loop_header_(loop_header), | 201 loop_header_(loop_header), |
193 blocks_(8), | 202 blocks_(8), |
194 stack_check_(NULL) { | 203 stack_check_(NULL) { |
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1275 const char* filename_; | 1284 const char* filename_; |
1276 HeapStringAllocator string_allocator_; | 1285 HeapStringAllocator string_allocator_; |
1277 StringStream trace_; | 1286 StringStream trace_; |
1278 int indent_; | 1287 int indent_; |
1279 }; | 1288 }; |
1280 | 1289 |
1281 | 1290 |
1282 } } // namespace v8::internal | 1291 } } // namespace v8::internal |
1283 | 1292 |
1284 #endif // V8_HYDROGEN_H_ | 1293 #endif // V8_HYDROGEN_H_ |
OLD | NEW |