LibJS/Bytecode: Always resolve this binding into dedicated register

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.
This commit is contained in:
Andreas Kling 2024-05-31 20:41:29 +02:00
commit 507f83a615
Notes: sideshowbarker 2024-07-17 01:27:18 +09:00
6 changed files with 35 additions and 39 deletions

View file

@ -2550,23 +2550,14 @@ private:
class ResolveThisBinding final : public Instruction {
public:
explicit ResolveThisBinding(Operand dst)
ResolveThisBinding()
: Instruction(Type::ResolveThisBinding)
, m_dst(dst)
{
}
ThrowCompletionOr<void> execute_impl(Bytecode::Interpreter&) const;
ByteString to_byte_string_impl(Bytecode::Executable const&) const;
void visit_operands_impl(Function<void(Operand&)> visitor)
{
visitor(m_dst);
}
Operand dst() const { return m_dst; }
private:
Operand m_dst;
void visit_operands_impl(Function<void(Operand&)>) { }
};
class ResolveSuperBase final : public Instruction {