From 969d9e1fd34d619dcdd210d3235a3bab4ba39b09 Mon Sep 17 00:00:00 2001 From: Simon Wanner Date: Sat, 4 Nov 2023 16:39:10 +0100 Subject: [PATCH] LibJS: Remove expensive dead code in get_source_range This was forgotten when cleaning up debug prints but has a huge performance impact (around 1s / 15% on test-js). --- Userland/Libraries/LibJS/Runtime/VM.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/VM.cpp b/Userland/Libraries/LibJS/Runtime/VM.cpp index ad020f2e81..24b1b4562c 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.cpp +++ b/Userland/Libraries/LibJS/Runtime/VM.cpp @@ -1174,10 +1174,8 @@ static Optional get_source_range(ExecutionContext const* // JIT frame for (auto address : native_stack) { auto range = native_executable->get_source_range(*context->executable, address); - if (range.has_value()) { - auto realized = range->realize(); + if (range.has_value()) return range; - } } return {};