mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 03:57:35 +00:00
LibJS/JIT: Compile the ResolveSuperBase instruction
This commit is contained in:
parent
4e9edb8c53
commit
ad81f49b02
2 changed files with 21 additions and 1 deletions
|
@ -1412,6 +1412,25 @@ void Compiler::compile_get_private_by_id(Bytecode::Op::GetPrivateById const& op)
|
|||
check_exception();
|
||||
}
|
||||
|
||||
static Value cxx_resolve_super_base(VM& vm)
|
||||
{
|
||||
// 1. Let env be GetThisEnvironment().
|
||||
auto& env = verify_cast<FunctionEnvironment>(*get_this_environment(vm));
|
||||
|
||||
// 2. Assert: env.HasSuperBinding() is true.
|
||||
VERIFY(env.has_super_binding());
|
||||
|
||||
// 3. Let baseValue be ? env.GetSuperBase().
|
||||
return TRY_OR_SET_EXCEPTION(env.get_super_base());
|
||||
}
|
||||
|
||||
void Compiler::compile_resolve_super_base(Bytecode::Op::ResolveSuperBase const&)
|
||||
{
|
||||
native_call((void*)cxx_resolve_super_base);
|
||||
store_vm_register(Bytecode::Register::accumulator(), RET);
|
||||
check_exception();
|
||||
}
|
||||
|
||||
void Compiler::jump_to_exit()
|
||||
{
|
||||
m_assembler.jump(m_exit_label);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue