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

Side by Side Diff: src/hydrogen.h

Issue 7033020: When inlining fails, disable optimization of the proper function. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 7 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 | « src/compiler.cc ('k') | 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 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 653
654 // Search the break stack for a break or continue target. 654 // Search the break stack for a break or continue target.
655 HBasicBlock* Get(BreakableStatement* stmt, BreakType type); 655 HBasicBlock* Get(BreakableStatement* stmt, BreakType type);
656 656
657 private: 657 private:
658 BreakAndContinueInfo* info_; 658 BreakAndContinueInfo* info_;
659 HGraphBuilder* owner_; 659 HGraphBuilder* owner_;
660 BreakAndContinueScope* next_; 660 BreakAndContinueScope* next_;
661 }; 661 };
662 662
663 HGraphBuilder(CompilationInfo* info, TypeFeedbackOracle* oracle) 663 HGraphBuilder(CompilationInfo* info, TypeFeedbackOracle* oracle);
664 : function_state_(NULL),
665 initial_function_state_(this, info, oracle),
666 ast_context_(NULL),
667 break_scope_(NULL),
668 graph_(NULL),
669 current_block_(NULL),
670 inlined_count_(0),
671 zone_(info->isolate()->zone()) {
672 // This is not initialized in the initializer list because the
673 // constructor for the initial state relies on function_state_ == NULL
674 // to know it's the initial state.
675 function_state_= &initial_function_state_;
676 }
677 664
678 HGraph* CreateGraph(); 665 HGraph* CreateGraph();
679 666
680 // Simple accessors. 667 // Simple accessors.
681 HGraph* graph() const { return graph_; } 668 HGraph* graph() const { return graph_; }
682 BreakAndContinueScope* break_scope() const { return break_scope_; } 669 BreakAndContinueScope* break_scope() const { return break_scope_; }
683 void set_break_scope(BreakAndContinueScope* head) { break_scope_ = head; } 670 void set_break_scope(BreakAndContinueScope* head) { break_scope_ = head; }
684 671
685 HBasicBlock* current_block() const { return current_block_; } 672 HBasicBlock* current_block() const { return current_block_; }
686 void set_current_block(HBasicBlock* block) { current_block_ = block; } 673 void set_current_block(HBasicBlock* block) { current_block_ = block; }
687 HEnvironment* environment() const { 674 HEnvironment* environment() const {
688 return current_block()->last_environment(); 675 return current_block()->last_environment();
689 } 676 }
690 677
678 bool inline_bailout() { return inline_bailout_; }
679
691 // Adding instructions. 680 // Adding instructions.
692 HInstruction* AddInstruction(HInstruction* instr); 681 HInstruction* AddInstruction(HInstruction* instr);
693 void AddSimulate(int id); 682 void AddSimulate(int id);
694 683
695 // Bailout environment manipulation. 684 // Bailout environment manipulation.
696 void Push(HValue* value) { environment()->Push(value); } 685 void Push(HValue* value) { environment()->Push(value); }
697 HValue* Pop() { return environment()->Pop(); } 686 HValue* Pop() { return environment()->Pop(); }
698 687
699 void Bailout(const char* reason); 688 void Bailout(const char* reason);
700 689
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 // A stack of breakable statements entered. 956 // A stack of breakable statements entered.
968 BreakAndContinueScope* break_scope_; 957 BreakAndContinueScope* break_scope_;
969 958
970 HGraph* graph_; 959 HGraph* graph_;
971 HBasicBlock* current_block_; 960 HBasicBlock* current_block_;
972 961
973 int inlined_count_; 962 int inlined_count_;
974 963
975 Zone* zone_; 964 Zone* zone_;
976 965
966 bool inline_bailout_;
967
977 friend class FunctionState; // Pushes and pops the state stack. 968 friend class FunctionState; // Pushes and pops the state stack.
978 friend class AstContext; // Pushes and pops the AST context stack. 969 friend class AstContext; // Pushes and pops the AST context stack.
979 970
980 DISALLOW_COPY_AND_ASSIGN(HGraphBuilder); 971 DISALLOW_COPY_AND_ASSIGN(HGraphBuilder);
981 }; 972 };
982 973
983 974
984 Zone* AstContext::zone() { return owner_->zone(); } 975 Zone* AstContext::zone() { return owner_->zone(); }
985 976
986 977
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
1199 const char* filename_; 1190 const char* filename_;
1200 HeapStringAllocator string_allocator_; 1191 HeapStringAllocator string_allocator_;
1201 StringStream trace_; 1192 StringStream trace_;
1202 int indent_; 1193 int indent_;
1203 }; 1194 };
1204 1195
1205 1196
1206 } } // namespace v8::internal 1197 } } // namespace v8::internal
1207 1198
1208 #endif // V8_HYDROGEN_H_ 1199 #endif // V8_HYDROGEN_H_
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698