| 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() { |
| 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 |
| 197 class HPredecessorIterator BASE_EMBEDDED { |
| 198 public: |
| 199 explicit HPredecessorIterator(HBasicBlock* block) |
| 200 : predecessor_list_(block->predecessors()), current_(0) { } |
| 201 |
| 202 bool Done() { return current_ >= predecessor_list_->length(); } |
| 203 HBasicBlock* Current() { return predecessor_list_->at(current_); } |
| 204 void Advance() { current_++; } |
| 205 |
| 206 private: |
| 207 const ZoneList<HBasicBlock*>* predecessor_list_; |
| 208 int current_; |
| 209 }; |
| 210 |
| 211 |
| 188 class HLoopInformation: public ZoneObject { | 212 class HLoopInformation: public ZoneObject { |
| 189 public: | 213 public: |
| 190 explicit HLoopInformation(HBasicBlock* loop_header) | 214 explicit HLoopInformation(HBasicBlock* loop_header) |
| 191 : back_edges_(4), | 215 : back_edges_(4), |
| 192 loop_header_(loop_header), | 216 loop_header_(loop_header), |
| 193 blocks_(8), | 217 blocks_(8), |
| 194 stack_check_(NULL) { | 218 stack_check_(NULL) { |
| 195 blocks_.Add(loop_header); | 219 blocks_.Add(loop_header); |
| 196 } | 220 } |
| 197 virtual ~HLoopInformation() {} | 221 virtual ~HLoopInformation() {} |
| (...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1275 const char* filename_; | 1299 const char* filename_; |
| 1276 HeapStringAllocator string_allocator_; | 1300 HeapStringAllocator string_allocator_; |
| 1277 StringStream trace_; | 1301 StringStream trace_; |
| 1278 int indent_; | 1302 int indent_; |
| 1279 }; | 1303 }; |
| 1280 | 1304 |
| 1281 | 1305 |
| 1282 } } // namespace v8::internal | 1306 } } // namespace v8::internal |
| 1283 | 1307 |
| 1284 #endif // V8_HYDROGEN_H_ | 1308 #endif // V8_HYDROGEN_H_ |
| OLD | NEW |