| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 void UpdateEnvironment(HEnvironment* env) { last_environment_ = env; } | 111 void UpdateEnvironment(HEnvironment* env) { last_environment_ = env; } |
| 112 HBasicBlock* parent_loop_header() const { return parent_loop_header_; } | 112 HBasicBlock* parent_loop_header() const { return parent_loop_header_; } |
| 113 | 113 |
| 114 void set_parent_loop_header(HBasicBlock* block) { | 114 void set_parent_loop_header(HBasicBlock* block) { |
| 115 ASSERT(parent_loop_header_ == NULL); | 115 ASSERT(parent_loop_header_ == NULL); |
| 116 parent_loop_header_ = block; | 116 parent_loop_header_ = block; |
| 117 } | 117 } |
| 118 | 118 |
| 119 bool HasParentLoopHeader() const { return parent_loop_header_ != NULL; } | 119 bool HasParentLoopHeader() const { return parent_loop_header_ != NULL; } |
| 120 | 120 |
| 121 // Returns header of the innermost loop containing this block. |
| 122 // Returns the block itself if it is a loop header. |
| 123 HBasicBlock* LoopHeader() { |
| 124 return IsLoopHeader() ? this : parent_loop_header(); |
| 125 } |
| 126 |
| 121 void SetJoinId(BailoutId ast_id); | 127 void SetJoinId(BailoutId ast_id); |
| 122 | 128 |
| 123 void Finish(HControlInstruction* last); | 129 void Finish(HControlInstruction* last); |
| 124 void FinishExit(HControlInstruction* instruction); | 130 void FinishExit(HControlInstruction* instruction); |
| 125 void Goto(HBasicBlock* block, FunctionState* state = NULL); | 131 void Goto(HBasicBlock* block, FunctionState* state = NULL); |
| 126 | 132 |
| 127 int PredecessorIndexOf(HBasicBlock* predecessor) const; | 133 int PredecessorIndexOf(HBasicBlock* predecessor) const; |
| 128 void AddSimulate(BailoutId ast_id, | 134 void AddSimulate(BailoutId ast_id, |
| 129 RemovableSimulate removable = FIXED_SIMULATE) { | 135 RemovableSimulate removable = FIXED_SIMULATE) { |
| 130 AddInstruction(CreateSimulate(ast_id, removable)); | 136 AddInstruction(CreateSimulate(ast_id, removable)); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 int current_; | 216 int current_; |
| 211 }; | 217 }; |
| 212 | 218 |
| 213 | 219 |
| 214 class HLoopInformation: public ZoneObject { | 220 class HLoopInformation: public ZoneObject { |
| 215 public: | 221 public: |
| 216 HLoopInformation(HBasicBlock* loop_header, Zone* zone) | 222 HLoopInformation(HBasicBlock* loop_header, Zone* zone) |
| 217 : back_edges_(4, zone), | 223 : back_edges_(4, zone), |
| 218 loop_header_(loop_header), | 224 loop_header_(loop_header), |
| 219 blocks_(8, zone), | 225 blocks_(8, zone), |
| 220 stack_check_(NULL) { | 226 stack_check_(NULL), |
| 227 exit_block_(NULL) { |
| 221 blocks_.Add(loop_header, zone); | 228 blocks_.Add(loop_header, zone); |
| 222 } | 229 } |
| 223 virtual ~HLoopInformation() {} | 230 virtual ~HLoopInformation() {} |
| 224 | 231 |
| 225 const ZoneList<HBasicBlock*>* back_edges() const { return &back_edges_; } | 232 const ZoneList<HBasicBlock*>* back_edges() const { return &back_edges_; } |
| 226 const ZoneList<HBasicBlock*>* blocks() const { return &blocks_; } | 233 const ZoneList<HBasicBlock*>* blocks() const { return &blocks_; } |
| 227 HBasicBlock* loop_header() const { return loop_header_; } | 234 HBasicBlock* loop_header() const { return loop_header_; } |
| 228 HBasicBlock* GetLastBackEdge() const; | 235 HBasicBlock* GetLastBackEdge() const; |
| 229 void RegisterBackEdge(HBasicBlock* block); | 236 void RegisterBackEdge(HBasicBlock* block); |
| 230 | 237 |
| 231 HStackCheck* stack_check() const { return stack_check_; } | 238 HStackCheck* stack_check() const { return stack_check_; } |
| 232 void set_stack_check(HStackCheck* stack_check) { | 239 void set_stack_check(HStackCheck* stack_check) { |
| 233 stack_check_ = stack_check; | 240 stack_check_ = stack_check; |
| 234 } | 241 } |
| 235 | 242 |
| 243 HBasicBlock* exit_block() const { return exit_block_; } |
| 244 void set_exit_block(HBasicBlock* block) { exit_block_ = block; } |
| 245 |
| 236 private: | 246 private: |
| 237 void AddBlock(HBasicBlock* block); | 247 void AddBlock(HBasicBlock* block); |
| 238 | 248 |
| 239 ZoneList<HBasicBlock*> back_edges_; | 249 ZoneList<HBasicBlock*> back_edges_; |
| 240 HBasicBlock* loop_header_; | 250 HBasicBlock* loop_header_; |
| 241 ZoneList<HBasicBlock*> blocks_; | 251 ZoneList<HBasicBlock*> blocks_; |
| 242 HStackCheck* stack_check_; | 252 HStackCheck* stack_check_; |
| 253 HBasicBlock* exit_block_; |
| 243 }; | 254 }; |
| 244 | 255 |
| 245 class BoundsCheckTable; | 256 class BoundsCheckTable; |
| 246 class HGraph: public ZoneObject { | 257 class HGraph: public ZoneObject { |
| 247 public: | 258 public: |
| 248 explicit HGraph(CompilationInfo* info); | 259 explicit HGraph(CompilationInfo* info); |
| 249 | 260 |
| 250 Isolate* isolate() { return isolate_; } | 261 Isolate* isolate() { return isolate_; } |
| 251 Zone* zone() const { return zone_; } | 262 Zone* zone() const { return zone_; } |
| 252 CompilationInfo* info() const { return info_; } | 263 CompilationInfo* info() const { return info_; } |
| (...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1527 const char* filename_; | 1538 const char* filename_; |
| 1528 HeapStringAllocator string_allocator_; | 1539 HeapStringAllocator string_allocator_; |
| 1529 StringStream trace_; | 1540 StringStream trace_; |
| 1530 int indent_; | 1541 int indent_; |
| 1531 }; | 1542 }; |
| 1532 | 1543 |
| 1533 | 1544 |
| 1534 } } // namespace v8::internal | 1545 } } // namespace v8::internal |
| 1535 | 1546 |
| 1536 #endif // V8_HYDROGEN_H_ | 1547 #endif // V8_HYDROGEN_H_ |
| OLD | NEW |