Bug 219034

Summary: CodeBlock m_shouldAlwaysBeInlined in JIT::compileWithoutLinking should be set directly.
Product: WebKit Reporter: xc.o.c.1180 <xc.o.c.1180>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ews-watchlist, keith_miller, mark.lam, msaboff, saam, smoley, tzagallo, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Proposed patch.
none
Patch xc.o.c.1180: review?

Description xc.o.c.1180@gmail.com 2020-11-17 07:46:02 PST
Created attachment 414339 [details]
Proposed patch.

It does not depend on JS execution, this saves a few JIT codes.

store8(TrustedImm32(0), &m_codeBlock->m_shouldAlwaysBeInlined);
Comment 1 Radar WebKit Bug Importer 2020-11-18 10:37:55 PST
<rdar://problem/71545930>
Comment 2 Yusuke Suzuki 2020-11-18 19:15:42 PST
Comment on attachment 414339 [details]
Proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=414339&action=review

> JIT.cpp:789
> +        m_codeBlock->m_shouldAlwaysBeInlined = false;

I think this should be removed since inlining function including arity-fixup is supported in DFG and FTL.
Can you upload a patch by `webkit-patch` command? And please describe the goal of the change in ChangeLog file which template is generated by webkit-patch command.
https://webkit.org/contributing-code/ describes the detailed process :)
Comment 3 xc.o.c.1180@gmail.com 2020-11-19 06:31:04 PST
Created attachment 414573 [details]
Patch
Comment 4 xc.o.c.1180@gmail.com 2020-11-19 06:33:27 PST
Comment on attachment 414573 [details]
Patch

>Subversion Revision: 270020
>diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
>index 368551eaad5e5da24d5379302ce8fe93c84db7a5..320f325f77418f95dc498d7a1582151b4fa6e7e2 100644
>--- a/Source/JavaScriptCore/ChangeLog
>+++ b/Source/JavaScriptCore/ChangeLog
>@@ -1,3 +1,15 @@
>+2020-11-19  xc.o.c.1180 at gmail.com
>+
>+        CodeBlock m_shouldAlwaysBeInlined in JIT::compileWithoutLinking should be set directly.
>+        https://bugs.webkit.org/show_bug.cgi?id=219034
>+
>+        Reviewed by Yusuke Suzuki.
>+
>+	It does not depend on JS execution, this saves a few JIT codes.
>+
>+        * jit/JIT.cpp:
>+        (JSC::JIT::compileWithoutLinking):
>+
> 2020-11-18  Dmitry Bezhetskov  <dbezhetskov@igalia.com>
> 
>         [WASM-References] Remove subtyping rule for externref and funcref
>diff --git a/Source/JavaScriptCore/jit/JIT.cpp b/Source/JavaScriptCore/jit/JIT.cpp
>index ce87c8764775fafb0c879f59e9f94a3908f86cc3..f33911356ac0b8af0366a5adeaa8fddcb34c5cf2 100644
>--- a/Source/JavaScriptCore/jit/JIT.cpp
>+++ b/Source/JavaScriptCore/jit/JIT.cpp
>@@ -786,7 +786,7 @@ void JIT::compileWithoutLinking(JITCompilationEffort effort)
>     bool requiresArityFixup = m_codeBlock->m_numParameters != 1;
>     if (m_codeBlock->codeType() == FunctionCode && requiresArityFixup) {
>         m_arityCheck = label();
>-        store8(TrustedImm32(0), &m_codeBlock->m_shouldAlwaysBeInlined);
>+        m_codeBlock->m_shouldAlwaysBeInlined = false;
>         emitFunctionPrologue();
>         emitPutToCallFrameHeader(m_codeBlock, CallFrameSlot::codeBlock);
>
Comment 5 xc.o.c.1180@gmail.com 2020-11-19 06:35:54 PST
That line is still needed, otherwise, operationOptimize prevents entering DFG JIT.