mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
LibJS: Don't try to merge blocks not ending in Jumps
This commit is contained in:
parent
192897c269
commit
186237aec8
Notes:
sideshowbarker
2024-07-17 05:09:48 +09:00
Author: https://github.com/Hendiadyoin1 Commit: https://github.com/SerenityOS/serenity/commit/186237aec8 Pull-request: https://github.com/SerenityOS/serenity/pull/15971 Reviewed-by: https://github.com/FireFox317 Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/kleinesfilmroellchen ✅
@ -30,6 +30,9 @@ void MergeBlocks::perform(PassPipelineExecutable& executable)
|
||||
if (executable.exported_blocks->contains(*entry.value.begin()))
|
||||
continue;
|
||||
|
||||
if (entry.key->terminator()->type() != Instruction::Type::Jump)
|
||||
continue;
|
||||
|
||||
{
|
||||
InstructionStreamIterator it { entry.key->instruction_stream() };
|
||||
auto& first_instruction = *it;
|
||||
@ -95,6 +98,7 @@ void MergeBlocks::perform(PassPipelineExecutable& executable)
|
||||
auto it = blocks_to_merge.begin();
|
||||
auto const* current_block = *it;
|
||||
blocks_to_merge.remove(it);
|
||||
|
||||
Vector<BasicBlock const*> successors { current_block };
|
||||
for (;;) {
|
||||
auto const* last = successors.last();
|
||||
|
Loading…
Reference in New Issue
Block a user