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

Side by Side Diff: src/compiler/schedule.h

Issue 865393004: [turbofan] Move GetCommonDominator to BasicBlock. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « no previous file | src/compiler/schedule.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_COMPILER_SCHEDULE_H_ 5 #ifndef V8_COMPILER_SCHEDULE_H_
6 #define V8_COMPILER_SCHEDULE_H_ 6 #define V8_COMPILER_SCHEDULE_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 #include "src/zone-containers.h" 10 #include "src/zone-containers.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 void set_loop_number(int32_t loop_number) { loop_number_ = loop_number; } 158 void set_loop_number(int32_t loop_number) { loop_number_ = loop_number; }
159 159
160 RpoNumber GetRpoNumber() const { return RpoNumber::FromInt(rpo_number_); } 160 RpoNumber GetRpoNumber() const { return RpoNumber::FromInt(rpo_number_); }
161 int32_t rpo_number() const { return rpo_number_; } 161 int32_t rpo_number() const { return rpo_number_; }
162 void set_rpo_number(int32_t rpo_number); 162 void set_rpo_number(int32_t rpo_number);
163 163
164 // Loop membership helpers. 164 // Loop membership helpers.
165 inline bool IsLoopHeader() const { return loop_end_ != NULL; } 165 inline bool IsLoopHeader() const { return loop_end_ != NULL; }
166 bool LoopContains(BasicBlock* block) const; 166 bool LoopContains(BasicBlock* block) const;
167 167
168 // Computes the immediate common dominator of {b1} and {b2}. The worst time
169 // complexity is O(N) where N is the height of the dominator tree.
170 static BasicBlock* GetCommonDominator(BasicBlock* b1, BasicBlock* b2);
171
168 private: 172 private:
169 int32_t loop_number_; // loop number of the block. 173 int32_t loop_number_; // loop number of the block.
170 int32_t rpo_number_; // special RPO number of the block. 174 int32_t rpo_number_; // special RPO number of the block.
171 bool deferred_; // true if the block contains deferred code. 175 bool deferred_; // true if the block contains deferred code.
172 int32_t dominator_depth_; // Depth within the dominator tree. 176 int32_t dominator_depth_; // Depth within the dominator tree.
173 BasicBlock* dominator_; // Immediate dominator of the block. 177 BasicBlock* dominator_; // Immediate dominator of the block.
174 BasicBlock* rpo_next_; // Link to next block in special RPO order. 178 BasicBlock* rpo_next_; // Link to next block in special RPO order.
175 BasicBlock* loop_header_; // Pointer to dominating loop header basic block, 179 BasicBlock* loop_header_; // Pointer to dominating loop header basic block,
176 // NULL if none. For loop headers, this points to 180 // NULL if none. For loop headers, this points to
177 // enclosing loop header. 181 // enclosing loop header.
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 DISALLOW_COPY_AND_ASSIGN(Schedule); 278 DISALLOW_COPY_AND_ASSIGN(Schedule);
275 }; 279 };
276 280
277 std::ostream& operator<<(std::ostream&, const Schedule&); 281 std::ostream& operator<<(std::ostream&, const Schedule&);
278 282
279 } // namespace compiler 283 } // namespace compiler
280 } // namespace internal 284 } // namespace internal
281 } // namespace v8 285 } // namespace v8
282 286
283 #endif // V8_COMPILER_SCHEDULE_H_ 287 #endif // V8_COMPILER_SCHEDULE_H_
OLDNEW
« no previous file with comments | « no previous file | src/compiler/schedule.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698