LibJS: Cache JS-to-JS inline call eligibility

Store whether a function can participate in JS-to-JS inline calls on
SharedFunctionInstanceData instead of recomputing the function kind,
class-constructor bit, and bytecode availability at each fast-path
call site.
This commit is contained in:
Andreas Kling 2026-04-13 13:43:55 +02:00 committed by Andreas Kling
parent 4ad800b594
commit df0fdee2a0
Notes: github-actions[bot] 2026-04-14 06:16:17 +00:00
8 changed files with 46 additions and 12 deletions

View file

@ -95,10 +95,11 @@ ThrowCompletionOr<Value> NativeJavaScriptBackedFunction::call()
Bytecode::Executable& NativeJavaScriptBackedFunction::bytecode_executable()
{
auto& executable = m_shared_function_instance_data->m_executable;
auto executable = m_shared_function_instance_data->m_executable;
if (!executable) {
auto rust_executable = RustIntegration::compile_function(vm(), *m_shared_function_instance_data, true);
VERIFY(rust_executable);
m_shared_function_instance_data->set_executable(rust_executable);
executable = rust_executable;
executable->name = m_shared_function_instance_data->m_name;
if (Bytecode::g_dump_bytecode)