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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 HGraph* graph() const { return graph_; } | 202 HGraph* graph() const { return graph_; } |
203 HBasicBlock* entry_block() const { return entry_block_; } | 203 HBasicBlock* entry_block() const { return entry_block_; } |
204 HBasicBlock* exit_block() const { return exit_block_; } | 204 HBasicBlock* exit_block() const { return exit_block_; } |
205 void set_exit_block(HBasicBlock* block) { | 205 void set_exit_block(HBasicBlock* block) { |
206 exit_block_ = block; | 206 exit_block_ = block; |
207 } | 207 } |
208 | 208 |
209 void PreProcessOsrEntry(IterationStatement* statement); | 209 void PreProcessOsrEntry(IterationStatement* statement); |
210 | 210 |
211 void AppendJoin(HSubgraph* then_graph, HSubgraph* else_graph, AstNode* node); | 211 void AppendJoin(HBasicBlock* first, HBasicBlock* second, int join_id); |
212 void AppendWhile(HSubgraph* condition, | 212 void AppendWhile(IterationStatement* statement, |
213 HSubgraph* body, | 213 HBasicBlock* condition_entry, |
214 IterationStatement* statement, | 214 HBasicBlock* exit_block, |
215 HSubgraph* continue_subgraph, | 215 HBasicBlock* body_exit, |
216 HSubgraph* exit, | 216 HBasicBlock* break_block, |
217 HBasicBlock* break_block); | 217 HBasicBlock* loop_entry, |
218 void AppendDoWhile(HSubgraph* body, | 218 HBasicBlock* loop_exit); |
219 IterationStatement* statement, | 219 void AppendDoWhile(IterationStatement* statement, |
220 HSubgraph* go_back, | 220 HBasicBlock* body_entry, |
221 HSubgraph* exit, | 221 HBasicBlock* go_back, |
| 222 HBasicBlock* exit_block, |
222 HBasicBlock* break_block); | 223 HBasicBlock* break_block); |
223 void AppendEndless(HSubgraph* body, | 224 void AppendEndless(IterationStatement* statement, |
224 IterationStatement* statement, | 225 HBasicBlock* body_entry, |
| 226 HBasicBlock* body_exit, |
225 HBasicBlock* break_block); | 227 HBasicBlock* break_block); |
226 void Append(HSubgraph* next, | 228 void Append(BreakableStatement* stmt, |
227 BreakableStatement* stmt, | 229 HBasicBlock* entry_block, |
| 230 HBasicBlock* exit_block, |
228 HBasicBlock* break_block); | 231 HBasicBlock* break_block); |
229 void ResolveContinue(IterationStatement* statement, | 232 void ResolveContinue(IterationStatement* statement, |
230 HBasicBlock* continue_block); | 233 HBasicBlock* continue_block); |
231 HBasicBlock* JoinBlocks(HBasicBlock* a, HBasicBlock* b, int id); | 234 HBasicBlock* JoinBlocks(HBasicBlock* a, HBasicBlock* b, int id); |
232 | 235 |
233 void FinishExit(HControlInstruction* instruction); | 236 void FinishExit(HControlInstruction* instruction); |
234 void Initialize(HBasicBlock* block) { | 237 void Initialize(HBasicBlock* block) { |
235 ASSERT(entry_block_ == NULL); | 238 ASSERT(entry_block_ == NULL); |
236 entry_block_ = block; | 239 entry_block_ = block; |
237 exit_block_ = block; | 240 exit_block_ = block; |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 #define INLINE_FUNCTION_GENERATOR_DECLARATION(Name, argc, ressize) \ | 692 #define INLINE_FUNCTION_GENERATOR_DECLARATION(Name, argc, ressize) \ |
690 void Generate##Name(CallRuntime* call); | 693 void Generate##Name(CallRuntime* call); |
691 | 694 |
692 INLINE_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_DECLARATION) | 695 INLINE_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_DECLARATION) |
693 INLINE_RUNTIME_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_DECLARATION) | 696 INLINE_RUNTIME_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_DECLARATION) |
694 #undef INLINE_FUNCTION_GENERATOR_DECLARATION | 697 #undef INLINE_FUNCTION_GENERATOR_DECLARATION |
695 | 698 |
696 void Bailout(const char* reason); | 699 void Bailout(const char* reason); |
697 | 700 |
698 void AppendPeeledWhile(IterationStatement* stmt, | 701 void AppendPeeledWhile(IterationStatement* stmt, |
699 HSubgraph* cond_graph, | 702 HBasicBlock* condition_entry, |
700 HSubgraph* body_graph, | 703 HBasicBlock* exit_block, |
701 HSubgraph* exit_graph, | 704 HBasicBlock* body_exit, |
702 HBasicBlock* break_block); | 705 HBasicBlock* break_block); |
703 | 706 |
704 void AddToSubgraph(HSubgraph* graph, ZoneList<Statement*>* stmts); | 707 void AddToSubgraph(HSubgraph* graph, ZoneList<Statement*>* stmts); |
705 void AddToSubgraph(HSubgraph* graph, Statement* stmt); | 708 void AddToSubgraph(HSubgraph* graph, Statement* stmt); |
706 void AddToSubgraph(HSubgraph* graph, Expression* expr); | 709 void AddToSubgraph(HSubgraph* graph, Expression* expr); |
707 | 710 |
708 HValue* Top() const { return environment()->Top(); } | 711 HValue* Top() const { return environment()->Top(); } |
709 void Drop(int n) { environment()->Drop(n); } | 712 void Drop(int n) { environment()->Drop(n); } |
710 void Bind(Variable* var, HValue* value) { environment()->Bind(var, value); } | 713 void Bind(Variable* var, HValue* value) { environment()->Bind(var, value); } |
711 | 714 |
(...skipping 22 matching lines...) Expand all Loading... |
734 void AssumeRepresentation(HValue* value, Representation r); | 737 void AssumeRepresentation(HValue* value, Representation r); |
735 static Representation ToRepresentation(TypeInfo info); | 738 static Representation ToRepresentation(TypeInfo info); |
736 | 739 |
737 void SetupScope(Scope* scope); | 740 void SetupScope(Scope* scope); |
738 virtual void VisitStatements(ZoneList<Statement*>* statements); | 741 virtual void VisitStatements(ZoneList<Statement*>* statements); |
739 | 742 |
740 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); | 743 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); |
741 AST_NODE_LIST(DECLARE_VISIT) | 744 AST_NODE_LIST(DECLARE_VISIT) |
742 #undef DECLARE_VISIT | 745 #undef DECLARE_VISIT |
743 | 746 |
744 bool ShouldPeel(HSubgraph* cond, HSubgraph* body); | |
745 | |
746 HBasicBlock* CreateBasicBlock(HEnvironment* env); | 747 HBasicBlock* CreateBasicBlock(HEnvironment* env); |
747 HSubgraph* CreateEmptySubgraph(); | 748 HSubgraph* CreateEmptySubgraph(); |
748 HSubgraph* CreateGotoSubgraph(HEnvironment* env); | 749 HSubgraph* CreateGotoSubgraph(HEnvironment* env); |
749 HSubgraph* CreateBranchSubgraph(HEnvironment* env); | 750 HSubgraph* CreateBranchSubgraph(HEnvironment* env); |
750 HSubgraph* CreateLoopHeaderSubgraph(HEnvironment* env); | 751 HSubgraph* CreateLoopHeaderSubgraph(HEnvironment* env); |
751 HSubgraph* CreateInlinedSubgraph(HEnvironment* outer, | 752 HSubgraph* CreateInlinedSubgraph(HEnvironment* outer, |
752 Handle<JSFunction> target, | 753 Handle<JSFunction> target, |
753 FunctionLiteral* function); | 754 FunctionLiteral* function); |
754 | 755 |
755 // Helpers for flow graph construction. | 756 // Helpers for flow graph construction. |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1090 const char* filename_; | 1091 const char* filename_; |
1091 HeapStringAllocator string_allocator_; | 1092 HeapStringAllocator string_allocator_; |
1092 StringStream trace_; | 1093 StringStream trace_; |
1093 int indent_; | 1094 int indent_; |
1094 }; | 1095 }; |
1095 | 1096 |
1096 | 1097 |
1097 } } // namespace v8::internal | 1098 } } // namespace v8::internal |
1098 | 1099 |
1099 #endif // V8_HYDROGEN_H_ | 1100 #endif // V8_HYDROGEN_H_ |
OLD | NEW |