mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-27 04:37:22 +00:00
LibJS: Implement 'this' in the bytecode VM
ThisExpression now emits a "ResolveThisBinding" bytecode op, which simply loads the VM's current 'this' binding into the accumulator.
This commit is contained in:
parent
7c7bc4f44a
commit
3117182c2e
Notes:
sideshowbarker
2024-07-18 01:56:46 +09:00
Author: https://github.com/awesomekling
Commit: 3117182c2e
5 changed files with 29 additions and 0 deletions
|
@ -715,6 +715,18 @@ public:
|
|||
void replace_references_impl(BasicBlock const&, BasicBlock const&) { }
|
||||
};
|
||||
|
||||
class ResolveThisBinding final : public Instruction {
|
||||
public:
|
||||
explicit ResolveThisBinding()
|
||||
: Instruction(Type::ResolveThisBinding)
|
||||
{
|
||||
}
|
||||
|
||||
void execute_impl(Bytecode::Interpreter&) const;
|
||||
String to_string_impl(Bytecode::Executable const&) const;
|
||||
void replace_references_impl(BasicBlock const&, BasicBlock const&) { }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace JS::Bytecode {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue