Index: src/hydrogen.h |
diff --git a/src/hydrogen.h b/src/hydrogen.h |
index f1962fe1c4fb06d4bfb2bcef13cdb72dbb90e201..44166befe3d5cf3f7073e046eaffdd5aa53704ab 100644 |
--- a/src/hydrogen.h |
+++ b/src/hydrogen.h |
@@ -69,6 +69,11 @@ class HBasicBlock: public ZoneObject { |
void set_last(HInstruction* instr) { last_ = instr; } |
HControlInstruction* end() const { return end_; } |
HLoopInformation* loop_information() const { return loop_information_; } |
+ HLoopInformation* current_loop() const { |
+ return IsLoopHeader() ? loop_information() |
+ : (parent_loop_header() != NULL |
+ ? parent_loop_header()->loop_information() : NULL); |
+ } |
const ZoneList<HBasicBlock*>* predecessors() const { return &predecessors_; } |
bool HasPredecessor() const { return predecessors_.length() > 0; } |
const ZoneList<HBasicBlock*>* dominated_blocks() const { |
@@ -271,6 +276,20 @@ class HLoopInformation: public ZoneObject { |
stack_check_ = stack_check; |
} |
+ bool IsNestedInThisLoop(HLoopInformation* other) { |
+ while (other != NULL) { |
+ if (other == this) { |
+ return true; |
+ } |
+ other = other->parent_loop(); |
+ } |
+ return false; |
+ } |
+ HLoopInformation* parent_loop() { |
+ HBasicBlock* parent_header = loop_header()->parent_loop_header(); |
+ return parent_header != NULL ? parent_header->loop_information() : NULL; |
+ } |
+ |
private: |
void AddBlock(HBasicBlock* block); |
@@ -282,6 +301,7 @@ class HLoopInformation: public ZoneObject { |
class BoundsCheckTable; |
+class InductionVariableBlocksTable; |
class HGraph: public ZoneObject { |
public: |
explicit HGraph(CompilationInfo* info); |
@@ -448,6 +468,7 @@ class HGraph: public ZoneObject { |
void CheckForBackEdge(HBasicBlock* block, HBasicBlock* successor); |
void SetupInformativeDefinitionsInBlock(HBasicBlock* block); |
void SetupInformativeDefinitionsRecursively(HBasicBlock* block); |
+ void EliminateRedundantBoundsChecksUsingInductionVariables(); |
Isolate* isolate_; |
int next_block_id_; |