<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Implement control flow statements in WebAssembly"
   href="https://bugs.webkit.org/show_bug.cgi?id=148934#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Implement control flow statements in WebAssembly"
   href="https://bugs.webkit.org/show_bug.cgi?id=148934">bug 148934</a>
              from <span class="vcard"><a class="email" href="mailto:sukolsak&#64;gmail.com" title="Sukolsak Sakshuwong &lt;sukolsak&#64;gmail.com&gt;"> <span class="fn">Sukolsak Sakshuwong</span></a>
</span></b>
        <pre>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);
}</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>