mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-22 15:44:45 +00:00
LibJS/Bytecode: Avoid Value==Value in Call built-in fast path
Comparing two Values has to call the generic same_value() helper, and we can avoid this by simply using a stronger type for built-in native function handlers.
This commit is contained in:
@@ -1248,7 +1248,10 @@ ThrowCompletionOr<void> Call::execute_impl(Bytecode::Interpreter& interpreter) c
|
||||
|
||||
TRY(throw_if_needed_for_call(interpreter, callee, call_type(), expression_string()));
|
||||
|
||||
if (m_builtin.has_value() && m_argument_count == Bytecode::builtin_argument_count(m_builtin.value()) && interpreter.realm().get_builtin_value(m_builtin.value()) == callee) {
|
||||
if (m_builtin.has_value()
|
||||
&& m_argument_count == Bytecode::builtin_argument_count(m_builtin.value())
|
||||
&& callee.is_object()
|
||||
&& interpreter.realm().get_builtin_value(m_builtin.value()) == &callee.as_object()) {
|
||||
interpreter.set(dst(), TRY(dispatch_builtin_call(interpreter, m_builtin.value(), { m_arguments, m_argument_count })));
|
||||
return {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user