From b4554c01db519b1e61b34028ac2bd037cfa4fcf4 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 28 Apr 2025 02:04:54 +0200 Subject: [PATCH] LibJS: Mark ESFO path for [[Call]] on a class constructor [[unlikely]] This is an exception path that's not supposed to be called normally, so let's mark it unlikely. --- Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp b/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp index 12bb83a9009..0520c40fc24 100644 --- a/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp +++ b/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp @@ -516,7 +516,7 @@ FLATTEN ThrowCompletionOr ECMAScriptFunctionObject::internal_call(Executi ASSERT(&vm.running_execution_context() == &callee_context); // 4. If F.[[IsClassConstructor]] is true, then - if (is_class_constructor()) { + if (is_class_constructor()) [[unlikely]] { // a. Let error be a newly created TypeError object. // b. NOTE: error is created in calleeContext with F's associated Realm Record. auto throw_completion = vm.throw_completion(ErrorType::ClassConstructorWithoutNew, name());