mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-04 08:36:12 +00:00
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:
parent
9d57b55f24
commit
507f83a615
Notes:
sideshowbarker
2024-07-17 01:27:18 +09:00
Author: https://github.com/awesomekling
Commit: 507f83a615
Pull-request: https://github.com/SerenityOS/serenity/pull/24504
6 changed files with 35 additions and 39 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue