<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi,</div><div><br></div><div>Some time ago a friend of mine made a conversion script from AGI (an early virtual machine) to Javascript, including rudimentary goto support. He says it's not the best code in the world but you can take a look around: <span class="Apple-style-span" style="font-family: Arial; line-height: 15px; "><a href="http://web.ist.utl.pt/~antonio.afonso/agi/logic.phps" title="http://web.ist.utl.pt/~antonio.afonso/agi/logic.phps" style="word-wrap: break-word; color: rgb(0, 51, 204); ">http://web.ist.utl.pt/~antonio.afonso/agi/logic.phps</a>. There's an AGI emulator that plays Leisure Suite Larry a directory above ;-)</span></div><div><br></div><div><font class="Apple-style-span" face="Arial"><span class="Apple-style-span" style="line-height: 15px;">You could also convert the LLVM's IR (SSA) to CPS and then you could just directly emit the javascript code :-P</span></font></div><div><br></div><div>Regards,</div><div><br></div><div>  F</div><br><div><div>On 4 Jan, 2009, at 17:29, Charles Ying wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hello llvm-dev,</div><div><br></div><div>I've been hacking on a JavaScript backend to LLVM, starting with the CBackend as base. </div><div><br></div><div>Sadly, JavaScript does not support a "goto" style of jump instruction, making it "tricky" to code generate a jump instruction.</div> <div><br></div><div>What might you recommend for avoiding jump instructions? Is there a transformation for something like this or any other ideas? The only solution I see at the moment is to write a small VM execution loop in JavaScript, but I was hoping that there might be other solutions.</div> <div><br></div><div>Thanks!</div><div>Charles</div><div><br></div> _______________________________________________<br>LLVM Developers mailing list<br>LLVMdev@cs.uiuc.edu         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote></div><br></body></html>