<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#c23">Comment # 23</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:ticaiolima@gmail.com" title="Caio Lima <ticaiolima@gmail.com>"> <span class="fn">Caio Lima</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_FPR);
>
> Please make this a static_assert</span >
Ok
<span class="quote">>> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:3512
>> + // we need to check if it is possible allocate new registers
>
> It seems like all 32-bit snippets are able to use tags as their scratch, can we just remove this code?</span >
My intention is to enable allocate scratches and avoid use tagGPRs to avoid instructions to restore the tags. Current Snnipets uses just one scratch that is mapped to result .tagGPR , but others like JITPowGenerator can use more. If scratches are already allocated, we don't need to use x/y.tagGPR and consequently, we don't need to restore their tags on snnipets.
<span class="quote">>> Source/JavaScriptCore/jit/JITMathIC.h:56
>> +#define MATH_IC_MAX_FPR 1
>
> I would make these static fields inside JITMathIC instead of a define.</span >
Good. I am going to do that.
<span class="quote">>> Source/JavaScriptCore/jit/JITMulGenerator.cpp:41
>> + m_scratchGPR = m_result.tagGPR();
>
> Have you made sure it's always valid to do this?</span >
The current code always use result.tagGPR as scratch on 32bits. So I suppose that it is valid. Also, AFIK all results assign are boxed, so the tag is going to be restored properly. I can double check that.</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>