ExperimentalBit

Last days I needed to migrate some old code I used to have in the VM for tracing objects usage. Luc Fabresse also wanted 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 and public. So….the following is only one morning work we did together with Luc, so don’t expect that much. What we did is to do a very small change in the VM 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 unmark 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.
To download:

Gofer it
url: 'http://ss3.gemstone.com/ss/ExperimentalBit';
package: 'ConfigurationOfExperimentalBit';
load.
Now…. you can read ConfigurationOfExperimentalBit class comment:
———————

ExperimentalBit is a small facade for setting and getting the value of a bit in the Object Header. It requires a special VM which supports the primitives to set and get the value of such bit. You can get an already compiled MacOSX VM from: https://gforge.inria.fr/frs/download.php/30042/CogMTVM-ExperimentalBit.zip. For more details read class comment of ExperimentalBitHandler.

If you already have a compiled VM with the required primitives, then you can just load the image side part evaluating:

((Smalltalk at: #ConfigurationOfExperimentalBit) project version: ‘1.0’) load.

If you want to build a VM with the primitives we need, you need to download:

((Smalltalk at: #ConfigurationOfExperimentalBit) project version: ‘1.0’) load: ‘VMMakerGroup’.

And then follow the steps to build the VM:

http://code.google.com/p/cog/
http://code.google.com/p/cog/wiki/Guide

———————-

And here ExperimentalBitHandler class comment:

———————-

ExperimentalBitHandler is a small facade for setting and getting the value of a bit in the Object Header. It requires a special VM which supports the primitives to set and get the value of such bit. You can get an already compiled MacOSX VM from: https://gforge.inria.fr/frs/download.php/30042/CogMTVM-ExperimentalBit.zip.

To know which version of the VM you have to use to compile, check the dependencies in ConfigurationOfExperimentalBit and also the ‘description’ of it. For example, if version 1.0 it depends on ‘CogVM’ version ‘3.7’. 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 repo.

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:

‘aString’ experimentalBit: true.
‘astring ‘ experimentalBit.
Date today experimentalBit: false.
Date today experimentalBit.
ExperimentalBitHandler turnOffExperimentalBitOfAllObjects.

For more details see ExperimentalBitTest.

——————–

Happy New Year to all Smalltalk hackers!!!

Advertisements

One response to “ExperimentalBit

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: