[Webkit-unassigned] [Bug 160588] Refactor MathIC compilation process in Baseline and DFG to turn temporary registers usage more flexible

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 2 16:42:20 PST 2017


https://bugs.webkit.org/show_bug.cgi?id=160588

--- Comment #43 from Saam Barati <sbarati at apple.com> ---
Comment on attachment 297820
  --> https://bugs.webkit.org/attachment.cgi?id=297820
Patch

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

> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:3572
> +        } else 
> +            scratchGPR[i] = InvalidGPRReg;

Is this side of the branch ever taken? It seems like we should almost assert against it, and if a generator knows how to handle using the tags, it should just *always* do that and report that it needs fewer registers.

> Source/JavaScriptCore/jit/JITAddGenerator.h:52
> +        FPRReg leftFPR, FPRReg rightFPR, Vector<GPRReg, scratchGPRRegCount> scratchGPRs, Vector<FPRReg, scratchFPRRegCount> scratchFPRs)

You shouldn't be copying these vectors for these constructors. I'd use "const Vector<...>&" as the type here.

> Source/JavaScriptCore/jit/JITArithmetic.cpp:777
> +        else
> +            scratchGPR[i] = InvalidGPRReg;

Ditto as the DFG code that does this.

> Source/JavaScriptCore/jit/JITMulGenerator.cpp:41
> +    // Maybe it was not possible allocate scratchGPR. In this case, we use result.tagGPR
> +    if (m_scratchGPR == InvalidGPRReg)
> +        m_scratchGPR = m_result.tagGPR();

Ditto, we should just always use tag if we're 32-bit and we know we need a scratch and that the code is valid when using the tag as a scratch.

> Source/JavaScriptCore/jit/JITMulGenerator.h:52
> +        FPRReg leftFPR, FPRReg rightFPR, Vector<GPRReg, scratchGPRRegCount> scratchGPRs, Vector<FPRReg, scratchFPRRegCount> scratchFPRs)

Ditto about copying the vectors.

> Source/JavaScriptCore/jit/JITSubGenerator.h:51
> +        FPRReg leftFPR, FPRReg rightFPR, Vector<GPRReg, scratchGPRRegCount> scratchGPRs, Vector<FPRReg, scratchFPRRegCount> scratchFPRs)

Ditto about copying the vectors.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170103/ef6c8678/attachment.html>


More information about the webkit-unassigned mailing list