[Vm-dev] CompiledMethod header bits index 29 (flag bit)

Eliot Miranda eliot.miranda at gmail.com
Wed Mar 7 18:21:57 UTC 2012

Oops, let me try again, being a little less agricultural.

On Wed, Mar 7, 2012 at 1:57 AM, Stefan Marr <smalltalk at stefan-marr.de>wrote:

> 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.  headerOf: 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20120307/aa406ddd/attachment.htm

More information about the Vm-dev mailing list