mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibJS/Bytecode: Don't generate ResolveThisBinding if not needed
Functions that don't have a FunctionEnvironment will get their `this` value from the ExecutionContext. This patch stops generating ResolveThisBinding instructions at all for functions like that, and instead pre-populates the `this` register when entering a new bytecode executable.
This commit is contained in:
@@ -718,6 +718,7 @@ Interpreter::ResultAndReturnRegister Interpreter::run_executable(Executable& exe
|
||||
|
||||
reg(Register::accumulator()) = initial_accumulator_value;
|
||||
reg(Register::return_value()) = {};
|
||||
reg(Register::this_value()) = running_execution_context.this_value;
|
||||
|
||||
running_execution_context.executable = &executable;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user