mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +00:00
LibJS/Bytecode: Bring back the bytecode optimization pipeline
...minus the EliminateLoads pass, since it was not compatible with the new bytecode format.
This commit is contained in:
parent
836d93f7e3
commit
5b29974bfa
15 changed files with 962 additions and 65 deletions
26
Userland/Libraries/LibJS/Bytecode/Pass/DumpCFG.cpp
Normal file
26
Userland/Libraries/LibJS/Bytecode/Pass/DumpCFG.cpp
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Ali Mohammad Pur <mpfard@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibJS/Bytecode/PassManager.h>
|
||||
|
||||
namespace JS::Bytecode::Passes {
|
||||
|
||||
void DumpCFG::perform(PassPipelineExecutable& executable)
|
||||
{
|
||||
started();
|
||||
|
||||
VERIFY(executable.cfg.has_value());
|
||||
outln(m_file, "CFG Dump for {} basic blocks:", executable.executable.basic_blocks.size());
|
||||
for (auto& entry : executable.cfg.value()) {
|
||||
for (auto& value : entry.value)
|
||||
outln(m_file, "{} -> {}", entry.key->name(), value->name());
|
||||
}
|
||||
outln(m_file);
|
||||
|
||||
finished();
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue