1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 04:50:09 +00:00
pdf2htmlEX/demo/demo3.page
2013-09-28 13:30:57 +08:00

2 lines
34 KiB
Plaintext

<div class="pd w0 h0"><div id="pf3" class="pf" data-page-no="3"><div class="pc pc3"><img class="bi x2f yd4 w4 h10" alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+wAAAJDCAIAAAAehglQAAAACXBIWXMAABYlAAAWJQFJUiTwAAAJ1klEQVR42u3WMQ0AAAgEMcC/50cFA0kr4aarAgAAXukkKgAAwCMjAQAAmHgAAMDEAwAAJh4AAEw8AABg4gEAABMPAAAmHgAAMPEAAICJBwAAEw8AAJh4AADAxAMAgIkHAABMPAAAYOIBAMDEAwAAJh4AADDxAABg4gEAABMPAACYeAAAMPEAAICJBwAATDwAAJh4AADAxAMAACYeAABMPAAAYOIBAAATDwAAmHgAADDxAACAiQcAAEw8AACYeAAAwMQDAAAmHgAATDwAAGDiAQAAEw8AACYeAAAw8QAAgIkHAAATDwAAmHgAAMDEAwCAiQcAAEw8AABg4gEAwMQDAAAmHgAAMPEAAGDiAQAAEw8AAJh4AAAw8QAAgIkHAABMPAAAYOIBAMDEAwAAJh4AADDxAABg4gEAABMPAACYeAAAMPEAAICJBwAATDwAAJh4AADAxAMAACYeAABMPAAAYOIBAAATDwAAJh4AADDxAACAiQcAABMPAACYeAAAwMQDAICJBwAATDwAAGDiAQDAxAMAACYeAAAw8QAAgIkHAAATDwAAmHgAAMDEAwCAiQcAAEw8AABg4gEAwMQDAAAmHgAAMPEAAGDiAQAAEw8AAJh4AAAw8QAAgIkHAABMPAAAmHgAAMDEAwAAJh4AAEw8AABg4gEAABMPAAAmHgAAMPEAAICJBwAAEw8AAJh4AADAxAMAACYeAABMPAAAYOIBAAATDwAAJh4AADDxAACAiQcAABMPAACYeAAAwMQDAICJBwAATDwAAGDiAQDAxAMAACYeAAAw8QAAYOIBAAATDwAAmHgAADDxAACAiQcAAE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AAATDwAAJh4AADDxAACAiQcAABMPAACYeAAAwMQDAICJBwAATDwAAGDiAQDAxAMAACYeAAAw8QAAYOIBAAATDwAAmHgAADDxAACAiQcAAEw8AACYeAAAwMQDAAAmHgAATDwAAGDiAQAAEw8AAJh4AAAw8QAAgIkHAABMPAAAmHgAAMDEAwAAJh4AAEw8AABg4gEAABMPAAAmHgAAMPEAAICJBwAAEw8AAJh4AADAxAMAgIkHAABMPAAAYOIBAMDEAwAAJh4AADDxAABg4gEAABMPAACYeAAAMPEAAICJBwAATDwAAGDiAQAAAADg2gK/1wd/GvIbIgAAAABJRU5ErkJggg=="/><div class="t m0 x2f hc y9e ff7 fs3 fc0 sc0 ls0 ws0">v0<span class="_ _1"> </span>:=<span class="_ _e"> </span>ld<span class="_ _1"> </span>state[748]<span class="_ _10"> </span>//<span class="_ _e"> </span>load<span class="_ _1"> </span>primes<span class="_ _e"> </span>from<span class="_ _1"> </span>the<span class="_ _e"> </span>trace<span class="_ _1"> </span>activation<span class="_ _e"> </span>record</div><div class="t m0 x52 hc y9f ff7 fs3 fc0 sc0 ls0 ws0">st<span class="_ _1"> </span>sp[0],<span class="_ _e"> </span>v0<span class="_ _11"> </span>//<span class="_ _1"> </span>store<span class="_ _e"> </span>primes<span class="_ _1"> </span>to<span class="_ _e"> </span>interpreter<span class="_ _1"> </span>stack</div><div class="t m0 x2f hc ya0 ff7 fs3 fc0 sc0 ls0 ws0">v1<span class="_ _1"> </span>:=<span class="_ _e"> </span>ld<span class="_ _1"> </span>state[764]<span class="_ _10"> </span>//<span class="_ _e"> </span>load<span class="_ _1"> </span>k<span class="_ _e"> </span>from<span class="_ _1"> </span>the<span class="_ _e"> </span>trace<span class="_ _1"> </span>activation<span class="_ _e"> </span>record</div><div class="t m0 x2f hc ya1 ff7 fs3 fc0 sc0 ls0 ws0">v2<span class="_ _1"> </span>:=<span class="_ _e"> </span>i2f(v1)<span class="_ _12"> </span>//<span class="_ _1"> </span>convert<span class="_ _e"> </span>k<span class="_ _1"> </span>from<span class="_ _e"> </span>int<span class="_ _1"> </span>to<span class="_ _e"> </span>double</div><div class="t m0 x52 hc ya2 ff7 fs3 fc0 sc0 ls0 ws0">st<span class="_ _1"> </span>sp[8],<span class="_ _e"> </span>v1<span class="_ _11"> </span>//<span class="_ _1"> </span>store<span class="_ _e"> </span>k<span class="_ _1"> </span>to<span class="_ _e"> </span>interpreter<span class="_ _1"> </span>stack</div><div class="t m0 x52 hc ya3 ff7 fs3 fc0 sc0 ls0 ws0">st<span class="_ _1"> </span>sp[16],<span class="_ _e"> </span>0<span class="_ _11"> </span>//<span class="_ _1"> </span>store<span class="_ _e"> </span>false<span class="_ _1"> </span>to<span class="_ _e"> </span>interpreter<span class="_ _1"> </span>stack</div><div class="t m0 x2f hc yd5 ff7 fs3 fc0 sc0 ls0 ws0">v3<span class="_ _1"> </span>:=<span class="_ _e"> </span>ld<span class="_ _1"> </span>v0[4]<span class="_ _13"> </span>//<span class="_ _1"> </span>load<span class="_ _e"> </span>class<span class="_ _1"> </span>word<span class="_ _e"> </span>for<span class="_ _1"> </span>primes</div><div class="t m0 x2f hc yd6 ff7 fs3 fc0 sc0 ls0 ws0">v4<span class="_ _1"> </span>:=<span class="_ _e"> </span>and<span class="_ _1"> </span>v3,<span class="_ _e"> </span>-4<span class="_ _14"> </span>//<span class="_ _1"> </span>mask<span class="_ _e"> </span>out<span class="_ _1"> </span>object<span class="_ _e"> </span>class<span class="_ _1"> </span>tag<span class="_ _e"> </span>for<span class="_ _1"> </span>primes</div><div class="t m0 x2f hc yd7 ff7 fs3 fc0 sc0 ls0 ws0">v5<span class="_ _1"> </span>:=<span class="_ _e"> </span>eq<span class="_ _1"> </span>v4,<span class="_ _e"> </span>Array<span class="_ _11"> </span>//<span class="_ _1"> </span>test<span class="_ _e"> </span>whether<span class="_ _1"> </span>primes<span class="_ _e"> </span>is<span class="_ _1"> </span>an<span class="_ _e"> </span>array</div><div class="t m0 x52 hc yd8 ff7 fs3 fc0 sc0 ls0 ws0">xf<span class="_ _1"> </span>v5<span class="_ _15"> </span>//<span class="_ _1"> </span>side<span class="_ _e"> </span>exit<span class="_ _1"> </span>if<span class="_ _e"> </span>v5<span class="_ _1"> </span>is<span class="_ _e"> </span>false</div><div class="t m0 x2f hc yd9 ff7 fs3 fc0 sc0 ls0 ws0">v6<span class="_ _1"> </span>:=<span class="_ _e"> </span>js_Array_set(v0,<span class="_ _1"> </span>v2,<span class="_ _e"> </span>false)<span class="_ _16"> </span>//<span class="_ _1"> </span>call<span class="_ _e"> </span>function<span class="_ _1"> </span>to<span class="_ _e"> </span>set<span class="_ _1"> </span>array<span class="_ _e"> </span>element</div><div class="t m0 x2f hc yda ff7 fs3 fc0 sc0 ls0 ws0">v7<span class="_ _1"> </span>:=<span class="_ _e"> </span>eq<span class="_ _1"> </span>v6,<span class="_ _e"> </span>0<span class="_ _13"> </span>//<span class="_ _1"> </span>test<span class="_ _1"> </span>return<span class="_ _e"> </span>value<span class="_ _1"> </span>from<span class="_ _e"> </span>call</div><div class="t m0 x52 hc ydb ff7 fs3 fc0 sc0 ls0 ws0">xt<span class="_ _1"> </span>v7<span class="_ _15"> </span>//<span class="_ _1"> </span>side<span class="_ _e"> </span>exit<span class="_ _1"> </span>if<span class="_ _e"> </span>js_Array_set<span class="_ _1"> </span>returns<span class="_ _e"> </span>false.</div><div class="t m0 x2f h5 ydc ff1 fs3 fc0 sc0 ls0 ws0">Figure<span class="_ _3"> </span>3.<span class="_ _1"> </span>LIR<span class="_ _6"> </span>snippet<span class="_ _6"> </span>for<span class="_ _6"> </span>sample<span class="_ _6"> </span>pr<span class="_ _2"></span>ogram.<span class="_ _6"> </span><span class="ff2">This<span class="_ _6"> </span>is<span class="_ _6"> </span>the<span class="_ _6"> </span>LIR<span class="_ _3"> </span>recorded<span class="_ _6"> </span>for<span class="_ _6"> </span>line<span class="_ _6"> </span>5<span class="_ _6"> </span>of<span class="_ _6"> </span>the<span class="_ _6"> </span>sample<span class="_ _6"> </span>program<span class="_ _6"> </span>in<span class="_ _6"> </span>Figure<span class="_ _6"> </span>1.<span class="_ _6"> </span>The<span class="_ _3"> </span>LIR<span class="_ _6"> </span>encodes</span></div><div class="t m0 x2f h5 ydd ff2 fs3 fc0 sc0 ls0 ws0">the<span class="_ _3"> </span>semantics<span class="_ _6"> </span>in<span class="_ _3"> </span>SSA<span class="_ _6"> </span>form<span class="_ _3"> </span>using<span class="_ _6"> </span>temporary<span class="_ _3"> </span>variables.<span class="_ _3"> </span>The<span class="_ _6"> </span>LIR<span class="_ _3"> </span>also<span class="_ _6"> </span>encodes<span class="_ _3"> </span>all<span class="_ _3"> </span>the<span class="_ _6"> </span>stores<span class="_ _3"> </span>that<span class="_ _6"> </span>the<span class="_ _3"> </span>interpreter<span class="_ _6"> </span>would<span class="_ _3"> </span>do<span class="_ _6"> </span>to<span class="_ _3"> </span>its<span class="_ _3"> </span>data<span class="_ _6"> </span>stack.</div><div class="t m0 x2f h5 ye ff2 fs3 fc0 sc0 ls0 ws0">Sometimes<span class="_ _5"> </span>these<span class="_ _3"> </span>stores<span class="_ _5"> </span>can<span class="_ _5"> </span>be<span class="_ _5"> </span>optimized<span class="_ _5"> </span>away<span class="_ _5"> </span>as<span class="_ _3"> </span>the<span class="_ _5"> </span>stack<span class="_ _5"> </span>locations<span class="_ _5"> </span>are<span class="_ _3"> </span>li<span class="_ _2"></span>v<span class="_ _2"></span>e<span class="_ _5"> </span>only<span class="_ _5"> </span>on<span class="_ _3"> </span>e<span class="_ _2"></span>xits<span class="_ _5"> </span>to<span class="_ _5"> </span>the<span class="_ _5"> </span>interpreter<span class="_ _2"></span>.<span class="_ _5"> </span>Finally<span class="_ _2"></span>,<span class="_ _5"> </span>the<span class="_ _5"> </span>LIR<span class="_ _5"> </span>records<span class="_ _3"> </span>guards</div><div class="t m0 x2f h5 y10 ff2 fs3 fc0 sc0 ls0 ws0">and<span class="_ _5"> </span>side<span class="_ _5"> </span>exits<span class="_ _5"> </span>to<span class="_ _5"> </span>verify<span class="_ _5"> </span>the<span class="_ _3"> </span>assumptions<span class="_ _5"> </span>made<span class="_ _5"> </span>in<span class="_ _5"> </span>this<span class="_ _5"> </span>recording:<span class="_ _5"> </span>that<span class="_ _5"> </span><span class="ff7">primes<span class="_ _3"> </span></span>is<span class="_ _5"> </span>an<span class="_ _5"> </span>array<span class="_ _5"> </span>and<span class="_ _5"> </span>that<span class="_ _5"> </span>the<span class="_ _3"> </span>call<span class="_ _5"> </span>to<span class="_ _5"> </span>set<span class="_ _5"> </span>its<span class="_ _5"> </span>element<span class="_ _5"> </span>succeeds.</div><div class="t m0 x2f hc yde ff7 fs3 fc0 sc0 ls0 ws0">mov<span class="_ _1"> </span>edx,<span class="_ _e"> </span>ebx(748)<span class="_ _11"> </span>//<span class="_ _1"> </span>load<span class="_ _e"> </span>primes<span class="_ _1"> </span>from<span class="_ _e"> </span>the<span class="_ _1"> </span>trace<span class="_ _e"> </span>activation<span class="_ _1"> </span>record</div><div class="t m0 x2f hc ydf ff7 fs3 fc0 sc0 ls0 ws0">mov<span class="_ _1"> </span>edi(0),<span class="_ _e"> </span>edx<span class="_ _14"> </span>//<span class="_ _1"> </span>(*)<span class="_ _e"> </span>store<span class="_ _1"> </span>primes<span class="_ _e"> </span>to<span class="_ _1"> </span>interpreter<span class="_ _e"> </span>stack</div><div class="t m0 x2f hc ye0 ff7 fs3 fc0 sc0 ls0 ws0">mov<span class="_ _1"> </span>esi,<span class="_ _e"> </span>ebx(764)<span class="_ _11"> </span>//<span class="_ _1"> </span>load<span class="_ _e"> </span>k<span class="_ _1"> </span>from<span class="_ _e"> </span>the<span class="_ _1"> </span>trace<span class="_ _e"> </span>activation<span class="_ _1"> </span>record</div><div class="t m0 x2f hc ye1 ff7 fs3 fc0 sc0 ls0 ws0">mov<span class="_ _1"> </span>edi(8),<span class="_ _e"> </span>esi<span class="_ _14"> </span>//<span class="_ _1"> </span>(*)<span class="_ _e"> </span>store<span class="_ _1"> </span>k<span class="_ _e"> </span>to<span class="_ _1"> </span>interpreter<span class="_ _e"> </span>stack</div><div class="t m0 x2f hc ye2 ff7 fs3 fc0 sc0 ls0 ws0">mov<span class="_ _1"> </span>edi(16),<span class="_ _e"> </span>0<span class="_ _17"> </span>//<span class="_ _1"> </span>(*)<span class="_ _e"> </span>store<span class="_ _1"> </span>false<span class="_ _e"> </span>to<span class="_ _1"> </span>interpreter<span class="_ _e"> </span>stack</div><div class="t m0 x2f hc ye3 ff7 fs3 fc0 sc0 ls0 ws0">mov<span class="_ _1"> </span>eax,<span class="_ _e"> </span>edx(4)<span class="_ _14"> </span>//<span class="_ _1"> </span>(*)<span class="_ _e"> </span>load<span class="_ _1"> </span>object<span class="_ _e"> </span>class<span class="_ _1"> </span>word<span class="_ _e"> </span>for<span class="_ _1"> </span>primes</div><div class="t m0 x2f hc ye4 ff7 fs3 fc0 sc0 ls0 ws0">and<span class="_ _1"> </span>eax,<span class="_ _e"> </span>-4<span class="_ _18"> </span>//<span class="_ _1"> </span>(*)<span class="_ _e"> </span>mask<span class="_ _1"> </span>out<span class="_ _e"> </span>object<span class="_ _1"> </span>class<span class="_ _e"> </span>tag<span class="_ _1"> </span>for<span class="_ _e"> </span>primes</div><div class="t m0 x2f hc ye5 ff7 fs3 fc0 sc0 ls0 ws0">cmp<span class="_ _1"> </span>eax,<span class="_ _e"> </span>Array<span class="_ _17"> </span>//<span class="_ _1"> </span>(*)<span class="_ _e"> </span>test<span class="_ _1"> </span>whether<span class="_ _e"> </span>primes<span class="_ _1"> </span>is<span class="_ _e"> </span>an<span class="_ _1"> </span>array</div><div class="t m0 x2f hc ye6 ff7 fs3 fc0 sc0 ls0 ws0">jne<span class="_ _1"> </span>side_exit_1<span class="_ _14"> </span>//<span class="_ _e"> </span>(*)<span class="_ _1"> </span>side<span class="_ _e"> </span>exit<span class="_ _1"> </span>if<span class="_ _e"> </span>primes<span class="_ _1"> </span>is<span class="_ _e"> </span>not<span class="_ _1"> </span>an<span class="_ _e"> </span>array</div><div class="t m0 x2f hc ye7 ff7 fs3 fc0 sc0 ls0 ws0">sub<span class="_ _1"> </span>esp,<span class="_ _e"> </span>8<span class="_ _15"> </span>//<span class="_ _1"> </span>bump<span class="_ _1"> </span>stack<span class="_ _e"> </span>for<span class="_ _1"> </span>call<span class="_ _e"> </span>alignment<span class="_ _1"> </span>convention</div><div class="t m0 x2f hc ye8 ff7 fs3 fc0 sc0 ls0 ws0">push<span class="_ _1"> </span>false<span class="_ _15"> </span>//<span class="_ _1"> </span>push<span class="_ _e"> </span>last<span class="_ _1"> </span>argument<span class="_ _e"> </span>for<span class="_ _1"> </span>call</div><div class="t m0 x2f hc ye9 ff7 fs3 fc0 sc0 ls0 ws0">push<span class="_ _1"> </span>esi<span class="_ _19"> </span>//<span class="_ _1"> </span>push<span class="_ _e"> </span>first<span class="_ _1"> </span>argument<span class="_ _e"> </span>for<span class="_ _1"> </span>call</div><div class="t m0 x2f hc yea ff7 fs3 fc0 sc0 ls0 ws0">call<span class="_ _1"> </span>js_Array_set<span class="_ _11"> </span>//<span class="_ _e"> </span>call<span class="_ _1"> </span>function<span class="_ _e"> </span>to<span class="_ _1"> </span>set<span class="_ _e"> </span>array<span class="_ _1"> </span>element</div><div class="t m0 x2f hc yeb ff7 fs3 fc0 sc0 ls0 ws0">add<span class="_ _1"> </span>esp,<span class="_ _e"> </span>8<span class="_ _15"> </span>//<span class="_ _1"> </span>clean<span class="_ _1"> </span>up<span class="_ _e"> </span>extra<span class="_ _1"> </span>stack<span class="_ _e"> </span>space</div><div class="t m0 x2f hc yec ff7 fs3 fc0 sc0 ls0 ws0">mov<span class="_ _1"> </span>ecx,<span class="_ _e"> </span>ebx<span class="_ _12"> </span>//<span class="_ _1"> </span>(*)<span class="_ _e"> </span>created<span class="_ _1"> </span>by<span class="_ _e"> </span>register<span class="_ _1"> </span>allocator</div><div class="t m0 x2f hc yed ff7 fs3 fc0 sc0 ls0 ws0">test<span class="_ _1"> </span>eax,<span class="_ _e"> </span>eax<span class="_ _13"> </span>//<span class="_ _1"> </span>(*)<span class="_ _1"> </span>test<span class="_ _e"> </span>return<span class="_ _1"> </span>value<span class="_ _e"> </span>of<span class="_ _1"> </span>js_Array_set</div><div class="t m0 x2f hc yee ff7 fs3 fc0 sc0 ls0 ws0">je<span class="_ _1"> </span>side_exit_2<span class="_ _17"> </span>//<span class="_ _e"> </span>(*)<span class="_ _1"> </span>side<span class="_ _e"> </span>exit<span class="_ _1"> </span>if<span class="_ _e"> </span>call<span class="_ _1"> </span>failed</div><div class="t m0 x2f hc yef ff7 fs3 fc0 sc0 ls0 ws0">...</div><div class="t m0 x2f hc yf0 ff7 fs3 fc0 sc0 ls0 ws0">side_exit_1:</div><div class="t m0 x2f hc yf1 ff7 fs3 fc0 sc0 ls0 ws0">mov<span class="_ _1"> </span>ecx,<span class="_ _e"> </span>ebp(-4)<span class="_ _1a"> </span>//<span class="_ _1"> </span>restore<span class="_ _e"> </span>ecx</div><div class="t m0 x2f hc yf2 ff7 fs3 fc0 sc0 ls0 ws0">mov<span class="_ _1"> </span>esp,<span class="_ _e"> </span>ebp<span class="_ _12"> </span>//<span class="_ _1"> </span>restore<span class="_ _e"> </span>esp</div><div class="t m0 x2f hc yf3 ff7 fs3 fc0 sc0 ls0 ws0">jmp<span class="_ _1"> </span>epilog<span class="_ _15"> </span>//<span class="_ _1"> </span>jump<span class="_ _e"> </span>to<span class="_ _1"> </span>ret<span class="_ _e"> </span>statement</div><div class="t m0 x2f h5 yf4 ff1 fs3 fc0 sc0 ls0 ws0">Figure<span class="_ _5"> </span>4.<span class="_ _1"> </span>x86<span class="_ _7"> </span>snippet<span class="_ _5"> </span>for<span class="_ _5"> </span>sample<span class="_ _7"> </span>program.<span class="_ _5"> </span><span class="ff2">This<span class="_ _5"> </span>is<span class="_ _7"> </span>the<span class="_ _5"> </span>x86<span class="_ _5"> </span>code<span class="_ _5"> </span>compiled<span class="_ _5"> </span>from<span class="_ _7"> </span>the<span class="_ _5"> </span>LIR<span class="_ _5"> </span>snippet<span class="_ _5"> </span>in<span class="_ _7"> </span>Figure<span class="_ _5"> </span>3.<span class="_ _5"> </span>Most<span class="_ _5"> </span>LIR<span class="_ _5"> </span>instructions<span class="_ _7"> </span>compile</span></div><div class="t m0 x2f h5 yf5 ff2 fs3 fc0 sc0 ls0 ws0">to<span class="_ _3"> </span>a<span class="_ _3"> </span>single<span class="_ _3"> </span>x86<span class="_ _3"> </span>instruction.<span class="_ _3"> </span>Instructions<span class="_ _3"> </span>marked<span class="_ _3"> </span>with<span class="_ _3"> </span><span class="ff7">(*)<span class="_ _3"> </span></span>would<span class="_ _3"> </span>be<span class="_ _3"> </span>omitted<span class="_ _3"> </span>by<span class="_ _3"> </span>an<span class="_ _3"> </span>idealized<span class="_ _3"> </span>compiler<span class="_ _3"> </span>that<span class="_ _3"> </span>knew<span class="_ _3"> </span>that<span class="_ _3"> </span>none<span class="_ _3"> </span>of<span class="_ _3"> </span>the<span class="_ _3"> </span>side<span class="_ _3"> </span>exits</div><div class="t m0 x2f h5 yf6 ff2 fs3 fc0 sc0 ls0 ws0">would<span class="_ _5"> </span>ever<span class="_ _5"> </span>be<span class="_ _5"> </span>taken.<span class="_ _3"> </span>The<span class="_ _5"> </span>17<span class="_ _5"> </span>instructions<span class="_ _3"> </span>generated<span class="_ _5"> </span>by<span class="_ _5"> </span>the<span class="_ _3"> </span>compiler<span class="_ _5"> </span>compare<span class="_ _5"> </span>fav<span class="_ _2"></span>orably<span class="_ _5"> </span>with<span class="_ _3"> </span>the<span class="_ _5"> </span>100+<span class="_ _5"> </span>instructions<span class="_ _3"> </span>that<span class="_ _5"> </span>the<span class="_ _3"> </span>interpreter<span class="_ _5"> </span>would</div><div class="t m0 x2f h5 yf7 ff2 fs3 fc0 sc0 ls0 ws0">ex<span class="_ _2"></span>ecute<span class="_ _5"> </span>for<span class="_ _5"> </span>the<span class="_ _3"> </span>same<span class="_ _5"> </span>code<span class="_ _5"> </span>snippet,<span class="_ _5"> </span>including<span class="_ _5"> </span>4<span class="_ _5"> </span>indirect<span class="_ _5"> </span>jumps.</div><div class="t m0 x34 h5 yf8 ff1 fs3 fc0 sc0 ls0 ws0">i=2.<span class="_ _8"> </span><span class="ff2">This<span class="_ _8"> </span>is<span class="_ _8"> </span>the<span class="_ _8"> </span>first<span class="_ _8"> </span>iteration<span class="_ _d"> </span>of<span class="_ _6"> </span>the<span class="_ _8"> </span>outer<span class="_ _d"> </span>loop.<span class="_ _6"> </span>The<span class="_ _8"> </span>loop<span class="_ _d"> </span>on</span></div><div class="t m0 x2f h5 yf9 ff2 fs3 fc0 sc0 ls0 ws0">lines<span class="_ _5"> </span>4-5<span class="_ _3"> </span>becomes<span class="_ _5"> </span>hot<span class="_ _3"> </span>on<span class="_ _5"> </span>its<span class="_ _5"> </span>second<span class="_ _3"> </span>iteration,<span class="_ _5"> </span>so<span class="_ _5"> </span>TraceMonke<span class="_ _2"></span>y<span class="_ _5"> </span>en-</div><div class="t m0 x2f h5 yfa ff2 fs3 fc0 sc0 ls0 ws0">ters<span class="_ _6"> </span>recording<span class="_ _6"> </span>mode<span class="_ _6"> </span>on<span class="_ _6"> </span>line<span class="_ _8"> </span>4.<span class="_ _6"> </span>In<span class="_ _6"> </span>recording<span class="_ _6"> </span>mode,<span class="_ _6"> </span>TraceMonke<span class="_ _2"></span>y</div><div class="t m0 x2f h5 yfb ff2 fs3 fc0 sc0 ls0 ws0">records<span class="_ _5"> </span>the<span class="_ _3"> </span>code<span class="_ _5"> </span>along<span class="_ _5"> </span>the<span class="_ _5"> </span>trace<span class="_ _3"> </span>in<span class="_ _5"> </span>a<span class="_ _5"> </span>low-le<span class="_ _2"></span>v<span class="_ _2"></span>el<span class="_ _5"> </span>compiler<span class="_ _3"> </span>intermedi-</div><div class="t m0 x2f h5 yfc ff2 fs3 fc0 sc0 ls0 ws0">ate<span class="_ _5"> </span>representation<span class="_ _3"> </span>we<span class="_ _5"> </span>call<span class="_ _5"> </span><span class="ffa">LIR</span>.<span class="_ _5"> </span>The<span class="_ _3"> </span>LIR<span class="_ _5"> </span>trace<span class="_ _5"> </span>encodes<span class="_ _5"> </span>all<span class="_ _3"> </span>the<span class="_ _5"> </span>oper-</div><div class="t m0 x2f h5 yfd ff2 fs3 fc0 sc0 ls0 ws0">ations<span class="_ _5"> </span>performed<span class="_ _3"> </span>and<span class="_ _5"> </span>the<span class="_ _3"> </span>types<span class="_ _5"> </span>of<span class="_ _5"> </span>all<span class="_ _3"> </span>operands.<span class="_ _5"> </span>The<span class="_ _3"> </span>LIR<span class="_ _5"> </span>trace<span class="_ _5"> </span>also</div><div class="t m0 x2f h5 yfe ff2 fs3 fc0 sc0 ls0 ws0">encodes<span class="_ _3"> </span><span class="ffa">guar<span class="_ _2"></span>ds<span class="ff2">,<span class="_ _5"> </span>which<span class="_ _3"> </span>are<span class="_ _3"> </span>checks<span class="_ _3"> </span>that<span class="_ _5"> </span>verify<span class="_ _3"> </span>that<span class="_ _3"> </span>the<span class="_ _5"> </span>control<span class="_ _3"> </span>flow</span></span></div><div class="t m0 x2f h5 yff ff2 fs3 fc0 sc0 ls0 ws0">and<span class="_ _6"> </span>types<span class="_ _8"> </span>are<span class="_ _6"> </span>identical<span class="_ _8"> </span>to<span class="_ _6"> </span>those<span class="_ _8"> </span>observed<span class="_ _6"> </span>during<span class="_ _6"> </span>trace<span class="_ _8"> </span>recording.</div><div class="t m0 x2f h5 y100 ff2 fs3 fc0 sc0 ls0 ws0">Thus,<span class="_ _3"> </span>on<span class="_ _3"> </span>later<span class="_ _3"> </span>ex<span class="_ _2"></span>ecutions,<span class="_ _3"> </span>if<span class="_ _3"> </span>and<span class="_ _3"> </span>only<span class="_ _3"> </span>if<span class="_ _3"> </span>all<span class="_ _3"> </span>guards<span class="_ _3"> </span>are<span class="_ _3"> </span>passed,<span class="_ _3"> </span>the</div><div class="t m0 x2f h5 y101 ff2 fs3 fc0 sc0 ls0 ws0">trace<span class="_ _5"> </span>has<span class="_ _5"> </span>the<span class="_ _3"> </span>required<span class="_ _5"> </span>program<span class="_ _5"> </span>semantics.</div><div class="t m0 x34 h5 y102 ff2 fs3 fc0 sc0 ls0 ws0">T<span class="_ _2"></span>raceMonke<span class="_ _2"></span>y<span class="_ _d"> </span>stops<span class="_ _d"> </span>recording<span class="_ _d"> </span>when<span class="_ _d"> </span>execution<span class="_ _d"> </span>returns<span class="_ _d"> </span>to<span class="_ _d"> </span>the</div><div class="t m0 x2f h5 y103 ff2 fs3 fc0 sc0 ls0 ws0">loop<span class="_ _3"> </span>header<span class="_ _5"> </span>or<span class="_ _3"> </span>exits<span class="_ _5"> </span>the<span class="_ _3"> </span>loop.<span class="_ _3"> </span>In<span class="_ _5"> </span>this<span class="_ _3"> </span>case,<span class="_ _3"> </span>e<span class="_ _2"></span>x<span class="_ _2"></span>ecution<span class="_ _3"> </span>returns<span class="_ _5"> </span>to<span class="_ _3"> </span>the</div><div class="t m0 x2f h5 y104 ff2 fs3 fc0 sc0 ls0 ws0">loop<span class="_ _5"> </span>header<span class="_ _5"> </span>on<span class="_ _3"> </span>line<span class="_ _5"> </span>4.</div><div class="t m0 x34 h5 y105 ff2 fs3 fc0 sc0 ls0 ws0">After<span class="_ _3"> </span>recording<span class="_ _5"> </span>is<span class="_ _3"> </span>finished,<span class="_ _5"> </span>TraceMonk<span class="_ _2"></span>ey<span class="_ _5"> </span>compiles<span class="_ _3"> </span>the<span class="_ _5"> </span>trace<span class="_ _3"> </span>to</div><div class="t m0 x2f h5 y106 ff2 fs3 fc0 sc0 ls0 ws0">nativ<span class="_ _2"></span>e<span class="_ _3"> </span>code<span class="_ _3"> </span>using<span class="_ _6"> </span>the<span class="_ _3"> </span>recorded<span class="_ _3"> </span>type<span class="_ _6"> </span>information<span class="_ _3"> </span>for<span class="_ _3"> </span>optimization.</div><div class="t m0 x2f h5 y107 ff2 fs3 fc0 sc0 ls0 ws0">The<span class="_ _d"> </span>result<span class="_ _d"> </span>is<span class="_ _d"> </span>a<span class="_ _d"> </span>nativ<span class="_ _2"></span>e<span class="_ _d"> </span>code<span class="_ _d"> </span>fragment<span class="_ _d"> </span>that<span class="_ _d"> </span>can<span class="_ _d"> </span>be<span class="_ _d"> </span>entered<span class="_ _d"> </span>if<span class="_ _d"> </span>the</div><div class="t m0 x32 h5 yf8 ff2 fs3 fc0 sc0 ls0 ws0">interpreter<span class="_ _3"> </span>PC<span class="_ _5"> </span>and<span class="_ _3"> </span>the<span class="_ _3"> </span>types<span class="_ _5"> </span>of<span class="_ _3"> </span>v<span class="_ _2"></span>alues<span class="_ _3"> </span>match<span class="_ _5"> </span>those<span class="_ _3"> </span>observed<span class="_ _5"> </span>when</div><div class="t m0 x32 h5 yf9 ff2 fs3 fc0 sc0 ls0 ws0">trace<span class="_ _8"> </span>recording<span class="_ _8"> </span>was<span class="_ _8"> </span>started.<span class="_ _8"> </span>The<span class="_ _8"> </span>first<span class="_ _8"> </span>trace<span class="_ _8"> </span>in<span class="_ _8"> </span>our<span class="_ _d"> </span>e<span class="_ _2"></span>xample,<span class="_ _8"> </span><span class="fff">T</span></div><div class="t m0 x53 h8 y108 ff8 fs4 fc0 sc0 ls0 ws0">45</div><div class="t m0 x54 h5 yf9 ff2 fs3 fc0 sc0 ls0 ws0">,</div><div class="t m0 x32 h5 yfa ff2 fs3 fc0 sc0 ls0 ws0">cov<span class="_ _2"></span>ers<span class="_ _5"> </span>lines<span class="_ _5"> </span>4<span class="_ _5"> </span>and<span class="_ _5"> </span>5.<span class="_ _5"> </span>This<span class="_ _5"> </span>trace<span class="_ _5"> </span>can<span class="_ _5"> </span>be<span class="_ _5"> </span>entered<span class="_ _5"> </span>if<span class="_ _5"> </span>the<span class="_ _5"> </span>PC<span class="_ _5"> </span>is<span class="_ _5"> </span>at<span class="_ _5"> </span>line<span class="_ _5"> </span>4,</div><div class="t m0 x32 h5 yfb ff7 fs3 fc0 sc0 ls0 ws0">i<span class="_ _5"> </span><span class="ff2">and<span class="_ _5"> </span></span>k<span class="_ _5"> </span><span class="ff2">are<span class="_ _5"> </span>inte<span class="_ _2"></span>gers,<span class="_ _5"> </span>and<span class="_ _5"> </span><span class="ff7">primes<span class="_ _7"> </span></span>is<span class="_ _5"> </span>an<span class="_ _5"> </span>object.<span class="_ _5"> </span>After<span class="_ _5"> </span>compiling<span class="_ _5"> </span><span class="fff">T</span></span></div><div class="t m0 x53 h8 y109 ff8 fs4 fc0 sc0 ls0 ws0">45</div><div class="t m0 x54 h5 yfb ff2 fs3 fc0 sc0 ls0 ws0">,</div><div class="t m0 x32 h5 yfc ff2 fs3 fc0 sc0 ls0 ws0">T<span class="_ _2"></span>raceMonke<span class="_ _2"></span>y<span class="_ _5"> </span>returns<span class="_ _5"> </span>to<span class="_ _3"> </span>the<span class="_ _5"> </span>interpreter<span class="_ _5"> </span>and<span class="_ _5"> </span>loops<span class="_ _5"> </span>back<span class="_ _5"> </span>to<span class="_ _5"> </span>line<span class="_ _3"> </span>1.</div><div class="t m0 x33 h5 yfd ff1 fs3 fc0 sc0 ls0 ws0">i=3.<span class="_ _3"> </span><span class="ff2">Now<span class="_ _6"> </span>the<span class="_ _3"> </span>loop<span class="_ _6"> </span>header<span class="_ _3"> </span>at<span class="_ _6"> </span>line<span class="_ _3"> </span>1<span class="_ _6"> </span>has<span class="_ _6"> </span>become<span class="_ _3"> </span>hot,<span class="_ _6"> </span>so<span class="_ _3"> </span>Trace-</span></div><div class="t m0 x32 h5 yfe ff2 fs3 fc0 sc0 ls0 ws0">Monkey<span class="_ _6"> </span>starts<span class="_ _8"> </span>recording.<span class="_ _8"> </span>When<span class="_ _8"> </span>recording<span class="_ _8"> </span>reaches<span class="_ _8"> </span>line<span class="_ _d"> </span>4,<span class="_ _6"> </span>Trace-</div><div class="t m0 x32 h5 yff ff2 fs3 fc0 sc0 ls0 ws0">Monkey<span class="_ _3"> </span>observ<span class="_ _2"></span>es<span class="_ _3"> </span>that<span class="_ _3"> </span>it<span class="_ _3"> </span>has<span class="_ _3"> </span>reached<span class="_ _3"> </span>an<span class="_ _3"> </span>inner<span class="_ _3"> </span>loop<span class="_ _3"> </span>header<span class="_ _3"> </span>that<span class="_ _3"> </span>al-</div><div class="t m0 x32 h5 y100 ff2 fs3 fc0 sc0 ls0 ws0">ready<span class="_ _3"> </span>has<span class="_ _6"> </span>a<span class="_ _6"> </span>compiled<span class="_ _3"> </span>trace,<span class="_ _6"> </span>so<span class="_ _3"> </span>TraceMonk<span class="_ _2"></span>ey<span class="_ _3"> </span>attempts<span class="_ _6"> </span>to<span class="_ _3"> </span>nest<span class="_ _6"> </span>the</div><div class="t m0 x32 h5 y101 ff2 fs3 fc0 sc0 ls0 ws0">inner<span class="_ _5"> </span>loop<span class="_ _3"> </span>inside<span class="_ _5"> </span>the<span class="_ _5"> </span>current<span class="_ _5"> </span>trace.<span class="_ _5"> </span>The<span class="_ _3"> </span>first<span class="_ _5"> </span>step<span class="_ _5"> </span>is<span class="_ _5"> </span>to<span class="_ _3"> </span>ca<span class="_ _2"></span>ll<span class="_ _5"> </span>the<span class="_ _5"> </span>inner</div><div class="t m0 x32 h5 y102 ff2 fs3 fc0 sc0 ls0 ws0">trace<span class="_ _5"> </span>as<span class="_ _7"> </span>a<span class="_ _5"> </span>subroutine.<span class="_ _7"> </span>This<span class="_ _5"> </span>ex<span class="_ _2"></span>ecutes<span class="_ _5"> </span>the<span class="_ _7"> </span>loop<span class="_ _5"> </span>on<span class="_ _7"> </span>line<span class="_ _5"> </span>4<span class="_ _7"> </span>to<span class="_ _5"> </span>completion</div><div class="t m0 x32 h5 y103 ff2 fs3 fc0 sc0 ls0 ws0">and<span class="_ _5"> </span>then<span class="_ _3"> </span>returns<span class="_ _5"> </span>to<span class="_ _5"> </span>the<span class="_ _5"> </span>recorder<span class="_ _2"></span>.<span class="_ _5"> </span>T<span class="_ _2"></span>raceMonke<span class="_ _2"></span>y<span class="_ _5"> </span>verifies<span class="_ _5"> </span>that<span class="_ _3"> </span>the<span class="_ _5"> </span>call</div><div class="t m0 x32 h5 y104 ff2 fs3 fc0 sc0 ls0 ws0">was<span class="_ _5"> </span>successful<span class="_ _5"> </span>and<span class="_ _5"> </span>then<span class="_ _5"> </span>records<span class="_ _7"> </span>the<span class="_ _5"> </span>call<span class="_ _5"> </span>to<span class="_ _5"> </span>the<span class="_ _5"> </span>inner<span class="_ _5"> </span>trace<span class="_ _5"> </span>as<span class="_ _5"> </span>part<span class="_ _5"> </span>of</div><div class="t m0 x32 h5 y105 ff2 fs3 fc0 sc0 ls0 ws0">the<span class="_ _3"> </span>current<span class="_ _5"> </span>trace.<span class="_ _3"> </span>Recording<span class="_ _5"> </span>continues<span class="_ _3"> </span>until<span class="_ _3"> </span>e<span class="_ _2"></span>x<span class="_ _2"></span>ecution<span class="_ _3"> </span>reaches<span class="_ _5"> </span>line</div><div class="t m0 x32 h5 y106 ff2 fs3 fc0 sc0 ls0 ws0">1,<span class="_ _3"> </span>and<span class="_ _6"> </span>at<span class="_ _3"> </span>which<span class="_ _3"> </span>point<span class="_ _3"> </span>TraceMonke<span class="_ _2"></span>y<span class="_ _3"> </span>finishes<span class="_ _3"> </span>and<span class="_ _6"> </span>compiles<span class="_ _3"> </span>a<span class="_ _3"> </span>trace</div><div class="t m0 x32 h5 y107 ff2 fs3 fc0 sc0 ls0 ws0">for<span class="_ _5"> </span>the<span class="_ _5"> </span>outer<span class="_ _3"> </span>loop,<span class="_ _5"> </span><span class="fff">T</span></div><div class="t m0 x55 h8 y10a ff8 fs4 fc0 sc0 ls0 ws0">16</div><div class="t m0 x56 h5 y107 ff2 fs3 fc0 sc0 ls0 ws0">.</div></div><div class="pi" data-data='{"ctm":[1.673203,0.000000,0.000000,1.673203,0.000000,0.000000]}'></div></div></div>