Index: src/hydrogen.h |
diff --git a/src/hydrogen.h b/src/hydrogen.h |
index eadb28084fa1065b906c47a4c068c996c6ddb744..52fa9915b921154213a4c05c171effb6a4d85259 100644 |
--- a/src/hydrogen.h |
+++ b/src/hydrogen.h |
@@ -865,7 +865,10 @@ class FunctionState { |
class HGraphBuilder { |
public: |
explicit HGraphBuilder(CompilationInfo* info) |
- : info_(info), graph_(NULL), current_block_(NULL) {} |
+ : info_(info), |
+ graph_(NULL), |
+ current_block_(NULL), |
+ in_no_side_effects_scope_(0) {} |
danno
2013/04/11 12:55:51
no_side_effects_scope_count_?
Hannes Payer (out of office)
2013/04/11 13:00:03
Done.
|
virtual ~HGraphBuilder() {} |
HBasicBlock* current_block() const { return current_block_; } |
@@ -891,6 +894,14 @@ class HGraphBuilder { |
HReturn* AddReturn(HValue* value); |
+ void IncrementInNoSideEffectsScope() { |
+ in_no_side_effects_scope_++; |
+ } |
+ |
+ void DecrementInNoSideEffectsScope() { |
+ in_no_side_effects_scope_--; |
mvstanton
2013/04/11 13:02:38
I would add ASSERT(in_no_side_effects_scope >= 0);
|
+ } |
+ |
protected: |
virtual bool BuildGraph() = 0; |
@@ -1032,6 +1043,20 @@ class HGraphBuilder { |
bool finished_; |
}; |
+ class NoObservableSideEffectsScope { |
+ public: |
+ explicit NoObservableSideEffectsScope(HGraphBuilder* builder) : |
+ builder_(builder) { |
+ builder_->IncrementInNoSideEffectsScope(); |
+ } |
+ ~NoObservableSideEffectsScope() { |
+ builder_->DecrementInNoSideEffectsScope(); |
+ } |
+ |
+ private: |
+ HGraphBuilder* builder_; |
+ }; |
+ |
HValue* BuildNewElementsCapacity(HValue* context, |
HValue* old_capacity); |
@@ -1082,6 +1107,7 @@ class HGraphBuilder { |
CompilationInfo* info_; |
HGraph* graph_; |
HBasicBlock* current_block_; |
+ int in_no_side_effects_scope_; |
}; |