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

Unified Diff: src/compiler/osr.cc

Issue 1188433010: [turbofan] Move graph trimming functionality to dedicated GraphTrimmer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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/compiler/node-marker.cc ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/osr.cc
diff --git a/src/compiler/osr.cc b/src/compiler/osr.cc
index 4d8583bdc1bac23684f9623cd6012ca2ebcea43b..fcd04768fd7bb5720685dac59e65e951a2b82348 100644
--- a/src/compiler/osr.cc
+++ b/src/compiler/osr.cc
@@ -8,6 +8,7 @@
#include "src/compiler/control-reducer.h"
#include "src/compiler/frame.h"
#include "src/compiler/graph.h"
+#include "src/compiler/graph-trimmer.h"
#include "src/compiler/graph-visualizer.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/loop-analysis.h"
@@ -337,9 +338,12 @@ void OsrHelper::Deconstruct(JSGraph* jsgraph, CommonOperatorBuilder* common,
Node* node = ControlReducer::ReduceMerge(jsgraph, osr_loop);
if (node != osr_loop) osr_loop->ReplaceUses(node);
- // Run the normal control reduction, which naturally trims away the dead
- // parts of the graph.
+ // Run control reduction and graph trimming.
ControlReducer::ReduceGraph(tmp_zone, jsgraph);
+ GraphTrimmer trimmer(tmp_zone, jsgraph->graph());
+ NodeVector roots(tmp_zone);
+ jsgraph->GetCachedNodes(&roots);
+ trimmer.TrimGraph(roots.begin(), roots.end());
}
@@ -351,7 +355,6 @@ void OsrHelper::SetupFrame(Frame* frame) {
frame->SetOsrStackSlotCount(static_cast<int>(UnoptimizedFrameSlots()));
}
-
} // namespace compiler
} // namespace internal
} // namespace v8
« no previous file with comments | « src/compiler/node-marker.cc ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698