Commit 88bc3e1d authored by Ross McIlroy's avatar Ross McIlroy Committed by Commit Bot

[TurboProp] Have BasicBlockUpdater update successor's predecessors on AddThrow.

When rewiring a block to throw, we need to remove the current block from the list
of predecessors for all of our successors, as well as clearing our current successors.

BUG=v8:9684

Change-Id: I0da063b2ef707f07ea27a5f72cabd2ff9a91cc42
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1881154Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64579}
parent 572be6f1
......@@ -270,6 +270,10 @@ void GraphAssembler::BasicBlockUpdater::AddThrow(Node* node) {
}
original_control_input_ = node;
original_control_ = BasicBlock::kThrow;
for (SuccessorInfo succ : saved_successors_) {
succ.block->RemovePredecessor(succ.index);
}
saved_successors_.clear();
}
......
......@@ -50,6 +50,10 @@ void BasicBlock::AddPredecessor(BasicBlock* predecessor) {
predecessors_.push_back(predecessor);
}
void BasicBlock::RemovePredecessor(size_t index) {
predecessors_.erase(predecessors_.begin() + index);
}
void BasicBlock::AddNode(Node* node) { nodes_.push_back(node); }
void BasicBlock::set_control(Control control) { control_ = control; }
......
......@@ -74,6 +74,7 @@ class V8_EXPORT_PRIVATE BasicBlock final
BasicBlock* PredecessorAt(size_t index) { return predecessors_[index]; }
void ClearPredecessors() { predecessors_.clear(); }
void AddPredecessor(BasicBlock* predecessor);
void RemovePredecessor(size_t index);
// Successors.
BasicBlockVector& successors() { return successors_; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment