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

Unified Diff: src/compiler/osr.cc

Issue 934293002: [turbofan] Simply context specialization and fix for OSR. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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/compiler/js-inlining.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 69532fb3e60fdbdd8d2907772cf16249884225af..e96b047da6e66ab9d30ec8421152ab5e073ff730 100644
--- a/src/compiler/osr.cc
+++ b/src/compiler/osr.cc
@@ -103,6 +103,7 @@ static void PeelOuterLoopsForOsr(Graph* graph, CommonOperatorBuilder* common,
if (backedges == 1) {
// Simple case. Map the incoming edges to the loop to the previous copy.
for (Node* node : loop_tree->HeaderNodes(loop)) {
+ if (!all.IsLive(node)) continue; // dead phi hanging off loop.
Node* copy = mapping->at(node->id());
Node* backedge = node->InputAt(1);
if (previous) backedge = previous->at(backedge->id());
@@ -119,6 +120,7 @@ static void PeelOuterLoopsForOsr(Graph* graph, CommonOperatorBuilder* common,
Node* merge =
graph->NewNode(common->Merge(backedges), backedges, &tmp_inputs[0]);
for (Node* node : loop_tree->HeaderNodes(loop)) {
+ if (!all.IsLive(node)) continue; // dead phi hanging off loop.
Node* copy = mapping->at(node->id());
if (node == loop_header) {
// The entry to the loop is the merge.
@@ -214,7 +216,9 @@ bool OsrHelper::Deconstruct(JSGraph* jsgraph, CommonOperatorBuilder* common,
// Replace the normal entry with {Dead} and the loop entry with {Start}
// and run the control reducer to clean up the graph.
osr_normal_entry->ReplaceUses(dead);
+ osr_normal_entry->Kill();
osr_loop_entry->ReplaceUses(graph->start());
+ osr_loop_entry->Kill();
// Normally the control reducer removes loops whose first input is dead,
// but we need to avoid that because the osr_loop is reachable through
« no previous file with comments | « src/compiler/js-inlining.cc ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698