[Webkit-unassigned] [Bug 148934] Implement control flow statements in WebAssembly

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 8 07:27:02 PDT 2015


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

--- Comment #3 from Sukolsak Sakshuwong <sukolsak at gmail.com> ---
When we implement an LLVM IR generator for WebAssembly, JumpTarget will be just an LLVM Basic Block. The code will look like this:

typedef LBasicBlock JumpTarget;

LBasicBlock newTarget()
{
    return m_out.newBlock();
}

void linkTarget(LBasicBlock target)
{
    m_out.jump(target);
    m_out.appendTo(target);
}

void jumpToTarget(LBasicBlock target)
{
    m_out.jump(target);
}

void jumpToTargetIf(JumpCondition condition, LValue expression, LBasicBlock target)
{
    LBasicBlock notTaken = m_out.newBlock();
    m_out.branch((condition == JumpCondition::Zero) ? m_out.isZero32(expression) : m_out.notZero32(expression), FTL::unsure(target), FTL::unsure(notTaken));
    m_out.appendTo(notTaken);
}

-- 
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/20150908/ea5919ca/attachment.html>


More information about the webkit-unassigned mailing list