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

@@ -62,9 +62,15 @@ public:
Utf16FlyString const& name() const { return shared_data().m_name; }
void set_name(Utf16FlyString const& name);
void set_is_class_constructor() { const_cast<SharedFunctionInstanceData&>(shared_data()).m_is_class_constructor = true; }
void set_is_class_constructor() { const_cast<SharedFunctionInstanceData&>(shared_data()).set_is_class_constructor(); }
auto& bytecode_executable() const { return shared_data().m_executable; }
[[nodiscard]] bool can_inline_call() const { return shared_data().can_inline_call(); }
[[nodiscard]] Bytecode::Executable& inline_call_executable() const
{
VERIFY(can_inline_call());
return *shared_data().m_executable;
}
Environment* environment() { return m_environment; }
virtual Realm* realm() const override { return &shape().realm(); }