mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibJS/Bytecode: Leave BlockDeclarationInstantiation in C++
Instead of implementing this AO in bytecode, we now have an instruction for it that simply invokes the C++ implementation. This allows us to simplify Bytecode::Generator quite a bit by removing all the variable scope tracking.
This commit is contained in:
@@ -1097,6 +1097,16 @@ ThrowCompletionOr<void> ToNumeric::execute_impl(Bytecode::Interpreter& interpret
|
||||
return {};
|
||||
}
|
||||
|
||||
ThrowCompletionOr<void> BlockDeclarationInstantiation::execute_impl(Bytecode::Interpreter& interpreter) const
|
||||
{
|
||||
auto& vm = interpreter.vm();
|
||||
auto old_environment = vm.running_execution_context().lexical_environment;
|
||||
interpreter.saved_lexical_environment_stack().append(old_environment);
|
||||
vm.running_execution_context().lexical_environment = new_declarative_environment(*old_environment);
|
||||
m_scope_node.block_declaration_instantiation(vm, vm.running_execution_context().lexical_environment);
|
||||
return {};
|
||||
}
|
||||
|
||||
DeprecatedString Load::to_deprecated_string_impl(Bytecode::Executable const&) const
|
||||
{
|
||||
return DeprecatedString::formatted("Load {}", m_src);
|
||||
@@ -1459,4 +1469,9 @@ DeprecatedString ToNumeric::to_deprecated_string_impl(Bytecode::Executable const
|
||||
return "ToNumeric"sv;
|
||||
}
|
||||
|
||||
DeprecatedString BlockDeclarationInstantiation::to_deprecated_string_impl(Bytecode::Executable const&) const
|
||||
{
|
||||
return "BlockDeclarationInstantiation"sv;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user