mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:48:12 +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:
parent
4efccbd030
commit
6a0d1fa259
16 changed files with 173 additions and 82 deletions
|
@ -516,7 +516,11 @@ static bool parse_and_run(JS::Interpreter& interpreter, const StringView& source
|
|||
auto unit = JS::Bytecode::Generator::generate(*program);
|
||||
if (s_dump_bytecode) {
|
||||
for (auto& block : unit.basic_blocks)
|
||||
block.dump();
|
||||
block.dump(unit);
|
||||
if (!unit.string_table->is_empty()) {
|
||||
outln();
|
||||
unit.string_table->dump();
|
||||
}
|
||||
}
|
||||
|
||||
if (s_run_bytecode) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue