1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-24 01:05:08 +00:00

LibJS: Introduce Builtins

Builtins are functions that can be detected during bytecode generation
and enable fast-paths in the JIT.
This commit is contained in:
Simon Wanner 2023-11-17 11:48:30 +01:00 committed by Andreas Kling
parent b9141d85d8
commit 86b85aa68b
13 changed files with 191 additions and 4 deletions

View file

@ -1514,6 +1514,8 @@ static StringView call_type_to_string(CallType type)
DeprecatedString Call::to_deprecated_string_impl(Bytecode::Executable const& executable) const
{
auto type = call_type_to_string(m_type);
if (m_builtin.has_value())
return DeprecatedString::formatted("Call{} callee:{}, this:{}, first_arg:{} (builtin {})", type, m_callee, m_this_value, m_first_argument, m_builtin.value());
if (m_expression_string.has_value())
return DeprecatedString::formatted("Call{} callee:{}, this:{}, first_arg:{} ({})", type, m_callee, m_this_value, m_first_argument, executable.get_string(m_expression_string.value()));
return DeprecatedString::formatted("Call{} callee:{}, this:{}, first_arg:{}", type, m_callee, m_first_argument, m_this_value);