[BUG?] Discrepancies in Low Level Object Header tests

Andrew C. Greenberg werdna at gate.net
Thu Sep 2 01:47:50 UTC 1999


I am in the process of documenting the various Slang artifacts, 
including interpreterProxy.  In so doing, I noted that there are a 
number of inconsistencies between the treatment of various oop header 
tests in Behavior, ObjectMemory and InterpreterProxy.  In particular:

	ObjectMemory>>isWords: oop

returns true if, and only if the format header is precisely 6, but

	InterpreterProxy>>isWords: oop

returns true as above, but also when the format header is 7.  This is 
not a problem in practice, since 7 is presently unused, however,

	Behavor>>isWords

returns true whenever the oop's class' format header is between 0 and 
8!  Thus, in general,

	(oop class isWords) ~= (interpreterProxy isWords: oop)

and in the odd case of a renegade header of 7, it is possible for the 
simulator's interpreterProxy may behave differently from its machine 
language cousin.

-----------

The inconsistency can be reconciled if we conjoin the left hand side 
of the previous equation with a limitation to non-pointers, thus

	(oop class isWords and: [oop class isPointers]) =
		(interpreterProxy isWords: oop)

seems to be true in general.

-----------

Similarly, there appears to be a subtle discrepancy between the 
implementation in ObjectMemory and the interpreterProxy, since the 
former picks up headers numbered 6, and then 8 to 11; while the 
latter also picks up any number between 8 and 15.  This is only 
different for instances of the single Class CompiledMethod, but it is 
a difference nevertheless.

-----------

Is there a reason for these discrepancies, and should they be reconciled?





More information about the Squeak-dev mailing list