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

Side by Side Diff: src/hydrogen.h

Issue 5699002: RFC: Switch to ast ids (instead of positions) for type feedback. (Closed)
Patch Set: Cleanup Created 10 years 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
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 } 113 }
114 114
115 bool HasParentLoopHeader() const { return parent_loop_header_.is_set(); } 115 bool HasParentLoopHeader() const { return parent_loop_header_.is_set(); }
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 Goto(HBasicBlock* block, bool include_stack_check = false); 120 void Goto(HBasicBlock* block, bool include_stack_check = false);
121 121
122 int PredecessorIndexOf(HBasicBlock* predecessor) const; 122 int PredecessorIndexOf(HBasicBlock* predecessor) const;
123 void AddSimulate(int id) { AddInstruction(CreateSimulate(id)); } 123 void AddSimulate(AstId id) { AddInstruction(CreateSimulate(id)); }
124 void AssignCommonDominator(HBasicBlock* other); 124 void AssignCommonDominator(HBasicBlock* other);
125 125
126 // Add the inlined function exit sequence, adding an HLeaveInlined 126 // Add the inlined function exit sequence, adding an HLeaveInlined
127 // instruction and updating the bailout environment. 127 // instruction and updating the bailout environment.
128 void AddLeaveInlined(HValue* return_value, HBasicBlock* target); 128 void AddLeaveInlined(HValue* return_value, HBasicBlock* target);
129 129
130 // If a target block is tagged as an inline function return, all 130 // If a target block is tagged as an inline function return, all
131 // predecessors should contain the inlined exit sequence: 131 // predecessors should contain the inlined exit sequence:
132 // 132 //
133 // LeaveInlined 133 // LeaveInlined
(...skipping 14 matching lines...) Expand all
148 void set_cond(Handle<Object> value) { cond_ = value; } 148 void set_cond(Handle<Object> value) { cond_ = value; }
149 149
150 #ifdef DEBUG 150 #ifdef DEBUG
151 void Verify(); 151 void Verify();
152 #endif 152 #endif
153 153
154 private: 154 private:
155 void RegisterPredecessor(HBasicBlock* pred); 155 void RegisterPredecessor(HBasicBlock* pred);
156 void AddDominatedBlock(HBasicBlock* block); 156 void AddDominatedBlock(HBasicBlock* block);
157 157
158 HSimulate* CreateSimulate(int id); 158 HSimulate* CreateSimulate(AstId id);
159 159
160 int block_id_; 160 int block_id_;
161 HGraph* graph_; 161 HGraph* graph_;
162 ZoneList<HPhi*> phis_; 162 ZoneList<HPhi*> phis_;
163 HInstruction* first_; 163 HInstruction* first_;
164 HInstruction* last_; // Last non-control instruction of the block. 164 HInstruction* last_; // Last non-control instruction of the block.
165 HControlInstruction* end_; 165 HControlInstruction* end_;
166 HLoopInformation* loop_information_; 166 HLoopInformation* loop_information_;
167 ZoneList<HBasicBlock*> predecessors_; 167 ZoneList<HBasicBlock*> predecessors_;
168 HBasicBlock* dominator_; 168 HBasicBlock* dominator_;
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 471
472 void Drop(int count) { 472 void Drop(int count) {
473 for (int i = 0; i < count; ++i) { 473 for (int i = 0; i < count; ++i) {
474 Pop(); 474 Pop();
475 } 475 }
476 } 476 }
477 477
478 Handle<JSFunction> closure() const { return closure_; } 478 Handle<JSFunction> closure() const { return closure_; }
479 479
480 // ID of the original AST node to identify deoptimization points. 480 // ID of the original AST node to identify deoptimization points.
481 int ast_id() const { return ast_id_; } 481 AstId ast_id() const { return ast_id_; }
482 void set_ast_id(int id) { ast_id_ = id; } 482 void set_ast_id(int id) { ast_id_ = id; }
483 483
484 const ZoneList<HValue*>* values() const { return &values_; } 484 const ZoneList<HValue*>* values() const { return &values_; }
485 const ZoneList<int>* assigned_variables() const { 485 const ZoneList<int>* assigned_variables() const {
486 return &assigned_variables_; 486 return &assigned_variables_;
487 } 487 }
488 int parameter_count() const { return parameter_count_; } 488 int parameter_count() const { return parameter_count_; }
489 int local_count() const { return local_count_; } 489 int local_count() const { return local_count_; }
490 int push_count() const { return push_count_; } 490 int push_count() const { return push_count_; }
491 int pop_count() const { return pop_count_; } 491 int pop_count() const { return pop_count_; }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 538
539 Handle<JSFunction> closure_; 539 Handle<JSFunction> closure_;
540 // Value array [parameters] [locals] [temporaries]. 540 // Value array [parameters] [locals] [temporaries].
541 ZoneList<HValue*> values_; 541 ZoneList<HValue*> values_;
542 ZoneList<int> assigned_variables_; 542 ZoneList<int> assigned_variables_;
543 int parameter_count_; 543 int parameter_count_;
544 int local_count_; 544 int local_count_;
545 HEnvironment* outer_; 545 HEnvironment* outer_;
546 int pop_count_; 546 int pop_count_;
547 int push_count_; 547 int push_count_;
548 int ast_id_; 548 AstId ast_id_;
549 }; 549 };
550 550
551 551
552 class HGraphBuilder; 552 class HGraphBuilder;
553 553
554 class AstContext { 554 class AstContext {
555 public: 555 public:
556 bool IsEffect() const { return kind_ == Expression::kEffect; } 556 bool IsEffect() const { return kind_ == Expression::kEffect; }
557 bool IsValue() const { return kind_ == Expression::kValue; } 557 bool IsValue() const { return kind_ == Expression::kValue; }
558 bool IsTest() const { return kind_ == Expression::kTest; } 558 bool IsTest() const { return kind_ == Expression::kTest; }
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 const char* filename_; 1052 const char* filename_;
1053 HeapStringAllocator string_allocator_; 1053 HeapStringAllocator string_allocator_;
1054 StringStream trace_; 1054 StringStream trace_;
1055 int indent_; 1055 int indent_;
1056 }; 1056 };
1057 1057
1058 1058
1059 } } // namespace v8::internal 1059 } } // namespace v8::internal
1060 1060
1061 #endif // V8_HYDROGEN_H_ 1061 #endif // V8_HYDROGEN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698