mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +00:00
507f83a615
We already have a dedicated register slot for `this`, so instead of having ResolveThisBinding take a `dst` operand, just write the value directly into the `this` register every time.
23 lines
537 B
C++
23 lines
537 B
C++
/*
|
|
* Copyright (c) 2024, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibJS/Bytecode/Generator.h>
|
|
#include <LibJS/Bytecode/ScopedOperand.h>
|
|
|
|
namespace JS::Bytecode {
|
|
|
|
ScopedOperandImpl::~ScopedOperandImpl()
|
|
{
|
|
if (!m_generator.is_finished() && m_operand.is_register() && m_operand.as_register().index() >= Register::reserved_register_count)
|
|
m_generator.free_register(m_operand.as_register());
|
|
}
|
|
|
|
Register Operand::as_register() const
|
|
{
|
|
return Register { m_index };
|
|
}
|
|
|
|
}
|