Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: src/hydrogen.h

Issue 6604002: Remove some more uses of subgraphs and more cleanup of the graph builder. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge/build/ia32
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 private: 598 private:
599 BreakAndContinueInfo* info_; 599 BreakAndContinueInfo* info_;
600 HGraphBuilder* owner_; 600 HGraphBuilder* owner_;
601 BreakAndContinueScope* next_; 601 BreakAndContinueScope* next_;
602 }; 602 };
603 603
604 explicit HGraphBuilder(TypeFeedbackOracle* oracle) 604 explicit HGraphBuilder(TypeFeedbackOracle* oracle)
605 : oracle_(oracle), 605 : oracle_(oracle),
606 graph_(NULL), 606 graph_(NULL),
607 current_subgraph_(NULL), 607 current_subgraph_(NULL),
608 peeled_statement_(NULL),
609 ast_context_(NULL), 608 ast_context_(NULL),
610 call_context_(NULL), 609 call_context_(NULL),
611 function_return_(NULL), 610 function_return_(NULL),
612 inlined_count_(0), 611 inlined_count_(0),
613 break_scope_(NULL) { 612 break_scope_(NULL) {
614 } 613 }
615 614
616 HGraph* CreateGraph(CompilationInfo* info); 615 HGraph* CreateGraph(CompilationInfo* info);
617 616
618 // Simple accessors. 617 // Simple accessors.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 INLINE_RUNTIME_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_DECLARATION) 668 INLINE_RUNTIME_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_DECLARATION)
670 #undef INLINE_FUNCTION_GENERATOR_DECLARATION 669 #undef INLINE_FUNCTION_GENERATOR_DECLARATION
671 670
672 void Bailout(const char* reason); 671 void Bailout(const char* reason);
673 672
674 void PreProcessOsrEntry(IterationStatement* statement); 673 void PreProcessOsrEntry(IterationStatement* statement);
675 674
676 HBasicBlock* CreateJoin(HBasicBlock* first, 675 HBasicBlock* CreateJoin(HBasicBlock* first,
677 HBasicBlock* second, 676 HBasicBlock* second,
678 int join_id); 677 int join_id);
679 HBasicBlock* CreateWhile(IterationStatement* statement, 678
680 HBasicBlock* loop_entry, 679 // Create a back edge in the flow graph. body_exit is the predecessor
681 HBasicBlock* cond_false, 680 // block and loop_entry is the successor block. loop_successor is the
682 HBasicBlock* body_exit, 681 // block where control flow exits the loop normally (e.g., via failure of
683 HBasicBlock* break_block); 682 // the condition) and break_block is the block where control flow breaks
684 HBasicBlock* CreateDoWhile(IterationStatement* statement, 683 // from the loop. All blocks except loop_entry can be NULL. The return
685 HBasicBlock* body_entry, 684 // value is the new successor block which is the join of loop_successor
686 HBasicBlock* go_back, 685 // and break_block, or NULL.
687 HBasicBlock* exit_block, 686 HBasicBlock* CreateLoop(IterationStatement* statement,
688 HBasicBlock* break_block); 687 HBasicBlock* loop_entry,
689 HBasicBlock* CreateEndless(IterationStatement* statement, 688 HBasicBlock* body_exit,
690 HBasicBlock* body_entry, 689 HBasicBlock* loop_successor,
691 HBasicBlock* body_exit, 690 HBasicBlock* break_block);
692 HBasicBlock* break_block); 691
693 HBasicBlock* JoinContinue(IterationStatement* statement, 692 HBasicBlock* JoinContinue(IterationStatement* statement,
694 HBasicBlock* exit_block, 693 HBasicBlock* exit_block,
695 HBasicBlock* continue_block); 694 HBasicBlock* continue_block);
696 695
697
698 void AddToSubgraph(HSubgraph* graph, ZoneList<Statement*>* stmts); 696 void AddToSubgraph(HSubgraph* graph, ZoneList<Statement*>* stmts);
699 void AddToSubgraph(HSubgraph* graph, Statement* stmt); 697 void AddToSubgraph(HSubgraph* graph, Statement* stmt);
700 void AddToSubgraph(HSubgraph* graph, Expression* expr); 698 void AddToSubgraph(HSubgraph* graph, Expression* expr);
701 699
702 HValue* Top() const { return environment()->Top(); } 700 HValue* Top() const { return environment()->Top(); }
703 void Drop(int n) { environment()->Drop(n); } 701 void Drop(int n) { environment()->Drop(n); }
704 void Bind(Variable* var, HValue* value) { environment()->Bind(var, value); } 702 void Bind(Variable* var, HValue* value) { environment()->Bind(var, value); }
705 703
706 void VisitForValue(Expression* expr); 704 void VisitForValue(Expression* expr);
707 void VisitForEffect(Expression* expr); 705 void VisitForEffect(Expression* expr);
(...skipping 22 matching lines...) Expand all
730 728
731 void SetupScope(Scope* scope); 729 void SetupScope(Scope* scope);
732 virtual void VisitStatements(ZoneList<Statement*>* statements); 730 virtual void VisitStatements(ZoneList<Statement*>* statements);
733 731
734 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); 732 #define DECLARE_VISIT(type) virtual void Visit##type(type* node);
735 AST_NODE_LIST(DECLARE_VISIT) 733 AST_NODE_LIST(DECLARE_VISIT)
736 #undef DECLARE_VISIT 734 #undef DECLARE_VISIT
737 735
738 HBasicBlock* CreateBasicBlock(HEnvironment* env); 736 HBasicBlock* CreateBasicBlock(HEnvironment* env);
739 HSubgraph* CreateEmptySubgraph(); 737 HSubgraph* CreateEmptySubgraph();
740 HSubgraph* CreateGotoSubgraph(HEnvironment* env);
741 HSubgraph* CreateBranchSubgraph(HEnvironment* env); 738 HSubgraph* CreateBranchSubgraph(HEnvironment* env);
742 HBasicBlock* CreateLoopHeader(); 739 HBasicBlock* CreateLoopHeaderBlock();
743 HSubgraph* CreateInlinedSubgraph(HEnvironment* outer, 740 HSubgraph* CreateInlinedSubgraph(HEnvironment* outer,
744 Handle<JSFunction> target, 741 Handle<JSFunction> target,
745 FunctionLiteral* function); 742 FunctionLiteral* function);
746 743
747 // Helpers for flow graph construction. 744 // Helpers for flow graph construction.
748 void LookupGlobalPropertyCell(Variable* var, 745 void LookupGlobalPropertyCell(Variable* var,
749 LookupResult* lookup, 746 LookupResult* lookup,
750 bool is_store); 747 bool is_store);
751 748
752 bool TryArgumentsAccess(Property* expr); 749 bool TryArgumentsAccess(Property* expr);
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 841
845 HBasicBlock* BuildTypeSwitch(HValue* receiver, 842 HBasicBlock* BuildTypeSwitch(HValue* receiver,
846 ZoneMapList* maps, 843 ZoneMapList* maps,
847 ZoneList<HSubgraph*>* body_graphs, 844 ZoneList<HSubgraph*>* body_graphs,
848 HSubgraph* default_graph, 845 HSubgraph* default_graph,
849 int join_id); 846 int join_id);
850 847
851 TypeFeedbackOracle* oracle_; 848 TypeFeedbackOracle* oracle_;
852 HGraph* graph_; 849 HGraph* graph_;
853 HSubgraph* current_subgraph_; 850 HSubgraph* current_subgraph_;
854 IterationStatement* peeled_statement_;
855 // Expression context of the currently visited subexpression. NULL when 851 // Expression context of the currently visited subexpression. NULL when
856 // visiting statements. 852 // visiting statements.
857 AstContext* ast_context_; 853 AstContext* ast_context_;
858 854
859 // During function inlining, expression context of the call being 855 // During function inlining, expression context of the call being
860 // inlined. NULL when not inlining. 856 // inlined. NULL when not inlining.
861 AstContext* call_context_; 857 AstContext* call_context_;
862 858
863 // When inlining a call in an effect or value context, the return 859 // When inlining a call in an effect or value context, the return
864 // block. NULL otherwise. When inlining a call in a test context, there 860 // block. NULL otherwise. When inlining a call in a test context, there
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 const char* filename_; 1078 const char* filename_;
1083 HeapStringAllocator string_allocator_; 1079 HeapStringAllocator string_allocator_;
1084 StringStream trace_; 1080 StringStream trace_;
1085 int indent_; 1081 int indent_;
1086 }; 1082 };
1087 1083
1088 1084
1089 } } // namespace v8::internal 1085 } } // namespace v8::internal
1090 1086
1091 #endif // V8_HYDROGEN_H_ 1087 #endif // V8_HYDROGEN_H_
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698