summaryrefslogtreecommitdiff
path: root/Userland/Utilities
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-06-09 10:02:01 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-09 17:42:52 +0200
commit6a0d1fa2598e4546ee121331a71241d519627979 (patch)
tree1ec909288f8da890ee8ebb694bc807f0cde6770b /Userland/Utilities
parent4efccbd030b06753aa97993571180dba9b4e6a12 (diff)
downloadserenity-6a0d1fa2598e4546ee121331a71241d519627979.zip
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.
Diffstat (limited to 'Userland/Utilities')
-rw-r--r--Userland/Utilities/js.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Userland/Utilities/js.cpp b/Userland/Utilities/js.cpp
index ee2efc19f1..b99d2c5387 100644
--- a/Userland/Utilities/js.cpp
+++ b/Userland/Utilities/js.cpp
@@ -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) {