mirror of
https://github.com/RGBCube/serenity
synced 2025-05-25 19:15: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:
parent
4efccbd030
commit
6a0d1fa259
16 changed files with 173 additions and 82 deletions
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
#include <AK/Debug.h>
|
||||
#include <AK/TemporaryChange.h>
|
||||
#include <LibJS/Bytecode/BasicBlock.h>
|
||||
#include <LibJS/Bytecode/Instruction.h>
|
||||
#include <LibJS/Bytecode/Interpreter.h>
|
||||
|
@ -38,6 +39,8 @@ Value Interpreter::run(Executable const& executable)
|
|||
{
|
||||
dbgln_if(JS_BYTECODE_DEBUG, "Bytecode::Interpreter will run unit {:p}", &executable);
|
||||
|
||||
TemporaryChange restore_executable { m_current_executable, &executable };
|
||||
|
||||
CallFrame global_call_frame;
|
||||
if (vm().call_stack().is_empty()) {
|
||||
global_call_frame.this_value = &global_object();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue