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:
Andreas Kling 2025-04-28 19:02:56 +02:00 committed by Jelle Raaijmakers
parent e7ae9c8ebf
commit 4d17707b26
Notes: github-actions[bot] 2025-04-28 19:13:46 +00:00
6 changed files with 22 additions and 33 deletions

View file

@ -913,8 +913,8 @@ static ErrorInformation extract_error_information(JS::VM& vm, JS::Value exceptio
else {
for (ssize_t i = vm.execution_context_stack().size() - 1; i >= 0; --i) {
auto& frame = vm.execution_context_stack()[i];
if (frame->executable && frame->program_counter.has_value()) {
auto source_range = frame->executable->source_range_at(frame->program_counter.value()).realize();
if (frame->executable) {
auto source_range = frame->executable->source_range_at(frame->program_counter).realize();
attributes.filename = MUST(String::from_byte_string(source_range.filename()));
attributes.lineno = source_range.start.line;
attributes.colno = source_range.start.column;