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

Unified Diff: src/compiler/control-builders.cc

Issue 2140673007: [turbofan] Introduce explicit loop exits markers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Created 4 years, 5 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
Index: src/compiler/control-builders.cc
diff --git a/src/compiler/control-builders.cc b/src/compiler/control-builders.cc
index 6905ef589ff56c11b18ac6717969d726aee56577..d6b8b4050b84f5aad493cbc55a357dbfd4c5a3af 100644
--- a/src/compiler/control-builders.cc
+++ b/src/compiler/control-builders.cc
@@ -36,6 +36,7 @@ void LoopBuilder::BeginLoop(BitVector* assigned, bool is_osr) {
loop_environment_ = environment()->CopyForLoop(assigned, is_osr);
continue_environment_ = environment()->CopyAsUnreachable();
break_environment_ = environment()->CopyAsUnreachable();
+ assigned_ = assigned;
}
@@ -60,6 +61,7 @@ void LoopBuilder::EndBody() {
void LoopBuilder::EndLoop() {
loop_environment_->Merge(environment());
set_environment(break_environment_);
+ ExitLoop();
}
@@ -82,6 +84,16 @@ void LoopBuilder::BreakWhen(Node* condition) {
control_if.End();
}
+void LoopBuilder::ExitLoop(Node** extra_value_to_rename) {
+ if (extra_value_to_rename) {
+ environment()->Push(*extra_value_to_rename);
+ }
+ environment()->PrepareForLoopExit(loop_environment_->GetControlDependency(),
+ assigned_);
+ if (extra_value_to_rename) {
+ environment()->Pop();
+ }
+}
void SwitchBuilder::BeginSwitch() {
body_environment_ = environment()->CopyAsUnreachable();

Powered by Google App Engine
This is Rietveld 408576698