On Wed, Mar 7, 2012 at 1:57 AM, Stefan Marr smalltalk@stefan-marr.dewrote:
Hi Eliot:
On 07 Mar 2012, at 01:47, Eliot Miranda wrote:
But the flag is really useful for VM/image communication.
Right, that's what I want to use it for. Flagged methods will allow me to mark exit points from a special interpretation mode. In that special mode, I enforce certain additional semantics, but need to be able to disable that to get back to the normal mode. The flag seems to be a convenient way to do that.
This is related to the above. I've just added support to Squeak trunk
for accessing the sign bit in the method header and using this as an additional flag.
Ehm, I am not completely with you. I think, I misunderstand something here, which header word exactly?
I looked through the diff of VMMaker.oscog-eem.146 and see this line: ^(objectMemory integerValueOf: (self headerOf: aMethodObj)) < 0
Isn't that the mark bit for the GC? Or am I confusing something?
Yes, you're confusing the object header with the method header, which is unsurprising. herderOf: should really be called methodHeaderOf: but isn't (again history). So this is the sign bit in the method header (a SmallInteger) and is the bit next to the flag bit.
#headerOf: should be the first word of every object, right?
You'd think, but no :)
And at least in the RoarVM (I doubt that this is different from the standard interpreter), MarkBit is defined as (1 << 31), isn't that exactly the sign bit?
Purely coincidental ;)
Thanks Stefan
-- Stefan Marr Software Languages Lab Vrije Universiteit Brussel Pleinlaan 2 / B-1050 Brussels / Belgium http://soft.vub.ac.be/~smarr Phone: +32 2 629 2974 Fax: +32 2 629 3525