LibJS: Create a global/outermost CallFrame for Bytecode::Interpreter

Note that we don't yet support nested calls using bytecode.
This commit is contained in:
Andreas Kling 2021-06-05 15:11:00 +02:00
parent 32561bb90d
commit 2316a084bf
Notes: sideshowbarker 2024-07-18 12:42:13 +09:00

View file

@ -25,6 +25,17 @@ void Interpreter::run(Bytecode::Block const& block)
{
dbgln("Bytecode::Interpreter will run block {:p}", &block);
CallFrame global_call_frame;
global_call_frame.this_value = &global_object();
static FlyString global_execution_context_name = "(*BC* global execution context)";
global_call_frame.function_name = global_execution_context_name;
global_call_frame.scope = &global_object();
VERIFY(!vm().exception());
// FIXME: How do we know if we're in strict mode? Maybe the Bytecode::Block should know this?
// global_call_frame.is_strict_mode = ???;
vm().push_call_frame(global_call_frame, global_object());
VERIFY(!vm().exception());
m_registers.resize(block.register_count());
size_t pc = 0;