mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-08 05:27:14 +09:00
LibJS: Store bytecode VM program counter in ExecutionContext
This way it's always automatically correct, and we don't have to manually flush it in push_execution_context(). ~7% speedup on the MicroBench/call* tests :^)
This commit is contained in:
parent
e7ae9c8ebf
commit
4d17707b26
Notes:
github-actions[bot]
2025-04-28 19:13:46 +00:00
Author: https://github.com/awesomekling
Commit: 4d17707b26
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4509
Reviewed-by: https://github.com/gmta ✅
6 changed files with 22 additions and 33 deletions
|
@ -381,9 +381,8 @@ FLATTEN_ON_CLANG void Interpreter::run_bytecode(size_t entry_point)
|
|||
auto& executable = current_executable();
|
||||
auto const* bytecode = executable.bytecode.data();
|
||||
|
||||
size_t program_counter = entry_point;
|
||||
|
||||
TemporaryChange change(m_program_counter, Optional<size_t&>(program_counter));
|
||||
size_t& program_counter = running_execution_context.program_counter;
|
||||
program_counter = entry_point;
|
||||
|
||||
// Declare a lookup table for computed goto with each of the `handle_*` labels
|
||||
// to avoid the overhead of a switch statement.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue