Index: src/hydrogen.h |
diff --git a/src/hydrogen.h b/src/hydrogen.h |
index 6312a52376f50713ac584460634dbf4a63161d28..f482717a8dc9bdf8d5650825778b0b7ad837e378 100644 |
--- a/src/hydrogen.h |
+++ b/src/hydrogen.h |
@@ -142,8 +142,9 @@ class HBasicBlock: public ZoneObject { |
} |
int PredecessorIndexOf(HBasicBlock* predecessor) const; |
- HSimulate* AddSimulate(BailoutId ast_id, |
- RemovableSimulate removable = FIXED_SIMULATE) { |
+ HPhi* AddNewPhi(int merged_index); |
+ HSimulate* AddNewSimulate(BailoutId ast_id, |
+ RemovableSimulate removable = FIXED_SIMULATE) { |
HSimulate* instr = CreateSimulate(ast_id, removable); |
AddInstruction(instr); |
return instr; |
@@ -453,6 +454,10 @@ class HGraph: public ZoneObject { |
uint32_instructions_->Add(instr, zone()); |
} |
+ void IncrementInNoSideEffectsScope() { no_side_effects_scope_count_++; } |
+ void DecrementInNoSideEffectsScope() { no_side_effects_scope_count_--; } |
+ bool IsInsideNoSideEffectsScope() { return no_side_effects_scope_count_ > 0; } |
+ |
private: |
HConstant* GetConstant(SetOncePointer<HConstant>* pointer, |
int32_t integer_value); |
@@ -498,6 +503,7 @@ class HGraph: public ZoneObject { |
bool depends_on_empty_array_proto_elements_; |
int type_change_checksum_; |
int maximum_environment_size_; |
+ int no_side_effects_scope_count_; |
DISALLOW_COPY_AND_ASSIGN(HGraph); |
}; |
@@ -970,8 +976,7 @@ class HGraphBuilder { |
explicit HGraphBuilder(CompilationInfo* info) |
: info_(info), |
graph_(NULL), |
- current_block_(NULL), |
- no_side_effects_scope_count_(0) {} |
+ current_block_(NULL) {} |
virtual ~HGraphBuilder() {} |
HBasicBlock* current_block() const { return current_block_; } |
@@ -1186,16 +1191,7 @@ class HGraphBuilder { |
AddInstruction(NewUncasted<I>(p1, p2, p3, p4, p5, p6, p7, p8))); |
} |
- void AddSimulate(BailoutId id, |
- RemovableSimulate removable = FIXED_SIMULATE); |
- |
- void IncrementInNoSideEffectsScope() { |
- no_side_effects_scope_count_++; |
- } |
- |
- void DecrementInNoSideEffectsScope() { |
- no_side_effects_scope_count_--; |
- } |
+ void AddSimulate(BailoutId id, RemovableSimulate removable = FIXED_SIMULATE); |
protected: |
virtual bool BuildGraph() = 0; |
@@ -1441,20 +1437,6 @@ class HGraphBuilder { |
bool finished_; |
}; |
- class NoObservableSideEffectsScope { |
- public: |
- explicit NoObservableSideEffectsScope(HGraphBuilder* builder) : |
- builder_(builder) { |
- builder_->IncrementInNoSideEffectsScope(); |
- } |
- ~NoObservableSideEffectsScope() { |
- builder_->DecrementInNoSideEffectsScope(); |
- } |
- |
- private: |
- HGraphBuilder* builder_; |
- }; |
- |
HValue* BuildNewElementsCapacity(HValue* old_capacity); |
void BuildNewSpaceArrayCheck(HValue* length, |
@@ -1576,7 +1558,6 @@ class HGraphBuilder { |
CompilationInfo* info_; |
HGraph* graph_; |
HBasicBlock* current_block_; |
- int no_side_effects_scope_count_; |
}; |
@@ -2329,6 +2310,21 @@ class HTracer: public Malloced { |
}; |
+class NoObservableSideEffectsScope { |
+ public: |
+ explicit NoObservableSideEffectsScope(HGraphBuilder* builder) : |
+ builder_(builder) { |
+ builder_->graph()->IncrementInNoSideEffectsScope(); |
+ } |
+ ~NoObservableSideEffectsScope() { |
+ builder_->graph()->DecrementInNoSideEffectsScope(); |
+ } |
+ |
+ private: |
+ HGraphBuilder* builder_; |
+}; |
+ |
+ |
} } // namespace v8::internal |
#endif // V8_HYDROGEN_H_ |