<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Chris,<div class="">I’ll try to answer your questions below …</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 5, 2014, at 3:23 PM, Vienneau, Christopher &lt;<a href="mailto:cvienneau@ea.com" class="">cvienneau@ea.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Hello,<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class="">&nbsp;</o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I’m looking for some information about the Java script interpreter ASM backend, aka OfflineAsm. &nbsp;<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class="">&nbsp;</o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">First a bit of background information; the code I have been using is about a year old, on several platforms we don’t run with JIT and won’t be able to enable it.&nbsp; This means that we’ve been using the<span class="Apple-converted-space">&nbsp;</span><span style="font-size: 9pt; font-family: Consolas; color: rgb(30, 30, 30); background-color: white; background-position: initial initial; background-repeat: initial initial;" class="">LLINT_C_LOOP</span><span style="font-size: 9pt; font-family: Consolas; color: rgb(30, 30, 30);" class="">&nbsp;</span>path in these cases.&nbsp; It was considered that the ASM backend may be able to improve performance in this case, currently I’m taking a look at how things are done in a more recent snapshot of the trunk to be sure this development effort will be going in the right direction on what is done there.&nbsp; As a side note I see that<span class="Apple-converted-space">&nbsp;</span><span style="font-size: 9pt; font-family: Consolas; color: rgb(30, 30, 30); background-color: white; background-position: initial initial; background-repeat: initial initial;" class="">LLINT_C_LOOP</span><span style="font-size: 9pt; font-family: Consolas; color: rgb(30, 30, 30);" class="">&nbsp;</span>has been replaced with<span class="Apple-converted-space">&nbsp;</span><span style="font-size: 9pt; font-family: Consolas; color: rgb(30, 30, 30); background-color: white; background-position: initial initial; background-repeat: initial initial;" class="">#if !ENABLE(JIT)</span><span style="font-size: 9pt; font-family: Consolas; color: rgb(30, 30, 30);" class="">&nbsp;</span>which I guess is pretty much how it has always behaved.</div></div></div></blockquote><div><br class=""></div><div>Yes, LLINT_C_LOOP is synonymous with !ENABLE_JIT. &nbsp;The C loop is only meant as stand-in for ports that don’t want to spend the effort to get the JIT running.</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">So my questions are:<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt 0.5in; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -0.25in;" class=""><span class="">1)<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman';" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Apple-converted-space">&nbsp;</span></span></span>How is the ASM backend intended to be used? Is there a doc that covers this?</div></div></div></blockquote><div><br class=""></div><div>The code is the only documentation on this. &nbsp;Some context that may help guide you in understanding how it works:</div><div><br class=""></div><div>1. The “ASM" code for the interpreter is in Source/JavaScriptCore/llint/LowLevelInterpreter*.asm.</div><div>2. This ASM code is assembled using the offlineasm assembler which is a ruby program.</div><div>3. The code for the offlineasm assembler is in Source/JavaScriptCore/offlineasm.</div><div>4. At build time:</div><div>&nbsp; &nbsp; 1. LLIntOffsetsExtractor.cpp (which contains a lot of offsets that the LLINT needs) is built for the target platform.</div><div>&nbsp; &nbsp; 2. The offlineasm will parse the binary generated from step 1 for the offset values.</div><div>&nbsp; &nbsp; 3. The offlineasm will parse the LLINT ASM files plus the previously computed offsets, and emit target specific assembly code using an appropriate backend.</div><div>&nbsp; &nbsp; &nbsp; &nbsp; See Source/JavaScriptCore/offlineasm/backends.rb for a list of current backends.</div><div>&nbsp; &nbsp; 4. The generated target specific “assembly" file (typically named LLIntAssembly.h) is assembled with the target build tools.</div><div>&nbsp; &nbsp; &nbsp; &nbsp; For most platforms, LLIntAssembly.h contains inline assembly that is #include’d into llint/LowLevelInterpreter.cpp and built.</div><div>&nbsp; &nbsp; &nbsp; &nbsp; On Windows, an actual ASM file is generated (not inline assembly) and is built using MASM.</div><div>&nbsp; &nbsp; 5. The built assembler is linked with the JSC VM.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0in 0in 0.0001pt 0.5in; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -0.25in;" class=""><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt 0.5in; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -0.25in;" class=""><span class="">2)<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman';" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Apple-converted-space">&nbsp;</span></span></span>Can I essentially move from the “C LOOP” to neither “C LOOP” nor “JIT”? or is the ASM backend dependent on JIT itself? &nbsp;It appears this would be handled by the defines in Source\JavaScriptCore\llint\LLIntOfflineAsmConfig.h</div></div></div></blockquote><div><br class=""></div><div>LLINT_C_LOOP and ENABLE_JIT are mutually exclusive. &nbsp;If you want the JIT, you must support the ASM LLINT. &nbsp;Once you have the ASM LLINT, you will essentially have JIT support (unless you’re working with some exotic CPU that is not currently supported).</div><div><br class=""></div><div>That said, you can build the ASM LLINT and not run with the JIT. &nbsp;You can set Options::useJIT() = false to only run with the LLINT.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0in 0in 0.0001pt 0.5in; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -0.25in;" class=""><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt 0.5in; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -0.25in;" class=""><span class="">3)<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman';" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Apple-converted-space">&nbsp;</span></span></span>If JIT is expected to use the ASM backend is there a way this can be worked around?</div></div></div></blockquote><div><br class=""></div><div>Already answered above.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0in 0in 0.0001pt 0.5in; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -0.25in;" class=""><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt 0.5in; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -0.25in;" class=""><span class="">4)<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman';" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Apple-converted-space">&nbsp;</span></span></span>Should I actually expect a performance increase compared to the “C LOOP”?</div></div></div></blockquote><div><br class=""></div><div>Yes. &nbsp;The ASM LLINT should be faster than the C LOOP LLINT.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0in 0in 0.0001pt 0.5in; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -0.25in;" class=""><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt 0.5in; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -0.25in;" class=""><span class="">5)<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman';" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="Apple-converted-space">&nbsp;</span></span></span>Are there any other suggestions on how to improve performance of Java script code in a non-JIT port?</div></div></div></blockquote><div><br class=""></div><div>I presume options that are current supported. &nbsp;The ASM LLINT is your best bet. &nbsp;Alternatively, you can try optimizing the C Loop LLINT if you don’t want to tackle the ASM LLINT. &nbsp;The C Loop LLINT is intended to be simple and not intended to be super optimized, but any improvements that does not come at the cost of too much added complexity is welcomed.</div><div><br class=""></div><div>Regards,</div><div>Mark</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0in 0in 0.0001pt 0.5in; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: -0.25in;" class=""><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class="">&nbsp;</o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Thanks for any feedback<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class="">&nbsp;</o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Chris Vienneau<o:p class=""></o:p></div></div><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">webkit-dev mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:webkit-dev@lists.webkit.org" style="color: rgb(149, 79, 114); text-decoration: underline; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">webkit-dev@lists.webkit.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="https://lists.webkit.org/mailman/listinfo/webkit-dev" style="color: rgb(149, 79, 114); text-decoration: underline; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">https://lists.webkit.org/mailman/listinfo/webkit-dev</a></div></blockquote></div><br class=""></div></body></html>