Index: src/crankshaft/hydrogen.h |
diff --git a/src/crankshaft/hydrogen.h b/src/crankshaft/hydrogen.h |
index 183ab051118f98ba26fb52e5e0d87aea60a6ff26..db72cc038dbb640cde2fb70b1d628a485db7b440 100644 |
--- a/src/crankshaft/hydrogen.h |
+++ b/src/crankshaft/hydrogen.h |
@@ -884,6 +884,10 @@ class FunctionState final { |
int inlining_id() const { return inlining_id_; } |
+ void IncrementInDoExpressionScope() { do_expression_scope_count_++; } |
+ void DecrementInDoExpressionScope() { do_expression_scope_count_--; } |
+ bool IsInsideDoExpressionScope() { return do_expression_scope_count_ > 0; } |
+ |
private: |
HOptimizedGraphBuilder* owner_; |
@@ -916,6 +920,8 @@ class FunctionState final { |
int inlining_id_; |
SourcePosition outer_source_position_; |
+ int do_expression_scope_count_; |
+ |
FunctionState* outer_; |
}; |
@@ -3025,6 +3031,19 @@ class NoObservableSideEffectsScope final { |
HGraphBuilder* builder_; |
}; |
+class DoExpressionScope final { |
+ public: |
+ explicit DoExpressionScope(HOptimizedGraphBuilder* builder) |
+ : builder_(builder) { |
+ builder_->function_state()->IncrementInDoExpressionScope(); |
+ } |
+ ~DoExpressionScope() { |
+ builder_->function_state()->DecrementInDoExpressionScope(); |
+ } |
+ |
+ private: |
+ HOptimizedGraphBuilder* builder_; |
+}; |
} // namespace internal |
} // namespace v8 |