<br><br><div class="gmail_quote">On Mon, May 17, 2010 at 9:04 PM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2010/5/17 Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;:<br>
<div><div></div><div class="h5">&gt;<br>
&gt;<br>
&gt; On Mon, May 17, 2010 at 11:30 AM, Stéphane Ducasse<br>
&gt; &lt;<a href="mailto:stephane.ducasse@inria.fr">stephane.ducasse@inria.fr</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; On Ma<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; bytes 28 to 31: image flags, conventional VMs use only bit 0, Cog also<br>
&gt;&gt; &gt; uses bits 1 through 4<br>
&gt;&gt; &gt;               bit 0: 1 =&gt; open full screen, 0 =&gt; open using width &amp;<br>
&gt;&gt; &gt; height<br>
&gt;&gt; &gt;               bit 1: 1 =&gt; image floats are in little-endian format, 0=&gt;<br>
&gt;&gt; &gt; image floats are in big-endian format<br>
&gt;&gt; &gt;               bit 2: 1 =&gt; Process&#39;s 4th inst var (after myList) is<br>
&gt;&gt; &gt; threadId to be used by the VM for overlapped calls<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;               bit 3: 1 =&gt; set the flag bit on methods that the VM will<br>
&gt;&gt; &gt; only interpret (because they&#39;re considered too big to JIT)<br>
&gt;&gt; &gt;               bit 4: 1 =&gt; preempting a process does not put it to the<br>
&gt;&gt; &gt; back of its run queue<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; I was not clear how to read<br>
&gt;&gt;        bit 3: 1<br>
&gt;&gt; this information is not in the compiledMethods?<br>
&gt;<br>
&gt; For the Cog JIT I want to measure which methods get interpreted to determine<br>
&gt; the threshold at which to decide to JIT methods.  It makes little sense to<br>
&gt; JIT methods that are large and only executed once, typically class<br>
&gt; initialization methods. A simple criterion is to set a limit on the number<br>
&gt; of literals in a method.  But I still need to know whether my threshold is<br>
&gt; affecting frequently used methods.  So I added the option of setting the<br>
&gt; flag bit in any method which the JIT refuses to compile because it has too<br>
&gt; many literals.  Since I need to see which methods are interpreted on<br>
&gt; start-up putting a flag in the image header was convenient.  The effect is<br>
&gt; that the JIT will set the flag bit on any method it refuses to JIT.  I can<br>
&gt; then browse these in the image and decide whether any are important and<br>
&gt; adjust the threshold accordingly.  Arguably this should be a command line<br>
&gt; argument, not an image header flag.<br>
<br>
</div></div>Eliot, i beg you, instead of using an obscure flags in image header,<br>
just add (or reserve unused) splObject indice and read/write whatever<br>
you want from there.<br></blockquote><div><br></div><div>SOme times it isn&#39;t appropriate to put flags in the special objects array.  Further, changing the specialObjectsArray isn&#39;t only a VM change, its also a change to SystemDictionary&gt;&gt;recreateSpecialObjectsArray.  For all the flags which can be set in the header I provide access through vmParameterAt:[put:].</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
I guess that Cog having substantial changes all around places, so<br>
adding a convenient API for VM flags<br>
and removing a bit fiddling from image header, would make things<br>
transparent and easy to use from language side.<br></blockquote><div><br></div><div>Ah, ok.  That exists in vmParameterAt:[put:].  i.e. here&#39;s what&#39;s different in vmParameterAt:put: at Teleplace:</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>VM parameters are numbered as follows:</div>
<div><span class="Apple-tab-span" style="white-space: pre; ">                </span>...</div><div><div><span class="Apple-tab-span" style="white-space:pre">                </span>4<span class="Apple-tab-span" style="white-space:pre">        </span>allocationCount (read-only; nil in Cog VMs)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>5<span class="Apple-tab-span" style="white-space:pre">        </span>allocations between GCs (read-write; nil in Cog VMs)</div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>...<div>
<span class="Apple-tab-span" style="white-space:pre">                </span>41<span class="Apple-tab-span" style="white-space: pre; ">        </span>imageFormatVersion for the VM</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>42<span class="Apple-tab-span" style="white-space:pre">        </span>number of stack pages in use (Cog Stack VM only, otherwise nil)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>43<span class="Apple-tab-span" style="white-space:pre">        </span>desired number of stack pages (stored in image file header, max 65535; Cog VMs only, otherwise nil)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>44<span class="Apple-tab-span" style="white-space:pre">        </span>size of eden, in bytes (Cog VMs only, otherwise nil)</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>45<span class="Apple-tab-span" style="white-space:pre">        </span>desired size of eden, in bytes (stored in image file header; Cog VMs only, otherwise nil)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>46<span class="Apple-tab-span" style="white-space:pre">        </span>size of machine code zone, in bytes (stored in image file header; Cog JIT VM only, otherwise nil)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>47<span class="Apple-tab-span" style="white-space:pre">        </span>desired size of machine code zone, in bytes (applies at startup only, stored in image file header; Cog JIT VM only)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>48<span class="Apple-tab-span" style="white-space:pre">        </span>various properties of the Cog VM as an integer encoding an array of bit flags.</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span> Bit 0: implies the image&#39;s Process class has threadId as its 3rd inst var (zero relative)</div>
<div><div><span class="Apple-tab-span" style="white-space: pre; ">                        </span> Bit 1: if set, methods that are interpreted will have the flag bit set in their header</div><div><span class="Apple-tab-span" style="white-space: pre; ">                        </span> Bit 2: if set, implies preempting a process does not put it to the back of its run queue</div>
</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>49-55 reserved for VM parameters that persist in the image (such as eden above)</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>56<span class="Apple-tab-span" style="white-space:pre">        </span>number of process switches since startup (read-only)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>57<span class="Apple-tab-span" style="white-space:pre">        </span>number of ioProcessEvents calls since startup (read-only)</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>58<span class="Apple-tab-span" style="white-space:pre">        </span>number of ForceInterruptCheck (Cog VMs) or quickCheckInterruptCalls (non-Cog VMs) calls since startup (read-only)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>59<span class="Apple-tab-span" style="white-space:pre">        </span>number of check event calls since startup (read-only)</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>60<span class="Apple-tab-span" style="white-space:pre">        </span>number of stack page overflows since startup (read-only; Cog VMs only)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>61<span class="Apple-tab-span" style="white-space:pre">        </span>number of stack page divorces since startup (read-only; Cog VMs only)</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>62<span class="Apple-tab-span" style="white-space:pre">        </span>compiled code compactions since startup (read-only; Cog only; otherwise nil)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>63<span class="Apple-tab-span" style="white-space:pre">        </span>total milliseconds in compiled code compactions since startup (read-only; Cog only; otherwise nil)</div>
<div><br></div></div><div><br></div></div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
&gt;&gt;<br>
&gt;&gt; Stef<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Pharo-project mailing list<br>
&gt;&gt; <a href="mailto:Pharo-project@lists.gforge.inria.fr">Pharo-project@lists.gforge.inria.fr</a><br>
&gt;&gt; <a href="http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project" target="_blank">http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project</a><br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Pharo-project mailing list<br>
&gt; <a href="mailto:Pharo-project@lists.gforge.inria.fr">Pharo-project@lists.gforge.inria.fr</a><br>
&gt; <a href="http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project" target="_blank">http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project</a><br>
&gt;<br>
<br>
<br>
<br>
</div><div class="im">--<br>
Best regards,<br>
Igor Stasenko AKA sig.<br>
<br>
_______________________________________________<br>
</div><div><div></div><div class="h5">Pharo-project mailing list<br>
<a href="mailto:Pharo-project@lists.gforge.inria.fr">Pharo-project@lists.gforge.inria.fr</a><br>
<a href="http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project" target="_blank">http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project</a></div></div></blockquote></div><br>