<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Refactor MathIC compilation process in Baseline and DFG to turn temporary registers usage more flexible"
href="https://bugs.webkit.org/show_bug.cgi?id=160588#c22">Comment # 22</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Refactor MathIC compilation process in Baseline and DFG to turn temporary registers usage more flexible"
href="https://bugs.webkit.org/show_bug.cgi?id=160588">bug 160588</a>
from <span class="vcard"><a class="email" href="mailto:sbarati@apple.com" title="Saam Barati <sbarati@apple.com>"> <span class="fn">Saam Barati</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=289796&action=diff" name="attach_289796" title="Patch">attachment 289796</a> <a href="attachment.cgi?id=289796&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=289796&action=review">https://bugs.webkit.org/attachment.cgi?id=289796&action=review</a>
<span class="quote">> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:3434
> + ASSERT(scratchFPRRegCount <= MATH_IC_MAX_GPR);
> + ASSERT(scratchFPRRegCount <= MATH_IC_MAX_FPR);</span >
Please make this a static_assert
<span class="quote">> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:3512
> + // Since registers on 32-bit architectures like x86_32 are scarce
> + // we need to check if it is possible allocate new registers</span >
It seems like all 32-bit snippets are able to use tags as their scratch, can we just remove this code?
<span class="quote">> Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:1569
> + ASSERT(numGPScratchRegisters <= MATH_IC_MAX_GPR);
> + ASSERT(numFPScratchRegisters <= MATH_IC_MAX_FPR);</span >
Please make this a static_assert
<span class="quote">> Source/JavaScriptCore/jit/JITMathIC.h:56
> +#define MATH_IC_MAX_GPR 1
> +#define MATH_IC_MAX_FPR 1</span >
I would make these static fields inside JITMathIC instead of a define.
<span class="quote">> Source/JavaScriptCore/jit/JITMulGenerator.cpp:41
> + if (m_scratchGPR == InvalidGPRReg)
> + m_scratchGPR = m_result.tagGPR();</span >
Have you made sure it's always valid to do this?</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>