| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 void set_parent_loop_header(HBasicBlock* block) { | 110 void set_parent_loop_header(HBasicBlock* block) { |
| 111 ASSERT(parent_loop_header_ == NULL); | 111 ASSERT(parent_loop_header_ == NULL); |
| 112 parent_loop_header_ = block; | 112 parent_loop_header_ = block; |
| 113 } | 113 } |
| 114 | 114 |
| 115 bool HasParentLoopHeader() const { return parent_loop_header_ != NULL; } | 115 bool HasParentLoopHeader() const { return parent_loop_header_ != NULL; } |
| 116 | 116 |
| 117 void SetJoinId(int id); | 117 void SetJoinId(int id); |
| 118 | 118 |
| 119 void Finish(HControlInstruction* last); | 119 void Finish(HControlInstruction* last); |
| 120 void FinishExit(HControlInstruction* instruction); |
| 120 void Goto(HBasicBlock* block, bool include_stack_check = false); | 121 void Goto(HBasicBlock* block, bool include_stack_check = false); |
| 121 | 122 |
| 122 int PredecessorIndexOf(HBasicBlock* predecessor) const; | 123 int PredecessorIndexOf(HBasicBlock* predecessor) const; |
| 123 void AddSimulate(int id) { AddInstruction(CreateSimulate(id)); } | 124 void AddSimulate(int id) { AddInstruction(CreateSimulate(id)); } |
| 124 void AssignCommonDominator(HBasicBlock* other); | 125 void AssignCommonDominator(HBasicBlock* other); |
| 125 | 126 |
| 126 // Add the inlined function exit sequence, adding an HLeaveInlined | 127 // Add the inlined function exit sequence, adding an HLeaveInlined |
| 127 // instruction and updating the bailout environment. | 128 // instruction and updating the bailout environment. |
| 128 void AddLeaveInlined(HValue* return_value, HBasicBlock* target); | 129 void AddLeaveInlined(HValue* return_value, HBasicBlock* target); |
| 129 | 130 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 exit_block_(NULL) { | 200 exit_block_(NULL) { |
| 200 } | 201 } |
| 201 | 202 |
| 202 HGraph* graph() const { return graph_; } | 203 HGraph* graph() const { return graph_; } |
| 203 HBasicBlock* entry_block() const { return entry_block_; } | 204 HBasicBlock* entry_block() const { return entry_block_; } |
| 204 HBasicBlock* exit_block() const { return exit_block_; } | 205 HBasicBlock* exit_block() const { return exit_block_; } |
| 205 void set_exit_block(HBasicBlock* block) { | 206 void set_exit_block(HBasicBlock* block) { |
| 206 exit_block_ = block; | 207 exit_block_ = block; |
| 207 } | 208 } |
| 208 | 209 |
| 209 void PreProcessOsrEntry(IterationStatement* statement); | |
| 210 | |
| 211 void AppendJoin(HBasicBlock* first, HBasicBlock* second, int join_id); | |
| 212 void AppendWhile(IterationStatement* statement, | |
| 213 HBasicBlock* condition_entry, | |
| 214 HBasicBlock* exit_block, | |
| 215 HBasicBlock* body_exit, | |
| 216 HBasicBlock* break_block, | |
| 217 HBasicBlock* loop_entry, | |
| 218 HBasicBlock* loop_exit); | |
| 219 void AppendDoWhile(IterationStatement* statement, | |
| 220 HBasicBlock* body_entry, | |
| 221 HBasicBlock* go_back, | |
| 222 HBasicBlock* exit_block, | |
| 223 HBasicBlock* break_block); | |
| 224 void AppendEndless(IterationStatement* statement, | |
| 225 HBasicBlock* body_entry, | |
| 226 HBasicBlock* body_exit, | |
| 227 HBasicBlock* break_block); | |
| 228 void Append(BreakableStatement* stmt, | |
| 229 HBasicBlock* entry_block, | |
| 230 HBasicBlock* exit_block, | |
| 231 HBasicBlock* break_block); | |
| 232 void ResolveContinue(IterationStatement* statement, | |
| 233 HBasicBlock* continue_block); | |
| 234 HBasicBlock* JoinBlocks(HBasicBlock* a, HBasicBlock* b, int id); | |
| 235 | |
| 236 void FinishExit(HControlInstruction* instruction); | |
| 237 void Initialize(HBasicBlock* block) { | 210 void Initialize(HBasicBlock* block) { |
| 238 ASSERT(entry_block_ == NULL); | 211 ASSERT(entry_block_ == NULL); |
| 239 entry_block_ = block; | 212 entry_block_ = block; |
| 240 exit_block_ = block; | 213 exit_block_ = block; |
| 241 } | 214 } |
| 242 | 215 |
| 243 protected: | 216 protected: |
| 244 HGraph* graph_; // The graph this is a subgraph of. | 217 HGraph* graph_; // The graph this is a subgraph of. |
| 245 HBasicBlock* entry_block_; | 218 HBasicBlock* entry_block_; |
| 246 HBasicBlock* exit_block_; | 219 HBasicBlock* exit_block_; |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 // Generators for inline runtime functions. | 664 // Generators for inline runtime functions. |
| 692 #define INLINE_FUNCTION_GENERATOR_DECLARATION(Name, argc, ressize) \ | 665 #define INLINE_FUNCTION_GENERATOR_DECLARATION(Name, argc, ressize) \ |
| 693 void Generate##Name(CallRuntime* call); | 666 void Generate##Name(CallRuntime* call); |
| 694 | 667 |
| 695 INLINE_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_DECLARATION) | 668 INLINE_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_DECLARATION) |
| 696 INLINE_RUNTIME_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_DECLARATION) | 669 INLINE_RUNTIME_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_DECLARATION) |
| 697 #undef INLINE_FUNCTION_GENERATOR_DECLARATION | 670 #undef INLINE_FUNCTION_GENERATOR_DECLARATION |
| 698 | 671 |
| 699 void Bailout(const char* reason); | 672 void Bailout(const char* reason); |
| 700 | 673 |
| 701 void AppendPeeledWhile(IterationStatement* stmt, | 674 void PreProcessOsrEntry(IterationStatement* statement); |
| 702 HBasicBlock* condition_entry, | 675 |
| 703 HBasicBlock* exit_block, | 676 HBasicBlock* CreateJoin(HBasicBlock* first, |
| 704 HBasicBlock* body_exit, | 677 HBasicBlock* second, |
| 705 HBasicBlock* break_block); | 678 int join_id); |
| 679 HBasicBlock* CreateWhile(IterationStatement* statement, |
| 680 HBasicBlock* condition_entry, |
| 681 HBasicBlock* exit_block, |
| 682 HBasicBlock* body_exit, |
| 683 HBasicBlock* break_block, |
| 684 HBasicBlock* loop_entry, |
| 685 HBasicBlock* loop_exit); |
| 686 HBasicBlock* CreateDoWhile(IterationStatement* statement, |
| 687 HBasicBlock* body_entry, |
| 688 HBasicBlock* go_back, |
| 689 HBasicBlock* exit_block, |
| 690 HBasicBlock* break_block); |
| 691 HBasicBlock* CreateEndless(IterationStatement* statement, |
| 692 HBasicBlock* body_entry, |
| 693 HBasicBlock* body_exit, |
| 694 HBasicBlock* break_block); |
| 695 HBasicBlock* CreatePeeledWhile(IterationStatement* stmt, |
| 696 HBasicBlock* condition_entry, |
| 697 HBasicBlock* exit_block, |
| 698 HBasicBlock* body_exit, |
| 699 HBasicBlock* break_block); |
| 700 HBasicBlock* JoinContinue(IterationStatement* statement, |
| 701 HBasicBlock* exit_block, |
| 702 HBasicBlock* continue_block); |
| 703 |
| 706 | 704 |
| 707 void AddToSubgraph(HSubgraph* graph, ZoneList<Statement*>* stmts); | 705 void AddToSubgraph(HSubgraph* graph, ZoneList<Statement*>* stmts); |
| 708 void AddToSubgraph(HSubgraph* graph, Statement* stmt); | 706 void AddToSubgraph(HSubgraph* graph, Statement* stmt); |
| 709 void AddToSubgraph(HSubgraph* graph, Expression* expr); | 707 void AddToSubgraph(HSubgraph* graph, Expression* expr); |
| 710 | 708 |
| 711 HValue* Top() const { return environment()->Top(); } | 709 HValue* Top() const { return environment()->Top(); } |
| 712 void Drop(int n) { environment()->Drop(n); } | 710 void Drop(int n) { environment()->Drop(n); } |
| 713 void Bind(Variable* var, HValue* value) { environment()->Bind(var, value); } | 711 void Bind(Variable* var, HValue* value) { environment()->Bind(var, value); } |
| 714 | 712 |
| 715 void VisitForValue(Expression* expr); | 713 void VisitForValue(Expression* expr); |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1091 const char* filename_; | 1089 const char* filename_; |
| 1092 HeapStringAllocator string_allocator_; | 1090 HeapStringAllocator string_allocator_; |
| 1093 StringStream trace_; | 1091 StringStream trace_; |
| 1094 int indent_; | 1092 int indent_; |
| 1095 }; | 1093 }; |
| 1096 | 1094 |
| 1097 | 1095 |
| 1098 } } // namespace v8::internal | 1096 } } // namespace v8::internal |
| 1099 | 1097 |
| 1100 #endif // V8_HYDROGEN_H_ | 1098 #endif // V8_HYDROGEN_H_ |
| OLD | NEW |