mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 04:50:09 +00:00
2 lines
31 KiB
Plaintext
2 lines
31 KiB
Plaintext
<div class="pd w0 h0"><div id="pf1" class="pf" data-page-no="1"><div class="pc pc1"><div class="t m0 x0 h1 y0 ff1 fs0 fc0 sc0 ls0 ws0">T<span class="_ _0"></span>race-based<span class="_ _1"> </span>J<span class="_ _2"></span>ust-in-T<span class="_ _2"></span>ime<span class="_ _1"> </span>T<span class="_ _0"></span>ype<span class="_ _1"> </span>Specialization<span class="_ _1"> </span>f<span class="_ _2"></span>or<span class="_ _1"> </span>Dynamic</div><div class="t m0 x1 h1 y1 ff1 fs0 fc0 sc0 ls0 ws0">Languages</div><div class="t m0 x2 h2 y2 ff2 fs1 fc0 sc0 ls0 ws0">Andreas<span class="_ _3"> </span>Gal</div><div class="t m0 x3 h3 y3 ff3 fs2 fc0 sc0 ls0 ws0">∗<span class="_ _4"> </span><span class="ff4">+</span></div><div class="t m0 x4 h2 y2 ff2 fs1 fc0 sc0 ls0 ws0">,<span class="_ _3"> </span>Brendan<span class="_ _3"> </span>Eich</div><div class="t m0 x5 h4 y3 ff3 fs2 fc0 sc0 ls0 ws0">∗</div><div class="t m0 x6 h2 y2 ff2 fs1 fc0 sc0 ls0 ws0">,<span class="_ _3"> </span>Mike<span class="_ _3"> </span>Sha<span class="_ _2"></span>ver</div><div class="t m0 x7 h4 y3 ff3 fs2 fc0 sc0 ls0 ws0">∗</div><div class="t m0 x8 h2 y2 ff2 fs1 fc0 sc0 ls0 ws0">,<span class="_ _3"> </span>David<span class="_ _3"> </span>Anderson</div><div class="t m0 x9 h4 y3 ff3 fs2 fc0 sc0 ls0 ws0">∗</div><div class="t m0 xa h2 y2 ff2 fs1 fc0 sc0 ls0 ws0">,<span class="_ _3"> </span>David<span class="_ _3"> </span>Mandelin</div><div class="t m0 xb h4 y3 ff3 fs2 fc0 sc0 ls0 ws0">∗</div><div class="t m0 xc h2 y2 ff2 fs1 fc0 sc0 ls0 ws0">,</div><div class="t m0 xd h2 y4 ff2 fs1 fc0 sc0 ls0 ws0">Mohammad<span class="_ _3"> </span>R.<span class="_ _3"> </span>Haghighat</div><div class="t m0 xe h3 y5 ff4 fs2 fc0 sc0 ls0 ws0">$</div><div class="t m0 xf h2 y4 ff2 fs1 fc0 sc0 ls0 ws0">,<span class="_ _3"> </span>Blake<span class="_ _3"> </span>Kaplan</div><div class="t m0 x10 h4 y5 ff3 fs2 fc0 sc0 ls0 ws0">∗</div><div class="t m0 x11 h2 y4 ff2 fs1 fc0 sc0 ls0 ws0">,<span class="_ _3"> </span>Graydon<span class="_ _3"> </span>Hoare</div><div class="t m0 x12 h4 y5 ff3 fs2 fc0 sc0 ls0 ws0">∗</div><div class="t m0 x13 h2 y4 ff2 fs1 fc0 sc0 ls0 ws0">,<span class="_ _3"> </span>Boris<span class="_ _3"> </span>Zbarsky</div><div class="t m0 x14 h4 y5 ff3 fs2 fc0 sc0 ls0 ws0">∗</div><div class="t m0 x15 h2 y4 ff2 fs1 fc0 sc0 ls0 ws0">,<span class="_ _3"> </span>Jason<span class="_ _3"> </span>Orendorf<span class="_ _2"></span>f</div><div class="t m0 x16 h4 y5 ff3 fs2 fc0 sc0 ls0 ws0">∗</div><div class="t m0 x17 h2 y4 ff2 fs1 fc0 sc0 ls0 ws0">,</div><div class="t m0 x18 h2 y6 ff2 fs1 fc0 sc0 ls0 ws0">Jesse<span class="_ _3"> </span>Ruderman</div><div class="t m0 x19 h4 y7 ff3 fs2 fc0 sc0 ls0 ws0">∗</div><div class="t m0 x1a h2 y6 ff2 fs1 fc0 sc0 ls0 ws0">,<span class="_ _3"> </span>Edwin<span class="_ _3"> </span>Smith</div><div class="t m0 xe h3 y7 ff4 fs2 fc0 sc0 ls0 ws0">#</div><div class="t m0 x1b h2 y6 ff2 fs1 fc0 sc0 ls0 ws0">,<span class="_ _3"> </span>Rick<span class="_ _3"> </span>Reitmaier</div><div class="t m0 x1c h3 y7 ff4 fs2 fc0 sc0 ls0 ws0">#</div><div class="t m0 x1d h2 y6 ff2 fs1 fc0 sc0 ls0 ws0">,<span class="_ _3"> </span>Michael<span class="_ _3"> </span>Bebenita</div><div class="t m0 x1e h3 y7 ff4 fs2 fc0 sc0 ls0 ws0">+</div><div class="t m0 x1f h2 y6 ff2 fs1 fc0 sc0 ls0 ws0">,<span class="_ _3"> </span>Mason<span class="_ _3"> </span>Chang</div><div class="t m0 x20 h3 y7 ff4 fs2 fc0 sc0 ls0 ws0">+<span class="_ _4"></span>#</div><div class="t m0 x21 h2 y6 ff2 fs1 fc0 sc0 ls0 ws0">,<span class="_ _3"> </span>Michael<span class="_ _3"> </span>Franz</div><div class="t m0 x22 h3 y7 ff4 fs2 fc0 sc0 ls0 ws0">+</div><div class="t m0 x23 h5 y8 ff2 fs3 fc0 sc0 ls0 ws0">Mozilla<span class="_ _3"> </span>Corporation</div><div class="t m0 x24 h6 y9 ff5 fs4 fc0 sc0 ls0 ws0">∗</div><div class="t m0 x25 h7 ya ff6 fs3 fc0 sc0 ls0 ws0">{<span class="ff7">gal,brendan,shaver,danderson,dmandelin,mrbkap,graydon,bz,jorendorff,jruderman</span>}<span class="ff7">@mozilla.com</span></div><div class="t m0 x26 h5 yb ff2 fs3 fc0 sc0 ls0 ws0">Adobe<span class="_ _3"> </span>Corporation</div><div class="t m0 x27 h8 yc ff8 fs4 fc0 sc0 ls0 ws0">#</div><div class="t m0 x28 h7 yd ff6 fs3 fc0 sc0 ls0 ws0">{<span class="ff7">edwsmith,rreitmai</span>}<span class="ff7">@adobe.com</span></div><div class="t m0 x29 h5 ye ff2 fs3 fc0 sc0 ls0 ws0">Intel<span class="_ _3"> </span>Corporation</div><div class="t m0 x2a h8 yf ff8 fs4 fc0 sc0 ls0 ws0">$</div><div class="t m0 x2b h7 y10 ff6 fs3 fc0 sc0 ls0 ws0">{<span class="ff7">mohammad.r.haghighat</span>}<span class="ff7">@intel.com</span></div><div class="t m0 x2c h5 y11 ff2 fs3 fc0 sc0 ls0 ws0">Univ<span class="_ _2"></span>ersity<span class="_ _5"> </span>of<span class="_ _5"> </span>California,<span class="_ _5"> </span>Irvine</div><div class="t m0 x2d h8 y12 ff8 fs4 fc0 sc0 ls0 ws0">+</div><div class="t m0 x2e h7 y13 ff6 fs3 fc0 sc0 ls0 ws0">{<span class="ff7">mbebenit,changm,franz</span>}<span class="ff7">@uci.edu</span></div><div class="t m0 x2f h9 y14 ff1 fs1 fc0 sc0 ls0 ws0">Abstract</div><div class="t m0 x2f h5 y15 ff2 fs3 fc0 sc0 ls0 ws0">Dynamic<span class="_ _3"> </span>languages<span class="_ _6"> </span>such<span class="_ _3"> </span>as<span class="_ _6"> </span>Jav<span class="_ _2"></span>aScript<span class="_ _3"> </span>are<span class="_ _6"> </span>more<span class="_ _3"> </span>difficult<span class="_ _3"> </span>to<span class="_ _6"> </span>com-</div><div class="t m0 x2f h5 y16 ff2 fs3 fc0 sc0 ls0 ws0">pile<span class="_ _3"> </span>than<span class="_ _5"> </span>statically<span class="_ _3"> </span>typed<span class="_ _5"> </span>ones.<span class="_ _3"> </span>Since<span class="_ _5"> </span>no<span class="_ _3"> </span>concrete<span class="_ _5"> </span>type<span class="_ _3"> </span>information</div><div class="t m0 x2f h5 y17 ff2 fs3 fc0 sc0 ls0 ws0">is<span class="_ _5"> </span>a<span class="_ _2"></span>v<span class="_ _2"></span>ailable,<span class="_ _7"> </span>traditional<span class="_ _5"> </span>compilers<span class="_ _7"> </span>need<span class="_ _7"> </span>to<span class="_ _5"> </span>emit<span class="_ _7"> </span>generic<span class="_ _5"> </span>code<span class="_ _7"> </span>that<span class="_ _7"> </span>can</div><div class="t m0 x2f h5 y18 ff2 fs3 fc0 sc0 ls0 ws0">handle<span class="_ _5"> </span>all<span class="_ _5"> </span>possible<span class="_ _5"> </span>type<span class="_ _5"> </span>combinations<span class="_ _5"> </span>at<span class="_ _5"> </span>runtime.<span class="_ _7"> </span>W<span class="_ _2"></span>e<span class="_ _5"> </span>present<span class="_ _5"> </span>an<span class="_ _5"> </span>al-</div><div class="t m0 x2f h5 y19 ff2 fs3 fc0 sc0 ls0 ws0">ternativ<span class="_ _2"></span>e<span class="_ _6"> </span>compilation<span class="_ _8"> </span>technique<span class="_ _6"> </span>for<span class="_ _8"> </span>dynamically-typed<span class="_ _8"> </span>languages</div><div class="t m0 x2f h5 y1a ff2 fs3 fc0 sc0 ls0 ws0">that<span class="_ _3"> </span>identifies<span class="_ _5"> </span>frequently<span class="_ _5"> </span>executed<span class="_ _5"> </span>loop<span class="_ _3"> </span>traces<span class="_ _5"> </span>at<span class="_ _3"> </span>run-time<span class="_ _5"> </span>and<span class="_ _3"> </span>then</div><div class="t m0 x2f h5 y1b ff2 fs3 fc0 sc0 ls0 ws0">generates<span class="_ _6"> </span>machine<span class="_ _8"> </span>code<span class="_ _8"> </span>on<span class="_ _6"> </span>the<span class="_ _8"> </span>fly<span class="_ _6"> </span>that<span class="_ _8"> </span>is<span class="_ _8"> </span>specialized<span class="_ _6"> </span>for<span class="_ _8"> </span>the<span class="_ _6"> </span>ac-</div><div class="t m0 x2f h5 y1c ff2 fs3 fc0 sc0 ls0 ws0">tual<span class="_ _3"> </span>dynamic<span class="_ _6"> </span>types<span class="_ _6"> </span>occurring<span class="_ _3"> </span>on<span class="_ _6"> </span>each<span class="_ _3"> </span>path<span class="_ _6"> </span>through<span class="_ _3"> </span>the<span class="_ _6"> </span>loop.<span class="_ _3"> </span>Our</div><div class="t m0 x2f h5 y1d ff2 fs3 fc0 sc0 ls0 ws0">method<span class="_ _5"> </span>provides<span class="_ _5"> </span>cheap<span class="_ _5"> </span>inter<span class="_ _2"></span>-procedural<span class="_ _5"> </span>type<span class="_ _5"> </span>s<span class="_ _2"></span>pecialization,<span class="_ _5"> </span>and<span class="_ _5"> </span>an</div><div class="t m0 x2f h5 y1e ff2 fs3 fc0 sc0 ls0 ws0">elegant<span class="_ _5"> </span>and<span class="_ _5"> </span>ef<span class="_ _2"></span>ficient<span class="_ _5"> </span>w<span class="_ _2"></span>ay<span class="_ _5"> </span>of<span class="_ _5"> </span>incrementally<span class="_ _5"> </span>compiling<span class="_ _5"> </span>lazily<span class="_ _5"> </span>discov-</div><div class="t m0 x2f h5 y1f ff2 fs3 fc0 sc0 ls0 ws0">ered<span class="_ _3"> </span>alternati<span class="_ _2"></span>v<span class="_ _2"></span>e<span class="_ _5"> </span>paths<span class="_ _3"> </span>through<span class="_ _5"> </span>nested<span class="_ _3"> </span>loops.<span class="_ _5"> </span>W<span class="_ _2"></span>e<span class="_ _5"> </span>have<span class="_ _5"> </span>implemented</div><div class="t m0 x2f h5 y20 ff2 fs3 fc0 sc0 ls0 ws0">a<span class="_ _3"> </span>dynamic<span class="_ _5"> </span>compiler<span class="_ _3"> </span>for<span class="_ _3"> </span>Ja<span class="_ _2"></span>v<span class="_ _2"></span>aScript<span class="_ _3"> </span>based<span class="_ _5"> </span>on<span class="_ _3"> </span>our<span class="_ _3"> </span>technique<span class="_ _5"> </span>and<span class="_ _3"> </span>we</div><div class="t m0 x2f h5 y21 ff2 fs3 fc0 sc0 ls0 ws0">hav<span class="_ _2"></span>e<span class="_ _6"> </span>measured<span class="_ _6"> </span>speedups<span class="_ _6"> </span>of<span class="_ _6"> </span>10x<span class="_ _3"> </span>and<span class="_ _6"> </span>more<span class="_ _6"> </span>for<span class="_ _6"> </span>certain<span class="_ _6"> </span>benchmark</div><div class="t m0 x2f h5 y22 ff2 fs3 fc0 sc0 ls0 ws0">programs.</div><div class="t m0 x2f h5 y23 ff9 fs3 fc0 sc0 ls0 ws0">Categories<span class="_ _8"> </span>and<span class="_ _8"> </span>Subject<span class="_ _8"> </span>Descriptors<span class="_ _9"> </span><span class="ff2">D.3.4<span class="_ _8"> </span>[<span class="ffa">Pr<span class="_ _2"></span>ogr<span class="_ _2"></span>amming<span class="_ _8"> </span>Lan-</span></span></div><div class="t m0 x2f h5 y24 ffa fs3 fc0 sc0 ls0 ws0">guages<span class="ff2">]:<span class="_ _5"> </span>Processors<span class="_ _5"> </span>—<span class="_ _5"> </span></span>Incremental<span class="_ _5"> </span>compilers,<span class="_ _5"> </span>code<span class="_ _5"> </span>gener<span class="_ _2"></span>ation<span class="ff2">.</span></div><div class="t m0 x2f h5 y25 ff9 fs3 fc0 sc0 ls0 ws0">General<span class="_ _3"> </span>T<span class="_ _2"></span>erms<span class="_ _9"> </span><span class="ff2">Design,<span class="_ _3"> </span>Experimentation,<span class="_ _3"> </span>Measurement,<span class="_ _3"> </span>Perfor-</span></div><div class="t m0 x2f h5 y26 ff2 fs3 fc0 sc0 ls0 ws0">mance.</div><div class="t m0 x2f h5 y27 ff9 fs3 fc0 sc0 ls0 ws0">Keyw<span class="_ _2"></span>ords<span class="_ _9"> </span><span class="ff2">Ja<span class="_ _2"></span>v<span class="_ _2"></span>aScript,<span class="_ _5"> </span>just-in-time<span class="_ _5"> </span>compilation,<span class="_ _5"> </span>trace<span class="_ _3"> </span>trees.</span></div><div class="t m0 x2f h9 y28 ff1 fs1 fc0 sc0 ls0 ws0">1.<span class="_ _a"> </span>Introduction</div><div class="t m0 x2f h5 y29 ffa fs3 fc0 sc0 ls0 ws0">Dynamic<span class="_ _5"> </span>langua<span class="_ _2"></span>ges<span class="_ _5"> </span><span class="ff2">such<span class="_ _7"> </span>as<span class="_ _5"> </span>Jav<span class="_ _2"></span>aScript,<span class="_ _5"> </span>Python,<span class="_ _5"> </span>and<span class="_ _7"> </span>Ruby<span class="_ _2"></span>,<span class="_ _5"> </span>are<span class="_ _7"> </span>pop-</span></div><div class="t m0 x2f h5 y2a ff2 fs3 fc0 sc0 ls0 ws0">ular<span class="_ _5"> </span>since<span class="_ _3"> </span>the<span class="_ _2"></span>y<span class="_ _5"> </span>are<span class="_ _5"> </span>expressiv<span class="_ _2"></span>e,<span class="_ _5"> </span>accessible<span class="_ _3"> </span>to<span class="_ _5"> </span>non-e<span class="_ _2"></span>xperts,<span class="_ _5"> </span>and<span class="_ _3"> </span>mak<span class="_ _2"></span>e</div><div class="t m0 x2f h5 y2b ff2 fs3 fc0 sc0 ls0 ws0">deployment<span class="_ _3"> </span>as<span class="_ _5"> </span>easy<span class="_ _3"> </span>as<span class="_ _5"> </span>distributing<span class="_ _3"> </span>a<span class="_ _5"> </span>source<span class="_ _3"> </span>file.<span class="_ _5"> </span>They<span class="_ _3"> </span>are<span class="_ _5"> </span>used<span class="_ _3"> </span>for</div><div class="t m0 x2f h5 y2c ff2 fs3 fc0 sc0 ls0 ws0">small<span class="_ _6"> </span>scripts<span class="_ _6"> </span>as<span class="_ _8"> </span>well<span class="_ _6"> </span>as<span class="_ _6"> </span>for<span class="_ _8"> </span>complex<span class="_ _6"> </span>applications.<span class="_ _6"> </span>Jav<span class="_ _2"></span>aScript,<span class="_ _6"> </span>for</div><div class="t m0 x2f h5 y2d ff2 fs3 fc0 sc0 ls0 ws0">example,<span class="_ _5"> </span>is<span class="_ _3"> </span>the<span class="_ _5"> </span>de<span class="_ _5"> </span>facto<span class="_ _3"> </span>standard<span class="_ _5"> </span>for<span class="_ _5"> </span>client-side<span class="_ _3"> </span>web<span class="_ _5"> </span>programming</div><div class="t m0 x2f ha y2e ff2 fs5 fc0 sc0 ls0 ws0">Permission<span class="_ _5"> </span>to<span class="_ _3"> </span>mak<span class="_ _2"></span>e<span class="_ _5"> </span>digital<span class="_ _5"> </span>or<span class="_ _3"> </span>hard<span class="_ _5"> </span>copies<span class="_ _5"> </span>of<span class="_ _5"> </span>all<span class="_ _3"> </span>or<span class="_ _5"> </span>part<span class="_ _5"> </span>of<span class="_ _5"> </span>this<span class="_ _5"> </span>work<span class="_ _3"> </span>for<span class="_ _5"> </span>personal<span class="_ _5"> </span>or</div><div class="t m0 x2f ha y2f ff2 fs5 fc0 sc0 ls0 ws0">classroom<span class="_ _5"> </span>use<span class="_ _7"> </span>is<span class="_ _5"> </span>granted<span class="_ _5"> </span>without<span class="_ _7"> </span>fee<span class="_ _5"> </span>provided<span class="_ _5"> </span>that<span class="_ _7"> </span>copies<span class="_ _5"> </span>are<span class="_ _5"> </span>not<span class="_ _7"> </span>made<span class="_ _5"> </span>or<span class="_ _5"> </span>distrib<span class="_ _2"></span>uted</div><div class="t m0 x2f ha y30 ff2 fs5 fc0 sc0 ls0 ws0">for<span class="_ _7"> </span>profit<span class="_ _7"> </span>or<span class="_ _5"> </span>commercial<span class="_ _7"> </span>adv<span class="_ _2"></span>antage<span class="_ _7"> </span>and<span class="_ _7"> </span>that<span class="_ _7"> </span>copies<span class="_ _7"> </span>bear<span class="_ _5"> </span>this<span class="_ _7"> </span>notice<span class="_ _7"> </span>and<span class="_ _7"> </span>the<span class="_ _7"> </span>full<span class="_ _7"> </span>citation</div><div class="t m0 x2f ha y31 ff2 fs5 fc0 sc0 ls0 ws0">on<span class="_ _5"> </span>the<span class="_ _7"> </span>first<span class="_ _5"> </span>page.<span class="_ _5"> </span>T<span class="_ _b"></span>o<span class="_ _5"> </span>cop<span class="_ _2"></span>y<span class="_ _5"> </span>otherwise,<span class="_ _7"> </span>to<span class="_ _5"> </span>republish,<span class="_ _5"> </span>to<span class="_ _7"> </span>post<span class="_ _5"> </span>on<span class="_ _7"> </span>servers<span class="_ _5"> </span>or<span class="_ _5"> </span>to<span class="_ _7"> </span>redistribute</div><div class="t m0 x2f ha y32 ff2 fs5 fc0 sc0 ls0 ws0">to<span class="_ _7"> </span>lists,<span class="_ _5"> </span>requires<span class="_ _7"> </span>prior<span class="_ _5"> </span>specific<span class="_ _7"> </span>permission<span class="_ _7"> </span>and/or<span class="_ _5"> </span>a<span class="_ _7"> </span>fee.</div><div class="t m0 x2f ha y33 ffb fs5 fc0 sc0 ls0 ws0">PLDI’09,<span class="_ _c"> </span><span class="ff2">June<span class="_ _7"> </span>15–20,<span class="_ _5"> </span>2009,<span class="_ _7"> </span>Dublin,<span class="_ _5"> </span>Ireland.</span></div><div class="t m0 x2f ha y34 ff2 fs5 fc0 sc0 ls0 ws0">Copyright</div><div class="t m0 x30 ha y35 ff2 fs5 fc0 sc0 ls0 ws0">c</div><div class="t m0 x31 ha y34 ffc fs5 fc0 sc0 ls0 ws0"><span class="_ _7"> </span><span class="ff2">2009<span class="_ _5"> </span>A<span class="_ _2"></span>CM<span class="_ _7"> </span>978-1-60558-392-1/09/06.<span class="_ _7"> </span>.<span class="_ _4"></span>.<span class="_ _7"> </span>$5.00</span></div><div class="t m0 x32 h5 y36 ff2 fs3 fc0 sc0 ls0 ws0">and<span class="_ _3"> </span>is<span class="_ _5"> </span>used<span class="_ _5"> </span>for<span class="_ _3"> </span>the<span class="_ _5"> </span>application<span class="_ _3"> </span>logic<span class="_ _5"> </span>of<span class="_ _5"> </span>browser-based<span class="_ _5"> </span>productivity</div><div class="t m0 x32 h5 y37 ff2 fs3 fc0 sc0 ls0 ws0">applications<span class="_ _3"> </span>such<span class="_ _6"> </span>as<span class="_ _3"> </span>Google<span class="_ _6"> </span>Mail,<span class="_ _3"> </span>Google<span class="_ _3"> </span>Docs<span class="_ _6"> </span>and<span class="_ _3"> </span>Zimbra<span class="_ _3"> </span>Col-</div><div class="t m0 x32 h5 y38 ff2 fs3 fc0 sc0 ls0 ws0">laboration<span class="_ _6"> </span>Suite.<span class="_ _8"> </span>In<span class="_ _8"> </span>this<span class="_ _6"> </span>domain,<span class="_ _8"> </span>in<span class="_ _8"> </span>order<span class="_ _6"> </span>to<span class="_ _8"> </span>provide<span class="_ _6"> </span>a<span class="_ _8"> </span>fluid<span class="_ _6"> </span>user</div><div class="t m0 x32 h5 y39 ff2 fs3 fc0 sc0 ls0 ws0">experience<span class="_ _5"> </span>and<span class="_ _7"> </span>enable<span class="_ _5"> </span>a<span class="_ _7"> </span>new<span class="_ _5"> </span>generation<span class="_ _7"> </span>of<span class="_ _5"> </span>applications,<span class="_ _7"> </span>virtual<span class="_ _5"> </span>ma-</div><div class="t m0 x32 h5 y3a ff2 fs3 fc0 sc0 ls0 ws0">chines<span class="_ _5"> </span>must<span class="_ _5"> </span>provide<span class="_ _5"> </span>a<span class="_ _5"> </span>low<span class="_ _5"> </span>startup<span class="_ _5"> </span>time<span class="_ _3"> </span>and<span class="_ _5"> </span>high<span class="_ _5"> </span>performance.</div><div class="t m0 x33 h5 y3b ff2 fs3 fc0 sc0 ls0 ws0">Compilers<span class="_ _3"> </span>for<span class="_ _3"> </span>statically<span class="_ _3"> </span>typed<span class="_ _3"> </span>languages<span class="_ _3"> </span>rely<span class="_ _5"> </span>on<span class="_ _3"> </span>type<span class="_ _3"> </span>informa-</div><div class="t m0 x32 h5 y3c ff2 fs3 fc0 sc0 ls0 ws0">tion<span class="_ _5"> </span>to<span class="_ _7"> </span>generate<span class="_ _5"> </span>ef<span class="_ _2"></span>ficient<span class="_ _7"> </span>machine<span class="_ _5"> </span>code.<span class="_ _7"> </span>In<span class="_ _5"> </span>a<span class="_ _7"> </span>dynamically<span class="_ _5"> </span>typed<span class="_ _7"> </span>pro-</div><div class="t m0 x32 h5 y3d ff2 fs3 fc0 sc0 ls0 ws0">gramming<span class="_ _8"> </span>language<span class="_ _8"> </span>such<span class="_ _8"> </span>as<span class="_ _8"> </span>Jav<span class="_ _2"></span>aScript,<span class="_ _6"> </span>the<span class="_ _8"> </span>types<span class="_ _8"> </span>of<span class="_ _8"> </span>expressions</div><div class="t m0 x32 h5 y3e ff2 fs3 fc0 sc0 ls0 ws0">may<span class="_ _3"> </span>vary<span class="_ _3"> </span>at<span class="_ _6"> </span>runtime.<span class="_ _3"> </span>This<span class="_ _3"> </span>means<span class="_ _6"> </span>that<span class="_ _3"> </span>the<span class="_ _3"> </span>compiler<span class="_ _6"> </span>can<span class="_ _3"> </span>no<span class="_ _3"> </span>longer</div><div class="t m0 x32 h5 y3f ff2 fs3 fc0 sc0 ls0 ws0">easily<span class="_ _3"> </span>transform<span class="_ _3"> </span>operations<span class="_ _6"> </span>into<span class="_ _3"> </span>machine<span class="_ _3"> </span>instructions<span class="_ _3"> </span>that<span class="_ _6"> </span>operate</div><div class="t m0 x32 h5 y40 ff2 fs3 fc0 sc0 ls0 ws0">on<span class="_ _5"> </span>one<span class="_ _3"> </span>specific<span class="_ _5"> </span>type.<span class="_ _3"> </span>W<span class="_ _2"></span>ithout<span class="_ _5"> </span>exact<span class="_ _5"> </span>type<span class="_ _5"> </span>information,<span class="_ _3"> </span>the<span class="_ _5"> </span>compiler</div><div class="t m0 x32 h5 y41 ff2 fs3 fc0 sc0 ls0 ws0">must<span class="_ _3"> </span>emit<span class="_ _3"> </span>slower<span class="_ _3"> </span>generalized<span class="_ _3"> </span>machine<span class="_ _3"> </span>code<span class="_ _3"> </span>that<span class="_ _3"> </span>can<span class="_ _3"> </span>deal<span class="_ _3"> </span>with<span class="_ _3"> </span>all</div><div class="t m0 x32 h5 y42 ff2 fs3 fc0 sc0 ls0 ws0">potential<span class="_ _3"> </span>type<span class="_ _5"> </span>combinations.<span class="_ _3"> </span>While<span class="_ _3"> </span>compile-time<span class="_ _3"> </span>static<span class="_ _5"> </span>type<span class="_ _3"> </span>infer<span class="_ _2"></span>-</div><div class="t m0 x32 h5 y43 ff2 fs3 fc0 sc0 ls0 ws0">ence<span class="_ _8"> </span>might<span class="_ _d"> </span>be<span class="_ _8"> </span>able<span class="_ _d"> </span>to<span class="_ _8"> </span>gather<span class="_ _d"> </span>type<span class="_ _8"> </span>information<span class="_ _d"> </span>to<span class="_ _8"> </span>generate<span class="_ _d"> </span>opti-</div><div class="t m0 x32 h5 y44 ff2 fs3 fc0 sc0 ls0 ws0">mized<span class="_ _6"> </span>machine<span class="_ _6"> </span>code,<span class="_ _6"> </span>traditional<span class="_ _6"> </span>static<span class="_ _8"> </span>analysis<span class="_ _6"> </span>is<span class="_ _6"> </span>very<span class="_ _6"> </span>expensi<span class="_ _2"></span>ve</div><div class="t m0 x32 h5 y45 ff2 fs3 fc0 sc0 ls0 ws0">and<span class="_ _5"> </span>hence<span class="_ _5"> </span>not<span class="_ _3"> </span>well<span class="_ _5"> </span>suited<span class="_ _5"> </span>for<span class="_ _5"> </span>the<span class="_ _5"> </span>highly<span class="_ _3"> </span>interacti<span class="_ _2"></span>v<span class="_ _2"></span>e<span class="_ _5"> </span>en<span class="_ _2"></span>vironment<span class="_ _5"> </span>of</div><div class="t m0 x32 h5 y23 ff2 fs3 fc0 sc0 ls0 ws0">a<span class="_ _5"> </span>web<span class="_ _5"> </span>browser<span class="_ _2"></span>.</div><div class="t m0 x33 h5 y24 ff2 fs3 fc0 sc0 ls0 ws0">W<span class="_ _b"></span>e<span class="_ _d"> </span>present<span class="_ _8"> </span>a<span class="_ _d"> </span>trace-based<span class="_ _8"> </span>compilation<span class="_ _d"> </span>technique<span class="_ _8"> </span>for<span class="_ _8"> </span>dynamic</div><div class="t m0 x32 h5 y46 ff2 fs3 fc0 sc0 ls0 ws0">languages<span class="_ _3"> </span>that<span class="_ _5"> </span>reconciles<span class="_ _3"> </span>speed<span class="_ _3"> </span>of<span class="_ _5"> </span>compilation<span class="_ _3"> </span>with<span class="_ _3"> </span>e<span class="_ _2"></span>xcellent<span class="_ _3"> </span>per<span class="_ _2"></span>-</div><div class="t m0 x32 h5 y47 ff2 fs3 fc0 sc0 ls0 ws0">formance<span class="_ _5"> </span>of<span class="_ _7"> </span>the<span class="_ _5"> </span>generated<span class="_ _7"> </span>machine<span class="_ _5"> </span>code.<span class="_ _5"> </span>Our<span class="_ _7"> </span>system<span class="_ _5"> </span>uses<span class="_ _7"> </span>a<span class="_ _5"> </span>mixed-</div><div class="t m0 x32 h5 y48 ff2 fs3 fc0 sc0 ls0 ws0">mode<span class="_ _5"> </span>ex<span class="_ _2"></span>ecution<span class="_ _5"> </span>approach:<span class="_ _5"> </span>the<span class="_ _5"> </span>system<span class="_ _7"> </span>starts<span class="_ _5"> </span>running<span class="_ _5"> </span>Jav<span class="_ _2"></span>aScript<span class="_ _5"> </span>in<span class="_ _5"> </span>a</div><div class="t m0 x32 h5 y49 ff2 fs3 fc0 sc0 ls0 ws0">fast-starting<span class="_ _3"> </span>bytecode<span class="_ _5"> </span>interpreter<span class="_ _2"></span>.<span class="_ _5"> </span>As<span class="_ _3"> </span>the<span class="_ _3"> </span>program<span class="_ _5"> </span>runs,<span class="_ _3"> </span>the<span class="_ _5"> </span>system</div><div class="t m0 x32 h5 y4a ff2 fs3 fc0 sc0 ls0 ws0">identifies<span class="_ _d"> </span><span class="ffa">hot<span class="_ _d"> </span></span>(frequently<span class="_ _d"> </span>e<span class="_ _2"></span>xecuted)<span class="_ _8"> </span>bytecode<span class="_ _d"> </span>sequences,<span class="_ _d"> </span>records</div><div class="t m0 x32 h5 y4b ff2 fs3 fc0 sc0 ls0 ws0">them,<span class="_ _6"> </span>and<span class="_ _8"> </span>compiles<span class="_ _6"> </span>them<span class="_ _6"> </span>to<span class="_ _8"> </span>fast<span class="_ _6"> </span>nativ<span class="_ _2"></span>e<span class="_ _6"> </span>code.<span class="_ _6"> </span>W<span class="_ _2"></span>e<span class="_ _6"> </span>call<span class="_ _6"> </span>such<span class="_ _6"> </span>a<span class="_ _8"> </span>se-</div><div class="t m0 x32 h5 y4c ff2 fs3 fc0 sc0 ls0 ws0">quence<span class="_ _5"> </span>of<span class="_ _5"> </span>instructions<span class="_ _3"> </span>a<span class="_ _5"> </span><span class="ffa">tr<span class="_ _2"></span>ace<span class="ff2">.</span></span></div><div class="t m0 x33 h5 y4d ff2 fs3 fc0 sc0 ls0 ws0">Unlike<span class="_ _8"> </span>method-based<span class="_ _d"> </span>dynamic<span class="_ _d"> </span>compilers,<span class="_ _d"> </span>our<span class="_ _8"> </span>dynamic<span class="_ _d"> </span>com-</div><div class="t m0 x32 h5 y4e ff2 fs3 fc0 sc0 ls0 ws0">piler<span class="_ _8"> </span>operates<span class="_ _8"> </span>at<span class="_ _8"> </span>the<span class="_ _8"> </span>granularity<span class="_ _8"> </span>of<span class="_ _8"> </span>individual<span class="_ _6"> </span>loops.<span class="_ _8"> </span>This<span class="_ _8"> </span>design</div><div class="t m0 x32 h5 y4f ff2 fs3 fc0 sc0 ls0 ws0">choice<span class="_ _8"> </span>is<span class="_ _8"> </span>based<span class="_ _8"> </span>on<span class="_ _8"> </span>the<span class="_ _8"> </span>expectation<span class="_ _8"> </span>that<span class="_ _8"> </span>programs<span class="_ _8"> </span>spend<span class="_ _8"> </span>most<span class="_ _8"> </span>of</div><div class="t m0 x32 h5 y50 ff2 fs3 fc0 sc0 ls0 ws0">their<span class="_ _3"> </span>time<span class="_ _3"> </span>in<span class="_ _6"> </span>hot<span class="_ _3"> </span>loops.<span class="_ _3"> </span>Even<span class="_ _3"> </span>in<span class="_ _3"> </span>dynamically<span class="_ _6"> </span>typed<span class="_ _3"> </span>languages,<span class="_ _3"> </span>we</div><div class="t m0 x32 h5 y51 ff2 fs3 fc0 sc0 ls0 ws0">expect<span class="_ _5"> </span>hot<span class="_ _7"> </span>loops<span class="_ _5"> </span>to<span class="_ _5"> </span>be<span class="_ _5"> </span>mostly<span class="_ _7"> </span><span class="ffa">type-stable</span>,<span class="_ _5"> </span>meaning<span class="_ _5"> </span>that<span class="_ _5"> </span>the<span class="_ _7"> </span>types<span class="_ _5"> </span>of</div><div class="t m0 x32 h5 y52 ff2 fs3 fc0 sc0 ls0 ws0">values<span class="_ _5"> </span>are<span class="_ _7"> </span>in<span class="_ _2"></span>variant.<span class="_ _7"> </span>(12)<span class="_ _5"> </span>For<span class="_ _5"> </span>e<span class="_ _2"></span>xample,<span class="_ _5"> </span>we<span class="_ _7"> </span>would<span class="_ _5"> </span>expect<span class="_ _5"> </span>loop<span class="_ _7"> </span>coun-</div><div class="t m0 x32 h5 y53 ff2 fs3 fc0 sc0 ls0 ws0">ters<span class="_ _5"> </span>that<span class="_ _5"> </span>start<span class="_ _3"> </span>as<span class="_ _5"> </span>integers<span class="_ _5"> </span>to<span class="_ _5"> </span>remain<span class="_ _5"> </span>integers<span class="_ _5"> </span>for<span class="_ _5"> </span>all<span class="_ _3"> </span>iterations.<span class="_ _5"> </span>When</div><div class="t m0 x32 h5 y54 ff2 fs3 fc0 sc0 ls0 ws0">both<span class="_ _3"> </span>of<span class="_ _3"> </span>these<span class="_ _6"> </span>expectations<span class="_ _3"> </span>hold,<span class="_ _3"> </span>a<span class="_ _3"> </span>trace-based<span class="_ _3"> </span>compiler<span class="_ _6"> </span>can<span class="_ _3"> </span>cov<span class="_ _2"></span>er</div><div class="t m0 x32 h5 y55 ff2 fs3 fc0 sc0 ls0 ws0">the<span class="_ _5"> </span>program<span class="_ _5"> </span>e<span class="_ _2"></span>xecution<span class="_ _5"> </span>with<span class="_ _5"> </span>a<span class="_ _7"> </span>small<span class="_ _5"> </span>number<span class="_ _5"> </span>of<span class="_ _5"> </span>type-specialized,<span class="_ _5"> </span>ef-</div><div class="t m0 x32 h5 y56 ff2 fs3 fc0 sc0 ls0 ws0">ficiently<span class="_ _5"> </span>compiled<span class="_ _5"> </span>traces.</div><div class="t m0 x33 h5 y57 ff2 fs3 fc0 sc0 ls0 ws0">Each<span class="_ _3"> </span>compiled<span class="_ _5"> </span>trace<span class="_ _5"> </span>covers<span class="_ _5"> </span>one<span class="_ _3"> </span>path<span class="_ _5"> </span>through<span class="_ _3"> </span>the<span class="_ _5"> </span>program<span class="_ _3"> </span>with</div><div class="t m0 x32 h5 y58 ff2 fs3 fc0 sc0 ls0 ws0">one<span class="_ _5"> </span>mapping<span class="_ _5"> </span>of<span class="_ _7"> </span>values<span class="_ _5"> </span>to<span class="_ _7"> </span>types.<span class="_ _5"> </span>When<span class="_ _5"> </span>the<span class="_ _5"> </span>VM<span class="_ _7"> </span>executes<span class="_ _5"> </span>a<span class="_ _7"> </span>compiled</div><div class="t m0 x32 h5 y59 ff2 fs3 fc0 sc0 ls0 ws0">trace,<span class="_ _1"> </span>it<span class="_ _1"> </span>cannot<span class="_ _d"> </span>guarantee<span class="_ _1"> </span>that<span class="_ _1"> </span>the<span class="_ _1"> </span>same<span class="_ _d"> </span>path<span class="_ _1"> </span>will<span class="_ _1"> </span>be<span class="_ _d"> </span>followed</div><div class="t m0 x32 h5 y5a ff2 fs3 fc0 sc0 ls0 ws0">or<span class="_ _d"> </span>that<span class="_ _8"> </span>the<span class="_ _d"> </span>same<span class="_ _d"> </span>types<span class="_ _8"> </span>will<span class="_ _d"> </span>occur<span class="_ _d"> </span>in<span class="_ _8"> </span>subsequent<span class="_ _d"> </span>loop<span class="_ _d"> </span>iterations.</div></div><div class="pi" data-data='{"ctm":[1.673203,0.000000,0.000000,1.673203,0.000000,0.000000]}'></div></div></div>
|