| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 ASSERT(parent_loop_header_ == NULL); | 113 ASSERT(parent_loop_header_ == NULL); |
| 114 parent_loop_header_ = block; | 114 parent_loop_header_ = block; |
| 115 } | 115 } |
| 116 | 116 |
| 117 bool HasParentLoopHeader() const { return parent_loop_header_ != NULL; } | 117 bool HasParentLoopHeader() const { return parent_loop_header_ != NULL; } |
| 118 | 118 |
| 119 void SetJoinId(int id); | 119 void SetJoinId(int id); |
| 120 | 120 |
| 121 void Finish(HControlInstruction* last); | 121 void Finish(HControlInstruction* last); |
| 122 void FinishExit(HControlInstruction* instruction); | 122 void FinishExit(HControlInstruction* instruction); |
| 123 void Goto(HBasicBlock* block, bool include_stack_check = false); | 123 void Goto(HBasicBlock* block); |
| 124 | 124 |
| 125 int PredecessorIndexOf(HBasicBlock* predecessor) const; | 125 int PredecessorIndexOf(HBasicBlock* predecessor) const; |
| 126 void AddSimulate(int id) { AddInstruction(CreateSimulate(id)); } | 126 void AddSimulate(int id) { AddInstruction(CreateSimulate(id)); } |
| 127 void AssignCommonDominator(HBasicBlock* other); | 127 void AssignCommonDominator(HBasicBlock* other); |
| 128 | 128 |
| 129 void FinishExitWithDeoptimization(HDeoptimize::UseEnvironment has_uses) { | 129 void FinishExitWithDeoptimization(HDeoptimize::UseEnvironment has_uses) { |
| 130 FinishExit(CreateDeoptimize(has_uses)); | 130 FinishExit(CreateDeoptimize(has_uses)); |
| 131 } | 131 } |
| 132 | 132 |
| 133 // Add the inlined function exit sequence, adding an HLeaveInlined | 133 // Add the inlined function exit sequence, adding an HLeaveInlined |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 ZoneList<int> deleted_phis_; | 178 ZoneList<int> deleted_phis_; |
| 179 HBasicBlock* parent_loop_header_; | 179 HBasicBlock* parent_loop_header_; |
| 180 bool is_inline_return_target_; | 180 bool is_inline_return_target_; |
| 181 bool is_deoptimizing_; | 181 bool is_deoptimizing_; |
| 182 }; | 182 }; |
| 183 | 183 |
| 184 | 184 |
| 185 class HLoopInformation: public ZoneObject { | 185 class HLoopInformation: public ZoneObject { |
| 186 public: | 186 public: |
| 187 explicit HLoopInformation(HBasicBlock* loop_header) | 187 explicit HLoopInformation(HBasicBlock* loop_header) |
| 188 : back_edges_(4), loop_header_(loop_header), blocks_(8) { | 188 : back_edges_(4), |
| 189 loop_header_(loop_header), |
| 190 blocks_(8), |
| 191 stack_check_(NULL) { |
| 189 blocks_.Add(loop_header); | 192 blocks_.Add(loop_header); |
| 190 } | 193 } |
| 191 virtual ~HLoopInformation() {} | 194 virtual ~HLoopInformation() {} |
| 192 | 195 |
| 193 const ZoneList<HBasicBlock*>* back_edges() const { return &back_edges_; } | 196 const ZoneList<HBasicBlock*>* back_edges() const { return &back_edges_; } |
| 194 const ZoneList<HBasicBlock*>* blocks() const { return &blocks_; } | 197 const ZoneList<HBasicBlock*>* blocks() const { return &blocks_; } |
| 195 HBasicBlock* loop_header() const { return loop_header_; } | 198 HBasicBlock* loop_header() const { return loop_header_; } |
| 196 HBasicBlock* GetLastBackEdge() const; | 199 HBasicBlock* GetLastBackEdge() const; |
| 197 void RegisterBackEdge(HBasicBlock* block); | 200 void RegisterBackEdge(HBasicBlock* block); |
| 198 | 201 |
| 202 HStackCheck* stack_check() const { return stack_check_; } |
| 203 void set_stack_check(HStackCheck* stack_check) { |
| 204 stack_check_ = stack_check; |
| 205 } |
| 206 |
| 199 private: | 207 private: |
| 200 void AddBlock(HBasicBlock* block); | 208 void AddBlock(HBasicBlock* block); |
| 201 | 209 |
| 202 ZoneList<HBasicBlock*> back_edges_; | 210 ZoneList<HBasicBlock*> back_edges_; |
| 203 HBasicBlock* loop_header_; | 211 HBasicBlock* loop_header_; |
| 204 ZoneList<HBasicBlock*> blocks_; | 212 ZoneList<HBasicBlock*> blocks_; |
| 213 HStackCheck* stack_check_; |
| 205 }; | 214 }; |
| 206 | 215 |
| 207 | 216 |
| 208 class HGraph: public ZoneObject { | 217 class HGraph: public ZoneObject { |
| 209 public: | 218 public: |
| 210 explicit HGraph(CompilationInfo* info); | 219 explicit HGraph(CompilationInfo* info); |
| 211 | 220 |
| 212 Isolate* isolate() { return isolate_; } | 221 Isolate* isolate() { return isolate_; } |
| 213 Zone* zone() { return isolate_->zone(); } | 222 Zone* zone() { return isolate_->zone(); } |
| 214 | 223 |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 void VisitBitNot(UnaryOperation* expr); | 773 void VisitBitNot(UnaryOperation* expr); |
| 765 void VisitNot(UnaryOperation* expr); | 774 void VisitNot(UnaryOperation* expr); |
| 766 | 775 |
| 767 void VisitComma(BinaryOperation* expr); | 776 void VisitComma(BinaryOperation* expr); |
| 768 void VisitLogicalExpression(BinaryOperation* expr); | 777 void VisitLogicalExpression(BinaryOperation* expr); |
| 769 void VisitArithmeticExpression(BinaryOperation* expr); | 778 void VisitArithmeticExpression(BinaryOperation* expr); |
| 770 | 779 |
| 771 void PreProcessOsrEntry(IterationStatement* statement); | 780 void PreProcessOsrEntry(IterationStatement* statement); |
| 772 // True iff. we are compiling for OSR and the statement is the entry. | 781 // True iff. we are compiling for OSR and the statement is the entry. |
| 773 bool HasOsrEntryAt(IterationStatement* statement); | 782 bool HasOsrEntryAt(IterationStatement* statement); |
| 783 void VisitLoopBody(Statement* body, |
| 784 HBasicBlock* loop_entry, |
| 785 BreakAndContinueInfo* break_info); |
| 774 | 786 |
| 775 HBasicBlock* CreateJoin(HBasicBlock* first, | 787 HBasicBlock* CreateJoin(HBasicBlock* first, |
| 776 HBasicBlock* second, | 788 HBasicBlock* second, |
| 777 int join_id); | 789 int join_id); |
| 778 | 790 |
| 779 // Create a back edge in the flow graph. body_exit is the predecessor | 791 // Create a back edge in the flow graph. body_exit is the predecessor |
| 780 // block and loop_entry is the successor block. loop_successor is the | 792 // block and loop_entry is the successor block. loop_successor is the |
| 781 // block where control flow exits the loop normally (e.g., via failure of | 793 // block where control flow exits the loop normally (e.g., via failure of |
| 782 // the condition) and break_block is the block where control flow breaks | 794 // the condition) and break_block is the block where control flow breaks |
| 783 // from the loop. All blocks except loop_entry can be NULL. The return | 795 // from the loop. All blocks except loop_entry can be NULL. The return |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1200 const char* filename_; | 1212 const char* filename_; |
| 1201 HeapStringAllocator string_allocator_; | 1213 HeapStringAllocator string_allocator_; |
| 1202 StringStream trace_; | 1214 StringStream trace_; |
| 1203 int indent_; | 1215 int indent_; |
| 1204 }; | 1216 }; |
| 1205 | 1217 |
| 1206 | 1218 |
| 1207 } } // namespace v8::internal | 1219 } } // namespace v8::internal |
| 1208 | 1220 |
| 1209 #endif // V8_HYDROGEN_H_ | 1221 #endif // V8_HYDROGEN_H_ |
| OLD | NEW |