mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +00:00
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:
parent
32561bb90d
commit
2316a084bf
Notes:
sideshowbarker
2024-07-18 12:42:13 +09:00
Author: https://github.com/awesomekling
Commit: 2316a084bf
1 changed files with 11 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue