Index: src/hydrogen.h |
diff --git a/src/hydrogen.h b/src/hydrogen.h |
index fc4b6121048423cfdcd4764cf555f571ff362704..47b569146bb271fc81f1ce265633cd23b3d71b81 100644 |
--- a/src/hydrogen.h |
+++ b/src/hydrogen.h |
@@ -126,6 +126,7 @@ class HBasicBlock: public ZoneObject { |
int PredecessorIndexOf(HBasicBlock* predecessor) const; |
void AddSimulate(int ast_id) { AddInstruction(CreateSimulate(ast_id)); } |
void AssignCommonDominator(HBasicBlock* other); |
+ void AssignLoopSuccessorDominators(); |
void FinishExitWithDeoptimization(HDeoptimize::UseEnvironment has_uses) { |
FinishExit(CreateDeoptimize(has_uses)); |
@@ -149,6 +150,13 @@ class HBasicBlock: public ZoneObject { |
bool IsDeoptimizing() const { return is_deoptimizing_; } |
void MarkAsDeoptimizing() { is_deoptimizing_ = true; } |
+ bool IsLoopSuccessorDominator() const { |
+ return dominates_loop_successors_; |
+ } |
+ void MarkAsLoopSuccessorDominator() { |
+ dominates_loop_successors_ = true; |
+ } |
+ |
inline Zone* zone(); |
#ifdef DEBUG |
@@ -182,6 +190,22 @@ class HBasicBlock: public ZoneObject { |
HBasicBlock* parent_loop_header_; |
bool is_inline_return_target_; |
bool is_deoptimizing_; |
+ bool dominates_loop_successors_; |
+}; |
+ |
+ |
+class HPredecessorIterator BASE_EMBEDDED { |
+ public: |
+ explicit HPredecessorIterator(HBasicBlock* block) |
+ : predecessor_list_(block->predecessors()), current_(0) { } |
+ |
+ bool Done() { return current_ >= predecessor_list_->length(); } |
+ HBasicBlock* Current() { return predecessor_list_->at(current_); } |
+ void Advance() { current_++; } |
+ |
+ private: |
+ const ZoneList<HBasicBlock*>* predecessor_list_; |
+ int current_; |
}; |