Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(547)

Unified Diff: src/crankshaft/hydrogen.h

Issue 1769463002: Allow Crankshaft to tolerate certain do-expressions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Missed comment. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/bailout-reason.h ('k') | src/crankshaft/hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/bailout-reason.h ('k') | src/crankshaft/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698