LibJS/Bytecode: Don't replace the entry block in MergeBlocks
The entry block must stay in place, although it's okay to merge stuff into it. This fixes 4 test262 tests and brings us to parity with optimization disabled. :^)
This commit is contained in:
parent
5b29974bfa
commit
acd29e064c
Notes:
sideshowbarker
2024-07-17 17:40:13 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/acd29e064c Pull-request: https://github.com/SerenityOS/serenity/pull/23462 Reviewed-by: https://github.com/Hendiadyoin1
1 changed files with 2 additions and 1 deletions
|
@ -36,7 +36,8 @@ void MergeBlocks::perform(PassPipelineExecutable& executable)
|
|||
if (entry.key->terminator()->type() != Instruction::Type::Jump)
|
||||
continue;
|
||||
|
||||
{
|
||||
// NOTE: We can't replace the first block in a function, as it's the entry block.
|
||||
if (entry.key != executable.executable.basic_blocks.first()) {
|
||||
InstructionStreamIterator it { entry.key->instruction_stream() };
|
||||
auto& first_instruction = *it;
|
||||
if (first_instruction.type() == Instruction::Type::Jump) {
|
||||
|
|
Loading…
Add table
Reference in a new issue