mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 04:37:55 +00:00
LibJS: Add caching of this value in ResolveThisBinding instruction
Because "this" value cannot be changed during function execution it is safe to compute it once and then use for future access. This optimization makes ai-astar.js run 8% faster.
This commit is contained in:
committed by
Andreas Kling
parent
bbd80d2e4d
commit
2bdc69c42c
@@ -208,6 +208,8 @@ Interpreter::ValueAndFrame Interpreter::run_and_return_frame(Realm& realm, Execu
|
||||
else
|
||||
push_call_frame(make<CallFrame>(), executable.number_of_registers);
|
||||
|
||||
TemporaryChange restore_this_value { m_this_value, {} };
|
||||
|
||||
for (;;) {
|
||||
Bytecode::InstructionStreamIterator pc(m_current_block->instruction_stream());
|
||||
TemporaryChange temp_change { m_pc, &pc };
|
||||
|
||||
Reference in New Issue
Block a user