1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 11:45:06 +00:00

LibJS: Store strings in a string table

Instead of using Strings in the bytecode ops this adds a global string
table to the Executable struct which individual operations can refer
to using indices. This brings bytecode ops one step closer to being
pointer free.
This commit is contained in:
Gunnar Beutner 2021-06-09 10:02:01 +02:00 committed by Andreas Kling
parent 4efccbd030
commit 6a0d1fa259
16 changed files with 173 additions and 82 deletions

View file

@ -47,13 +47,13 @@ void BasicBlock::seal()
// It also doesn't work because instructions that have String members use RefPtr internally which must be in writable memory.
}
void BasicBlock::dump() const
void BasicBlock::dump(Bytecode::Executable const& executable) const
{
Bytecode::InstructionStreamIterator it(instruction_stream());
if (!m_name.is_empty())
warnln("{}:", m_name);
while (!it.at_end()) {
warnln("[{:4x}] {}", it.offset(), (*it).to_string());
warnln("[{:4x}] {}", it.offset(), (*it).to_string(executable));
++it;
}
}