<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 <<a href="mailto:cvienneau@ea.com" class="">cvienneau@ea.com</a>> 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=""> </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. <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=""> </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. This means that we’ve been using the<span class="Apple-converted-space"> </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=""> </span>path in these cases. 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. As a side note I see that<span class="Apple-converted-space"> </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=""> </span>has been replaced with<span class="Apple-converted-space"> </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=""> </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. 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=""> <span class="Apple-converted-space"> </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. 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> 1. LLIntOffsetsExtractor.cpp (which contains a lot of offsets that the LLINT needs) is built for the target platform.</div><div> 2. The offlineasm will parse the binary generated from step 1 for the offset values.</div><div> 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> See Source/JavaScriptCore/offlineasm/backends.rb for a list of current backends.</div><div> 4. The generated target specific “assembly" file (typically named LLIntAssembly.h) is assembled with the target build tools.</div><div> For most platforms, LLIntAssembly.h contains inline assembly that is #include’d into llint/LowLevelInterpreter.cpp and built.</div><div> On Windows, an actual ASM file is generated (not inline assembly) and is built using MASM.</div><div> 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=""> <span class="Apple-converted-space"> </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? 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. If you want the JIT, you must support the ASM LLINT. 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. 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=""> <span class="Apple-converted-space"> </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=""> <span class="Apple-converted-space"> </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. 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=""> <span class="Apple-converted-space"> </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. The ASM LLINT is your best bet. Alternatively, you can try optimizing the C Loop LLINT if you don’t want to tackle the ASM LLINT. 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=""> </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=""> </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>