Hi guys. Last days I needed to migrate some old code I used to have in the <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">VM</span> for tracing objects usage. <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">Luc</span> <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">Fabresse</span>
 wanted also to be able to set and get the value of a bit in the object 
header to do some experiments. So...we thought it was a good idea to 
make it abstract an public. So....the following is only one morning work
 we did together with <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">Luc</span>, so don&#39;t expect that much. What we did is to do a very small change in the <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">VM</span> to use one free bit in the object header, and then we coded 3 primitives: one to get the value, one to set it and one to <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">unmark</span>
 all objects. The idea is that you can use this code and give semantics 
to the bit. This is just for experimenting and prototypes, not for 
production code since such bit in the object header may not be 
available. <br>
<br>
To download:<br>
<br clear="all">Gofer it<br>    <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">url</span>: &#39;<a href="http://ss3.gemstone.com/ss/ExperimentalBit" target="_blank">http://ss3.gemstone.com/<span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">ss</span>/<span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">ExperimentalBit</span></a>&#39;; <br>

    package: &#39;<span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">ConfigurationOfExperimentalBit</span>&#39;;<br>load.<br><br>
<br>
Now.... you can read <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">ConfigurationOfExperimentalBit</span>  class comment:<br>
<br>
<br>
---------------<br>
<br>
<span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">ExperimentalBit</span> is a small facade for setting and getting the value of a bit in the Object Header. It requires a special <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">VM</span> which supports the primitives to set and get the value of such bit. You can get a already compiled <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">MacOSX</span> <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">VM</span> from: <a href="https://gforge.inria.fr/frs/download.php/30042/CogMTVM-ExperimentalBit.zip">https://<span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">gforge</span>.<span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">inria</span>.fr/<span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">frs</span>/download.<span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">php</span>/30042/<span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">CogMTVM</span>-<span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">ExperimentalBit</span>.zip</a>. For more details read class comment of <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">ExperimentalBitHandler</span>.<br>

<br>
If you already have a compiled <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">VM</span> with the required primitives, then you can just load the image side part evaluating:<br>
<br>
((Smalltalk at: #<span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">ConfigurationOfExperimentalBit</span>) project version: &#39;1.0&#39;) load.<br>
<br>
If you want to build a <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">VM</span> with the primitives we need, you need to download:<br>
<br>
((Smalltalk at: #<span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">ConfigurationOfExperimentalBit</span>) project version: &#39;1.0&#39;) load: &#39;VMMakerGroup&#39;.<br>
<br>
And then follow the steps to build the <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">VM</span>:<br>
<br>
- <a href="http://code.google.com/p/cog/">http://code.google.com/p/cog/</a><br>
- <a href="http://code.google.com/p/cog/wiki/Guide">http://code.google.com/p/cog/wiki/Guide</a><br>
<br>
-----------<br>
<br>
And here <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">ExperimentalBitHandler</span> class comment:<br>
<br>
-----------<br>
<br>
<span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">ExperimentalBitHandler</span> is a small facade for setting and getting the value of a bit in the Object Header. It requires a special <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">VM</span> which supports the primitives to set and get the value of such bit. You can get a already compiled <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">MacOSX</span> <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">VM</span> from: <a href="https://gforge.inria.fr/frs/download.php/30042/CogMTVM-ExperimentalBit.zip">https://<span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">gforge</span>.<span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">inria</span>.fr/<span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">frs</span>/download.<span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">php</span>/30042/<span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">CogMTVM</span>-<span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">ExperimentalBit</span>.zip</a>.<br>

 <br>
To know which version of the <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">VM</span> you have to use to compile, check the dependencies in <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">ConfigurationOfExperimentalBit</span>
 and also the &#39;description&#39; of it. For example, if version 1.0 it 
depends on &#39;CogVM&#39; version &#39;3.7&#39;. In the description of version 1.0 you 
can also read that the used Git version of the platform code was 
4a65655f0e419248d09a2502ea13b6e787992691 from the blessed <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">repo</span>.<br>
<br>
Basically, there are 3 operations: set the bit to a specific, get the 
value of the bit and turn off the bit of all objects. Examples:<br>
<br>
&#39;aString&#39; <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">experimentalBit</span>: true.<br>
&#39;astring &#39; <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">experimentalBit</span>.<br>
Date today <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">experimentalBit</span>: false.<br>
Date today <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">experimentalBit</span>. <br>
<span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">ExperimentalBitHandler</span> <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">turnOffExperimentalBitOfAllObjects</span>.<br>

<br>
For more details see <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">ExperimentalBitTest</span>.<br>
    <br>
-------------<br>
<br>
<br>
<br>
Happy <span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">Christmats</span> for all the Smalltalk hackers!!!<br>
<br><br>-- <br>Mariano<br><a href="http://marianopeck.wordpress.com/" target="_blank">http://<span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">marianopeck</span>.<span style="background:none repeat scroll 0% 0% yellow" class="J-JK9eJ-PJVNOc">wordpress</span>.com</a><br>

<br>
<br><br><div class="gmail_quote">On Wed, Dec 14, 2011 at 1:24 PM, Mariano Martinez Peck <span dir="ltr">&lt;<a href="mailto:marianopeck@gmail.com">marianopeck@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">
Hi guys. As you may notice, I always try to push in the direction of a VM where we can have both things: a) a really cooler super fast VM for production super critical applications  and b)  the most-flexible-possible VM for doing reasearh and experiment. <br>

<br>Now I was thinking the following:  we have one free bit in the ObjectHeader. Let&#39;s say you are experimenting with something and you would like to tag objects, such as, &quot;traversed&quot;, &quot;processes&quot;, &quot;isProxy&quot;, etc. To do that small experiment you need to modify the VM, adapt the bit, code the primitives, build the VM, put the smalltalk side part etc etc. So I was thinking why not providing such small functionality out of the box?  the idea would be not to give semantics to the bit since each user will do that. So we just provide the VM with 2 primtives, one to get the value (#getBitValue) and one to set it (#setBitTo:). Choose the names you want.  <br>

<br>Then we do not integrate nothing in our images that use such bit, there won&#39;t be colisions. Then each guy who wants to experiments with that, can use the primitives and do what he wants. <br><br>Some people is doing something with its bit: Jean Batiptse is doing XXX, I am doing YYY, etc. Either in his work or mine, there are much more changes that just that bit, so in anyway, I will end up needing my own VM. <br>

<br>Finally, I could help in providing the code if it is needed.<br><br>So, what do you think?<span class="HOEnZb"><font color="#888888"><br clear="all"><br>-- <br>Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br>

<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br><br>