mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-03 17:58:49 +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:
parent
1060c63bd8
commit
01e9eee7dd
Notes:
sideshowbarker
2024-07-17 11:34:34 +09:00
Author: https://github.com/awesomekling
Commit: 01e9eee7dd
Pull-request: https://github.com/SerenityOS/serenity/pull/23390
Reviewed-by: https://github.com/trflynn89 ✅
2 changed files with 8 additions and 5 deletions
|
@ -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 {};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue