[Webkit-unassigned] [Bug 149051] Implement switch statements in WebAssembly

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 10 17:18:42 PDT 2015


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

--- Comment #2 from Sukolsak Sakshuwong <sukolsak at gmail.com> ---
Here's what buildSwitch() in the LLVM IR generator will look like:

void buildSwitch(LValue expression, const Vector<int64_t>& cases, const Vector<LBasicBlock>& targets, LBasicBlock defaultTarget)
{
    Vector<FTL::SwitchCase> switchCases;
    switchCases.reserveInitialCapacity(cases.size());
    for (size_t i = 0; i < cases.size(); ++i)
        switchCases.uncheckedAppend(FTL::SwitchCase(m_out.constInt32(static_cast<int32_t>(cases[i])), targets[i]));
    m_out.switchInstruction(expression, switchCases, defaultTarget, FTL::Weight());
}

-- 
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/20150911/31c7ba35/attachment.html>


More information about the webkit-unassigned mailing list